Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Registry

Manages an Azure Container Registry.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var rg = new Azure.Core.ResourceGroup("rg", new Azure.Core.ResourceGroupArgs
        {
            Location = "West US",
        });
        var acr = new Azure.ContainerService.Registry("acr", new Azure.ContainerService.RegistryArgs
        {
            ResourceGroupName = rg.Name,
            Location = rg.Location,
            Sku = "Premium",
            AdminEnabled = false,
            GeoreplicationLocations = 
            {
                "East US",
                "West Europe",
            },
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
            Location: pulumi.String("West US"),
        })
        if err != nil {
            return err
        }
        _, err = containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{
            ResourceGroupName: rg.Name,
            Location:          rg.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
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

rg = azure.core.ResourceGroup("rg", location="West US")
acr = azure.containerservice.Registry("acr",
    resource_group_name=rg.name,
    location=rg.location,
    sku="Premium",
    admin_enabled=False,
    georeplication_locations=[
        "East US",
        "West Europe",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const rg = new azure.core.ResourceGroup("rg", {location: "West US"});
const acr = new azure.containerservice.Registry("acr", {
    resourceGroupName: rg.name,
    location: rg.location,
    sku: "Premium",
    adminEnabled: false,
    georeplicationLocations: [
        "East US",
        "West Europe",
    ],
});

Create a Registry Resource

new Registry(name: string, args: RegistryArgs, opts?: CustomResourceOptions);
def Registry(resource_name: str, opts: Optional[ResourceOptions] = None, admin_enabled: Optional[bool] = None, georeplication_locations: Optional[Sequence[str]] = None, location: Optional[str] = None, name: Optional[str] = None, network_rule_set: Optional[RegistryNetworkRuleSetArgs] = None, resource_group_name: Optional[str] = None, retention_policy: Optional[RegistryRetentionPolicyArgs] = None, sku: Optional[str] = None, storage_account_id: Optional[str] = None, tags: Optional[Mapping[str, str]] = None, trust_policy: Optional[RegistryTrustPolicyArgs] = None)
func NewRegistry(ctx *Context, name string, args RegistryArgs, opts ...ResourceOption) (*Registry, error)
public Registry(string name, RegistryArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Registry Resource Properties

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

Inputs

The Registry resource accepts the following input properties:

ResourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

AdminEnabled bool

Specifies whether the admin user is enabled. Defaults to false.

GeoreplicationLocations List<string>

A list of Azure locations where the container registry should be geo-replicated.

Location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

NetworkRuleSet RegistryNetworkRuleSetArgs

A network_rule_set block as documented below.

RetentionPolicy RegistryRetentionPolicyArgs

A retention_policy block as documented below.

Sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

StorageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

TrustPolicy RegistryTrustPolicyArgs

A trust_policy block as documented below.

ResourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

AdminEnabled bool

Specifies whether the admin user is enabled. Defaults to false.

GeoreplicationLocations []string

A list of Azure locations where the container registry should be geo-replicated.

Location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

NetworkRuleSet RegistryNetworkRuleSet

A network_rule_set block as documented below.

RetentionPolicy RegistryRetentionPolicy

A retention_policy block as documented below.

Sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

StorageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource.

TrustPolicy RegistryTrustPolicy

A trust_policy block as documented below.

resourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

adminEnabled boolean

Specifies whether the admin user is enabled. Defaults to false.

georeplicationLocations string[]

A list of Azure locations where the container registry should be geo-replicated.

location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

networkRuleSet RegistryNetworkRuleSet

A network_rule_set block as documented below.

retentionPolicy RegistryRetentionPolicy

A retention_policy block as documented below.

sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

storageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

trustPolicy RegistryTrustPolicy

A trust_policy block as documented below.

resource_group_name str

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

admin_enabled bool

Specifies whether the admin user is enabled. Defaults to false.

georeplication_locations Sequence[str]

A list of Azure locations where the container registry should be geo-replicated.

location str

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

name str

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

network_rule_set RegistryNetworkRuleSetArgs

A network_rule_set block as documented below.

retention_policy RegistryRetentionPolicyArgs

A retention_policy block as documented below.

sku str

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

storage_account_id str

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

trust_policy RegistryTrustPolicyArgs

A trust_policy block as documented below.

Outputs

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

AdminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

AdminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

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

The URL that can be used to log into the container registry.

AdminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

AdminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

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

The URL that can be used to log into the container registry.

adminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

adminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

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

The URL that can be used to log into the container registry.

admin_password str

The Password associated with the Container Registry Admin account - if the admin account is enabled.

admin_username str

The Username associated with the Container Registry Admin account - if the admin account is enabled.

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

The URL that can be used to log into the container registry.

Look up an Existing Registry Resource

Get an existing Registry 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?: RegistryState, opts?: CustomResourceOptions): Registry
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, admin_enabled: Optional[bool] = None, admin_password: Optional[str] = None, admin_username: Optional[str] = None, georeplication_locations: Optional[Sequence[str]] = None, location: Optional[str] = None, login_server: Optional[str] = None, name: Optional[str] = None, network_rule_set: Optional[RegistryNetworkRuleSetArgs] = None, resource_group_name: Optional[str] = None, retention_policy: Optional[RegistryRetentionPolicyArgs] = None, sku: Optional[str] = None, storage_account_id: Optional[str] = None, tags: Optional[Mapping[str, str]] = None, trust_policy: Optional[RegistryTrustPolicyArgs] = None) -> Registry
func GetRegistry(ctx *Context, name string, id IDInput, state *RegistryState, opts ...ResourceOption) (*Registry, error)
public static Registry Get(string name, Input<string> id, RegistryState? 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:

AdminEnabled bool

Specifies whether the admin user is enabled. Defaults to false.

AdminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

AdminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

GeoreplicationLocations List<string>

A list of Azure locations where the container registry should be geo-replicated.

Location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

LoginServer string

The URL that can be used to log into the container registry.

Name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

NetworkRuleSet RegistryNetworkRuleSetArgs

A network_rule_set block as documented below.

ResourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

RetentionPolicy RegistryRetentionPolicyArgs

A retention_policy block as documented below.

Sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

StorageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

TrustPolicy RegistryTrustPolicyArgs

A trust_policy block as documented below.

AdminEnabled bool

Specifies whether the admin user is enabled. Defaults to false.

AdminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

AdminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

GeoreplicationLocations []string

A list of Azure locations where the container registry should be geo-replicated.

Location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

LoginServer string

The URL that can be used to log into the container registry.

Name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

NetworkRuleSet RegistryNetworkRuleSet

A network_rule_set block as documented below.

ResourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

RetentionPolicy RegistryRetentionPolicy

A retention_policy block as documented below.

Sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

StorageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource.

TrustPolicy RegistryTrustPolicy

A trust_policy block as documented below.

adminEnabled boolean

Specifies whether the admin user is enabled. Defaults to false.

adminPassword string

The Password associated with the Container Registry Admin account - if the admin account is enabled.

adminUsername string

The Username associated with the Container Registry Admin account - if the admin account is enabled.

georeplicationLocations string[]

A list of Azure locations where the container registry should be geo-replicated.

location string

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

loginServer string

The URL that can be used to log into the container registry.

name string

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

networkRuleSet RegistryNetworkRuleSet

A network_rule_set block as documented below.

resourceGroupName string

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

retentionPolicy RegistryRetentionPolicy

A retention_policy block as documented below.

sku string

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

storageAccountId string

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

trustPolicy RegistryTrustPolicy

A trust_policy block as documented below.

admin_enabled bool

Specifies whether the admin user is enabled. Defaults to false.

admin_password str

The Password associated with the Container Registry Admin account - if the admin account is enabled.

admin_username str

The Username associated with the Container Registry Admin account - if the admin account is enabled.

georeplication_locations Sequence[str]

A list of Azure locations where the container registry should be geo-replicated.

location str

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

login_server str

The URL that can be used to log into the container registry.

name str

Specifies the name of the Container Registry. Changing this forces a new resource to be created.

network_rule_set RegistryNetworkRuleSetArgs

A network_rule_set block as documented below.

resource_group_name str

The name of the resource group in which to create the Container Registry. Changing this forces a new resource to be created.

retention_policy RegistryRetentionPolicyArgs

A retention_policy block as documented below.

sku str

The SKU name of the container registry. Possible values are Basic, Standard and Premium. Classic (which was previously Basic) is supported only for existing resources.

storage_account_id str

The ID of a Storage Account which must be located in the same Azure Region as the Container Registry. Changing this forces a new resource to be created.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

trust_policy RegistryTrustPolicyArgs

A trust_policy block as documented below.

Supporting Types

RegistryNetworkRuleSet

DefaultAction string

The behaviour for requests matching no rules. Either Allow or Deny. Defaults to Allow

IpRules List<RegistryNetworkRuleSetIpRuleArgs>

One or more ip_rule blocks as defined below.

VirtualNetworks List<RegistryNetworkRuleSetVirtualNetworkArgs>

One or more virtual_network blocks as defined below.

DefaultAction string

The behaviour for requests matching no rules. Either Allow or Deny. Defaults to Allow

IpRules []RegistryNetworkRuleSetIpRule

One or more ip_rule blocks as defined below.

VirtualNetworks []RegistryNetworkRuleSetVirtualNetwork

One or more virtual_network blocks as defined below.

defaultAction string

The behaviour for requests matching no rules. Either Allow or Deny. Defaults to Allow

ipRules RegistryNetworkRuleSetIpRule[]

One or more ip_rule blocks as defined below.

virtualNetworks RegistryNetworkRuleSetVirtualNetwork[]

One or more virtual_network blocks as defined below.

default_action str

The behaviour for requests matching no rules. Either Allow or Deny. Defaults to Allow

ip_rules Sequence[RegistryNetworkRuleSetIpRuleArgs]

One or more ip_rule blocks as defined below.

virtual_networks Sequence[RegistryNetworkRuleSetVirtualNetworkArgs]

One or more virtual_network blocks as defined below.

RegistryNetworkRuleSetIpRule

Action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

IpRange string

The CIDR block from which requests will match the rule.

Action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

IpRange string

The CIDR block from which requests will match the rule.

action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

ipRange string

The CIDR block from which requests will match the rule.

action str

The behaviour for requests matching this rule. At this time the only supported value is Allow

ip_range str

The CIDR block from which requests will match the rule.

RegistryNetworkRuleSetVirtualNetwork

Action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

SubnetId string

The subnet id from which requests will match the rule.

Action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

SubnetId string

The subnet id from which requests will match the rule.

action string

The behaviour for requests matching this rule. At this time the only supported value is Allow

subnetId string

The subnet id from which requests will match the rule.

action str

The behaviour for requests matching this rule. At this time the only supported value is Allow

subnet_id str

The subnet id from which requests will match the rule.

RegistryRetentionPolicy

Days int

The number of days to retain an untagged manifest after which it gets purged. Default is 7.

Enabled bool

Boolean value that indicates whether the policy is enabled.

Days int

The number of days to retain an untagged manifest after which it gets purged. Default is 7.

Enabled bool

Boolean value that indicates whether the policy is enabled.

days number

The number of days to retain an untagged manifest after which it gets purged. Default is 7.

enabled boolean

Boolean value that indicates whether the policy is enabled.

days int

The number of days to retain an untagged manifest after which it gets purged. Default is 7.

enabled bool

Boolean value that indicates whether the policy is enabled.

RegistryTrustPolicy

Enabled bool

Boolean value that indicates whether the policy is enabled.

Enabled bool

Boolean value that indicates whether the policy is enabled.

enabled boolean

Boolean value that indicates whether the policy is enabled.

enabled bool

Boolean value that indicates whether the policy is enabled.

Import

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

 $ pulumi import azure:containerservice/registry:Registry example /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1

Package Details

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