github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/website/source/docs/providers/azurerm/r/container_registry.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azurerm_container_registry" 4 sidebar_current: "docs-azurerm-resource-container-registry" 5 description: |- 6 Create as an Azure Container Registry instance. 7 --- 8 9 # azurerm\_container\_registry 10 11 Create as an Azure Container Registry instance. 12 13 ## Example Usage 14 15 ``` 16 resource "azurerm_resource_group" "test" { 17 name = "resourceGroup1" 18 location = "West US" 19 } 20 21 resource "azurerm_storage_account" "test" { 22 name = "storageAccount1" 23 resource_group_name = "${azurerm_resource_group.test.name}" 24 location = "${azurerm_resource_group.test.location}" 25 account_type = "Standard_GRS" 26 } 27 28 resource "azurerm_container_registry" "test" { 29 name = "containerRegistry1" 30 resource_group_name = "${azurerm_resource_group.test.name}" 31 location = "${azurerm_resource_group.test.location}" 32 admin_enabled = true 33 34 storage_account { 35 name = "${azurerm_storage_account.test.name}" 36 access_key = "${azurerm_storage_account.test.primary_access_key}" 37 } 38 } 39 40 ``` 41 42 ## Argument Reference 43 44 The following arguments are supported: 45 46 * `name` - (Required) Specifies the name of the Container Registry. Changing this forces a 47 new resource to be created. 48 49 * `resource_group_name` - (Required) The name of the resource group in which to 50 create the Container Registry. 51 52 * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. 53 54 * `admin_enabled` - (Optional) Specifies whether the admin user is enabled. Defaults to `false`. 55 56 * `storage_account` - (Required) A Storage Account block as documented below - which must be located in the same data center as the Container Registry. 57 58 * `tags` - (Optional) A mapping of tags to assign to the resource. 59 60 `storage_account` supports the following: 61 62 * `name` - (Required) The name of the storage account, which must be in the same physical location as the Container Registry. 63 * `access_key` - (Required) The access key to the storage account. 64 65 ## Attributes Reference 66 67 The following attributes are exported: 68 69 * `id` - The Container Registry ID. 70 71 * `login_server` - The URL that can be used to log into the container registry. 72 73 * `admin_username` - The Username associated with the Container Registry Admin account - if the admin account is enabled. 74 75 * `admin_password` - The Password associated with the Container Registry Admin account - if the admin account is enabled. 76 77 ## Import 78 79 Container Registries can be imported using the `resource id`, e.g. 80 81 ``` 82 terraform import azurerm_container_registry.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1 83 ```