Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Azure Classic

v4.28.0 published on Monday, Nov 22, 2021 by Pulumi

RegistryScopeMap

Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    sku: "Premium",
    adminEnabled: false,
    georeplicationLocations: [
        "East US",
        "West Europe",
    ],
});
const exampleRegistryScopeMap = new azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", {
    containerRegistryName: azurerm_container_registry.acr.name,
    resourceGroupName: azurerm_resource_group.rg.name,
    actions: [
        "repositories/repo1/content/read",
        "repositories/repo1/content/write",
    ],
});
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_registry = azure.containerservice.Registry("exampleRegistry",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    sku="Premium",
    admin_enabled=False,
    georeplication_locations=[
        "East US",
        "West Europe",
    ])
example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap",
    container_registry_name=azurerm_container_registry["acr"]["name"],
    resource_group_name=azurerm_resource_group["rg"]["name"],
    actions=[
        "repositories/repo1/content/read",
        "repositories/repo1/content/write",
    ])
using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new Azure.ContainerService.RegistryArgs
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            Sku = "Premium",
            AdminEnabled = false,
            GeoreplicationLocations = 
            {
                "East US",
                "West Europe",
            },
        });
        var exampleRegistryScopeMap = new Azure.ContainerService.RegistryScopeMap("exampleRegistryScopeMap", new Azure.ContainerService.RegistryScopeMapArgs
        {
            ContainerRegistryName = azurerm_container_registry.Acr.Name,
            ResourceGroupName = azurerm_resource_group.Rg.Name,
            Actions = 
            {
                "repositories/repo1/content/read",
                "repositories/repo1/content/write",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/containerservice"
	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		_, err = containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			Sku:               pulumi.String("Premium"),
			AdminEnabled:      pulumi.Bool(false),
			GeoreplicationLocations: pulumi.StringArray{
				pulumi.String("East US"),
				pulumi.String("West Europe"),
			},
		})
		if err != nil {
			return err
		}
		_, err = containerservice.NewRegistryScopeMap(ctx, "exampleRegistryScopeMap", &containerservice.RegistryScopeMapArgs{
			ContainerRegistryName: pulumi.Any(azurerm_container_registry.Acr.Name),
			ResourceGroupName:     pulumi.Any(azurerm_resource_group.Rg.Name),
			Actions: pulumi.StringArray{
				pulumi.String("repositories/repo1/content/read"),
				pulumi.String("repositories/repo1/content/write"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Create a RegistryScopeMap Resource

new RegistryScopeMap(name: string, args: RegistryScopeMapArgs, opts?: CustomResourceOptions);
@overload
def RegistryScopeMap(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     actions: Optional[Sequence[str]] = None,
                     container_registry_name: Optional[str] = None,
                     description: Optional[str] = None,
                     name: Optional[str] = None,
                     resource_group_name: Optional[str] = None)
@overload
def RegistryScopeMap(resource_name: str,
                     args: RegistryScopeMapArgs,
                     opts: Optional[ResourceOptions] = None)
func NewRegistryScopeMap(ctx *Context, name string, args RegistryScopeMapArgs, opts ...ResourceOption) (*RegistryScopeMap, error)
public RegistryScopeMap(string name, RegistryScopeMapArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RegistryScopeMapArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RegistryScopeMapArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RegistryScopeMapArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RegistryScopeMapArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RegistryScopeMap Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The RegistryScopeMap resource accepts the following input properties:

Actions List<string>
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
ContainerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
Description string
Name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
Actions []string
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
ContainerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
Description string
Name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
actions string[]
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
containerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
resourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
description string
name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
actions Sequence[str]
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
container_registry_name str
The name of the Container Registry. Changing this forces a new resource to be created.
resource_group_name str
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
description str
name str
Specifies the name of the scope map. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the RegistryScopeMap resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing RegistryScopeMap Resource

Get an existing RegistryScopeMap resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RegistryScopeMapState, opts?: CustomResourceOptions): RegistryScopeMap
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[str]] = None,
        container_registry_name: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_name: Optional[str] = None) -> RegistryScopeMap
func GetRegistryScopeMap(ctx *Context, name string, id IDInput, state *RegistryScopeMapState, opts ...ResourceOption) (*RegistryScopeMap, error)
public static RegistryScopeMap Get(string name, Input<string> id, RegistryScopeMapState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Actions List<string>
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
ContainerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
Description string
Name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
Actions []string
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
ContainerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
Description string
Name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
ResourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
actions string[]
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
containerRegistryName string
The name of the Container Registry. Changing this forces a new resource to be created.
description string
name string
Specifies the name of the scope map. Changing this forces a new resource to be created.
resourceGroupName string
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.
actions Sequence[str]
A list of actions to attach to the scope map (e.g. repo/content/read, repo2/content/delete).
container_registry_name str
The name of the Container Registry. Changing this forces a new resource to be created.
description str
name str
Specifies the name of the scope map. Changing this forces a new resource to be created.
resource_group_name str
The name of the resource group in which to create the Container Registry token. Changing this forces a new resource to be created.

Import

Container Registries can be imported using the resource id, e.g.

 $ pulumi import azure:containerservice/registryScopeMap:RegistryScopeMap example /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1/scopeMaps/scopemap1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.