github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ~> **Note:** All arguments including the access key will be stored in the raw state as plain-text.
    14  [Read more about sensitive data in state](/docs/state/sensitive-data.html).
    15  
    16  ## Example Usage
    17  
    18  ```hcl
    19  resource "azurerm_resource_group" "test" {
    20    name     = "resourceGroup1"
    21    location = "West US"
    22  }
    23  
    24  resource "azurerm_storage_account" "test" {
    25    name                = "storageAccount1"
    26    resource_group_name = "${azurerm_resource_group.test.name}"
    27    location            = "${azurerm_resource_group.test.location}"
    28    account_type        = "Standard_GRS"
    29  }
    30  
    31  resource "azurerm_container_registry" "test" {
    32    name                = "containerRegistry1"
    33    resource_group_name = "${azurerm_resource_group.test.name}"
    34    location            = "${azurerm_resource_group.test.location}"
    35    admin_enabled       = true
    36  
    37    storage_account {
    38      name       = "${azurerm_storage_account.test.name}"
    39      access_key = "${azurerm_storage_account.test.primary_access_key}"
    40    }
    41  }
    42  ```
    43  
    44  ## Argument Reference
    45  
    46  The following arguments are supported:
    47  
    48  * `name` - (Required) Specifies the name of the Container Registry. Changing this forces a
    49      new resource to be created.
    50  
    51  * `resource_group_name` - (Required) The name of the resource group in which to
    52      create the Container Registry.
    53  
    54  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    55  
    56  * `admin_enabled` - (Optional) Specifies whether the admin user is enabled. Defaults to `false`.
    57  
    58  * `storage_account` - (Required) A Storage Account block as documented below - which must be located in the same data center as the Container Registry.
    59  
    60  * `tags` - (Optional) A mapping of tags to assign to the resource.
    61  
    62  `storage_account` supports the following:
    63  
    64  * `name` - (Required) The name of the storage account, which must be in the same physical location as the Container Registry.
    65  * `access_key` - (Required) The access key to the storage account.
    66  
    67  ## Attributes Reference
    68  
    69  The following attributes are exported:
    70  
    71  * `id` - The Container Registry ID.
    72  
    73  * `login_server` - The URL that can be used to log into the container registry.
    74  
    75  * `admin_username` - The Username associated with the Container Registry Admin account - if the admin account is enabled.
    76  
    77  * `admin_password` - The Password associated with the Container Registry Admin account - if the admin account is enabled.
    78  
    79  ## Import
    80  
    81  Container Registries can be imported using the `resource id`, e.g.
    82  
    83  ```
    84  terraform import azurerm_container_registry.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1
    85  ```