azurermContainerRegistryScopeMap
Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries.
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resource-group",
}
);
const azurermContainerRegistryExample =
new azurerm.containerRegistry.ContainerRegistry(this, "example_1", {
admin_enabled: false,
georeplications: [
{
location: "East US",
},
{
location: "West Europe",
},
],
location: azurermResourceGroupExample.location,
name: "exampleregistry",
resource_group_name: azurermResourceGroupExample.name,
sku: "Premium",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermContainerRegistryExample.overrideLogicalId("example");
const azurermContainerRegistryScopeMapExample =
new azurerm.containerRegistryScopeMap.ContainerRegistryScopeMap(
this,
"example_2",
{
actions: [
"repositories/repo1/content/read",
"repositories/repo1/content/write",
],
container_registry_name: azurermContainerRegistryExample.name,
name: "example-scope-map",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermContainerRegistryScopeMapExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) Specifies the name of the scope map. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created. -
containerRegistryName
- (Required) The name of the Container Registry. Changing this forces a new resource to be created. -
actions
- (Required) A list of actions to attach to the scope map (e.g.repo/content/read
,repo2/content/delete
). -
description
- (Optional) The description of the Container Registry.
Attributes Reference
The following attributes are exported:
id
- The ID of the Container Registry scope map.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Container Registry scope map.update
- (Defaults to 30 minutes) Used when updating the Container Registry scope map.read
- (Defaults to 5 minutes) Used when retrieving the Container Registry scope map.delete
- (Defaults to 30 minutes) Used when deleting the Container Registry scope map.
Import
Container Registries can be imported using the resourceId
, e.g.