github.com/swisspost/terratest@v0.0.0-20230214120104-7ec6de2e1ae0/examples/azure/terraform-azure-acr-example/main.tf (about) 1 # --------------------------------------------------------------------------------------------------------------------- 2 # DEPLOY AN AZURE CONTAINER REGISTRY 3 # This is an example of how to deploy an Azure Container Registry 4 # See test/terraform_azure_acr_example_test.go for how to write automated tests for this code. 5 # --------------------------------------------------------------------------------------------------------------------- 6 7 # ------------------------------------------------------------------------------ 8 # CONFIGURE OUR AZURE CONNECTION 9 # ------------------------------------------------------------------------------ 10 11 provider "azurerm" { 12 version = "~>2.29.0" 13 features {} 14 } 15 16 # --------------------------------------------------------------------------------------------------------------------- 17 # DEPLOY A RESOURCE GROUP 18 # --------------------------------------------------------------------------------------------------------------------- 19 20 resource "azurerm_resource_group" "rg" { 21 name = "terratest-acr-rg-${var.postfix}" 22 location = var.location 23 } 24 25 # --------------------------------------------------------------------------------------------------------------------- 26 # DEPLOY AN AZURE CONTAINER REGISTRY 27 # --------------------------------------------------------------------------------------------------------------------- 28 29 resource "azurerm_container_registry" "acr" { 30 name = "acr${var.postfix}" 31 location = azurerm_resource_group.rg.location 32 resource_group_name = azurerm_resource_group.rg.name 33 34 sku = var.sku 35 admin_enabled = true 36 37 tags = { 38 Environment = "Development" 39 } 40 }