github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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  ## Argument Reference
    42  
    43  The following arguments are supported:
    44  
    45  * `name` - (Required) Specifies the name of the Container Registry. Changing this forces a
    46      new resource to be created.
    47  
    48  * `resource_group_name` - (Required) The name of the resource group in which to
    49      create the Container Registry.
    50  
    51  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    52  
    53  * `admin_enabled` - (Optional) Specifies whether the admin user is enabled. Defaults to `false`.
    54  
    55  * `storage_account` - (Required) A Storage Account block as documented below - which must be located in the same data center as the Container Registry.
    56  
    57  * `tags` - (Optional) A mapping of tags to assign to the resource.
    58  
    59  `storage_account` supports the following:
    60  
    61  * `name` - (Required) The name of the storage account, which must be in the same physical location as the Container Registry.
    62  * `access_key` - (Required) The access key to the storage account.
    63  
    64  ## Attributes Reference
    65  
    66  The following attributes are exported:
    67  
    68  * `id` - The Container Registry ID.
    69  
    70  * `login_server` - The URL that can be used to log into the container registry.
    71  
    72  * `admin_username` - The Username associated with the Container Registry Admin account - if the admin account is enabled.
    73  
    74  * `admin_password` - The Password associated with the Container Registry Admin account - if the admin account is enabled.
    75  
    76  ## Import
    77  
    78  Container Registries can be imported using the `resource id`, e.g.
    79  
    80  ```
    81  terraform import azurerm_container_registry.test /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1
    82  ```