All Products
Search
Document Center

Container Registry:The service-linked role for Alibaba Cloud DNS PrivateZone

Last Updated:Mar 26, 2026

When you configure virtual private cloud (VPC) access control on a Container Registry Enterprise Edition instance, Container Registry automatically creates the AliyunServiceRoleForContainerRegistryAccessCustomerPrivateZone service-linked role. This role grants Container Registry the permissions it needs to manage PrivateZone on your behalf, so the internal domain name of your instance resolves to the correct VPC IP addresses without requiring you to configure permissions manually.

How it works

When you configure VPC access control on a Container Registry Enterprise Edition instance and create VPCs for that instance, Container Registry automatically creates the AliyunServiceRoleForContainerRegistryAccessCustomerPrivateZone service-linked role. Container Registry then assumes this role to access PrivateZone, which resolves the internal domain name of the instance to the IP address of each VPC.

For more information about service-linked roles, see Service-linked roles.

Role details

  • Role name: AliyunServiceRoleForContainerRegistryAccessCustomerPrivateZone

  • Role policy name: AliyunServiceRolePolicyForContainerRegistryAccessCustomerPrivate

Permissions granted by the role:

{
    "Action": [
        "pvtz:AddZone",
        "pvtz:DeleteZone",
        "pvtz:BindZoneVpc",
        "pvtz:UpdateZoneRemark",
        "pvtz:SetProxyPattern",
        "pvtz:DescribeRegions",
        "pvtz:DescribeZoneInfo",
        "pvtz:DescribeZones",
        "pvtz:AddZoneRecord",
        "pvtz:DeleteZoneRecord",
        "pvtz:UpdateRecordRemark",
        "pvtz:DescribeZoneRecords"
    ],
    "Resource": "*",
    "Effect": "Allow"
}

These permissions allow Container Registry to create, query, update, and delete private DNS zones and zone records in PrivateZone, and to bind zones to VPCs.

Delete the service-linked role

Delete this role only if you no longer need VPC access control on your Container Registry Enterprise Edition instance.

Step 1: Remove VPC access control configuration

Before deleting the role, remove all VPCs from your instance's access control configuration.

  1. Log on to the Container Registry console.

  2. In the left-side navigation pane, click Instances.

  3. On the Instances page, click the Enterprise Edition instance you want to manage.

  4. In the left-side navigation pane of the instance management page, choose Repository > Access Control.

  5. On the VPC tab, click Delete in the Actions column for each VPC.

  6. In the confirmation message, click OK.

Step 2: Delete the role in the RAM console

  1. Log on to the RAM console with your Alibaba Cloud account.

  2. In the left-side navigation pane, choose Identities > Roles.

  3. On the Roles page, search for AliyunServiceRoleForContainerRegistryAccessCustomerPrivateZone, then click Delete Role in the Actions column.

  4. In the Delete Role dialog box, enter the role name and click Delete Role.

FAQ

Why wasn't the service-linked role created automatically for my RAM user?

The role is only created automatically for RAM users with the ram:CreateServiceLinkedRole permission scoped to this service. To grant a RAM user the ability to trigger automatic creation, attach the following policy to that user. For more information, see RAM authentication rules.

{
    "Statement": [
        {
            "Action": [
                "ram:CreateServiceLinkedRole"
            ],
            "Resource": "acs:ram:*:Alibaba Cloud account ID:role/*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": [
                        "access-customer-privatezone.cr.aliyuncs.com"
                    ]
                }
            }
        }
    ],
    "Version": "1"
}

Replace Alibaba Cloud account ID with your actual account ID. The ram:ServiceName condition restricts this permission to creating service-linked roles for Container Registry's PrivateZone integration only, preventing the RAM user from creating service-linked roles for other services. The wildcard in Resource allows the permission to apply to any role path within your account.