dependency/azapi_examples/Microsoft.ContainerRegistry_registries_taskRuns@2019-06-01-preview/main.tf (82 lines of code) (raw):

terraform { required_providers { azapi = { source = "Azure/azapi" } } } provider "azapi" { skip_provider_registration = false } variable "resource_name" { type = string default = "acctest0001" } variable "location" { type = string default = "westeurope" } resource "azapi_resource" "resourceGroup" { type = "Microsoft.Resources/resourceGroups@2020-06-01" name = var.resource_name location = var.location } resource "azapi_resource" "registry" { type = "Microsoft.ContainerRegistry/registries@2021-08-01-preview" parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location body = { properties = { adminUserEnabled = false anonymousPullEnabled = false dataEndpointEnabled = false encryption = { status = "disabled" } networkRuleBypassOptions = "AzureServices" policies = { exportPolicy = { status = "enabled" } quarantinePolicy = { status = "disabled" } retentionPolicy = { status = "disabled" } trustPolicy = { status = "disabled" } } publicNetworkAccess = "Enabled" zoneRedundancy = "Disabled" } sku = { name = "Standard" tier = "Standard" } } schema_validation_enabled = false response_export_values = ["*"] } resource "azapi_resource" "taskRun" { type = "Microsoft.ContainerRegistry/registries/taskRuns@2019-06-01-preview" parent_id = azapi_resource.registry.id name = var.resource_name location = var.location body = { properties = { runRequest = { type = "DockerBuildRequest" sourceLocation = "https://github.com/Azure-Samples/aci-helloworld.git#master" dockerFilePath = "Dockerfile" platform = { os = "Linux" } imageNames = ["helloworld:{{.Run.ID}}", "helloworld:latest"] } } } ignore_missing_property = true }