azurerm_container_registry
Manages an Azure Container Registry.
Note: All arguments including the access key will be stored in the raw state as plain-text. Read more about sensitive data in state.
Example Usage
resource "azurerm_resource_group" "test" { name = "resourceGroup1" location = "West US" } resource "azurerm_storage_account" "test" { name = "storageaccount1" resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" account_tier = "Standard" account_replication_type = "GRS" } resource "azurerm_container_registry" "test" { name = "containerRegistry1" resource_group_name = "${azurerm_resource_group.test.name}" location = "${azurerm_resource_group.test.location}" admin_enabled = true sku = "Classic" storage_account_id = "${azurerm_storage_account.test.id}" }
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the Container Registry. Changing this forces a new resource to be created. -
resource_group_name
- (Required) The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created. -
location
- (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -
admin_enabled
- (Optional) Specifies whether the admin user is enabled. Defaults tofalse
. -
storage_account_id
- (Required forClassic
Sku - Optional otherwise) The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. -
sku
- (Optional) The SKU name of the the container registry. Possible values areClassic
(which was previouslyBasic
),Basic
,Standard
andPremium
. -
tags
- (Optional) A mapping of tags to assign to the resource.
Attributes Reference
The following attributes are exported:
-
id
- The Container Registry ID. -
login_server
- The URL that can be used to log into the container registry. -
admin_username
- The Username associated with the Container Registry Admin account - if the admin account is enabled. -
admin_password
- The Password associated with the Container Registry Admin account - if the admin account is enabled.
Import
Container Registries can be imported using the resource id
, e.g.
terraform import azurerm_container_registry.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/azurerm/r/container_registry.html