azurerm_container_registry_token_password

Manages a Container Registry Token Password.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resource-group"
  location = "West Europe"
}

resource "azurerm_container_registry" "example" {
  name                     = "example-registry"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  sku                      = "Premium"
  admin_enabled            = false
  georeplication_locations = ["East US", "West Europe"]
}

resource "azurerm_container_registry_scope_map" "example" {
  name                    = "example-scope-map"
  container_registry_name = azurerm_container_registry.example.name
  resource_group_name     = azurerm_resource_group.example.name
  actions = [
    "repositories/repo1/content/read",
    "repositories/repo1/content/write"
  ]
}

resource "azurerm_container_registry_token" "example" {
  name                    = "exampletoken"
  container_registry_name = azurerm_container_registry.example.name
  resource_group_name     = azurerm_resource_group.example.name
  scope_map_id            = azurerm_container_registry_scope_map.example.id
}

resource "azurerm_container_registry_token_password" "example" {
  container_registry_token_id = azurerm_container_registry_token.example.id

  password1 {
    expiry = "2023-03-22T17:57:36+08:00"
  }
}

Arguments Reference

The following arguments are supported:


A password block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:


A password block exports the following:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Container Registry Token Passwords can be imported using the resource id, e.g.

terraform import azurerm_container_registry_token_password.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.ContainerRegistry/registries/registry1/tokens/token1/passwords/password