1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cr
  5. StorageDomainRoutingRule
Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi
alicloud logo
Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi

    Provides a CR Storage Domain Routing Rule resource.

    Instance Storage Domain Routing Rule.

    For information about CR Storage Domain Routing Rule and how to use it, see What is Storage Domain Routing Rule.

    NOTE: Available since v1.265.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.cr.RegistryEnterpriseInstance("default", {
        paymentType: "Subscription",
        period: 1,
        renewPeriod: 1,
        renewalStatus: "AutoRenewal",
        instanceType: "Advanced",
        instanceName: name,
    });
    const defaultStorageDomainRoutingRule = new alicloud.cr.StorageDomainRoutingRule("default", {
        routes: [{
            instanceDomain: pulumi.interpolate`${_default.instanceName}-registry-vpc.cn-hangzhou.cr.aliyuncs.com`,
            storageDomain: pulumi.interpolate`https://${_default.id}-registry.oss-cn-hangzhou-internal.aliyuncs.com`,
            endpointType: "Internet",
        }],
        instanceId: _default.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.cr.RegistryEnterpriseInstance("default",
        payment_type="Subscription",
        period=1,
        renew_period=1,
        renewal_status="AutoRenewal",
        instance_type="Advanced",
        instance_name=name)
    default_storage_domain_routing_rule = alicloud.cr.StorageDomainRoutingRule("default",
        routes=[{
            "instance_domain": default.instance_name.apply(lambda instance_name: f"{instance_name}-registry-vpc.cn-hangzhou.cr.aliyuncs.com"),
            "storage_domain": default.id.apply(lambda id: f"https://{id}-registry.oss-cn-hangzhou-internal.aliyuncs.com"),
            "endpoint_type": "Internet",
        }],
        instance_id=default.id)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := cr.NewRegistryEnterpriseInstance(ctx, "default", &cr.RegistryEnterpriseInstanceArgs{
    			PaymentType:   pulumi.String("Subscription"),
    			Period:        pulumi.Int(1),
    			RenewPeriod:   pulumi.Int(1),
    			RenewalStatus: pulumi.String("AutoRenewal"),
    			InstanceType:  pulumi.String("Advanced"),
    			InstanceName:  pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cr.NewStorageDomainRoutingRule(ctx, "default", &cr.StorageDomainRoutingRuleArgs{
    			Routes: cr.StorageDomainRoutingRuleRouteArray{
    				&cr.StorageDomainRoutingRuleRouteArgs{
    					InstanceDomain: _default.InstanceName.ApplyT(func(instanceName string) (string, error) {
    						return fmt.Sprintf("%v-registry-vpc.cn-hangzhou.cr.aliyuncs.com", instanceName), nil
    					}).(pulumi.StringOutput),
    					StorageDomain: _default.ID().ApplyT(func(id string) (string, error) {
    						return fmt.Sprintf("https://%v-registry.oss-cn-hangzhou-internal.aliyuncs.com", id), nil
    					}).(pulumi.StringOutput),
    					EndpointType: pulumi.String("Internet"),
    				},
    			},
    			InstanceId: _default.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.CR.RegistryEnterpriseInstance("default", new()
        {
            PaymentType = "Subscription",
            Period = 1,
            RenewPeriod = 1,
            RenewalStatus = "AutoRenewal",
            InstanceType = "Advanced",
            InstanceName = name,
        });
    
        var defaultStorageDomainRoutingRule = new AliCloud.CR.StorageDomainRoutingRule("default", new()
        {
            Routes = new[]
            {
                new AliCloud.CR.Inputs.StorageDomainRoutingRuleRouteArgs
                {
                    InstanceDomain = @default.InstanceName.Apply(instanceName => $"{instanceName}-registry-vpc.cn-hangzhou.cr.aliyuncs.com"),
                    StorageDomain = @default.Id.Apply(id => $"https://{id}-registry.oss-cn-hangzhou-internal.aliyuncs.com"),
                    EndpointType = "Internet",
                },
            },
            InstanceId = @default.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstance;
    import com.pulumi.alicloud.cr.RegistryEnterpriseInstanceArgs;
    import com.pulumi.alicloud.cr.StorageDomainRoutingRule;
    import com.pulumi.alicloud.cr.StorageDomainRoutingRuleArgs;
    import com.pulumi.alicloud.cr.inputs.StorageDomainRoutingRuleRouteArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new RegistryEnterpriseInstance("default", RegistryEnterpriseInstanceArgs.builder()
                .paymentType("Subscription")
                .period(1)
                .renewPeriod(1)
                .renewalStatus("AutoRenewal")
                .instanceType("Advanced")
                .instanceName(name)
                .build());
    
            var defaultStorageDomainRoutingRule = new StorageDomainRoutingRule("defaultStorageDomainRoutingRule", StorageDomainRoutingRuleArgs.builder()
                .routes(StorageDomainRoutingRuleRouteArgs.builder()
                    .instanceDomain(default_.instanceName().applyValue(_instanceName -> String.format("%s-registry-vpc.cn-hangzhou.cr.aliyuncs.com", _instanceName)))
                    .storageDomain(default_.id().applyValue(_id -> String.format("https://%s-registry.oss-cn-hangzhou-internal.aliyuncs.com", _id)))
                    .endpointType("Internet")
                    .build())
                .instanceId(default_.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:cr:RegistryEnterpriseInstance
        properties:
          paymentType: Subscription
          period: 1
          renewPeriod: 1
          renewalStatus: AutoRenewal
          instanceType: Advanced
          instanceName: ${name}
      defaultStorageDomainRoutingRule:
        type: alicloud:cr:StorageDomainRoutingRule
        name: default
        properties:
          routes:
            - instanceDomain: ${default.instanceName}-registry-vpc.cn-hangzhou.cr.aliyuncs.com
              storageDomain: https://${default.id}-registry.oss-cn-hangzhou-internal.aliyuncs.com
              endpointType: Internet
          instanceId: ${default.id}
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create StorageDomainRoutingRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new StorageDomainRoutingRule(name: string, args: StorageDomainRoutingRuleArgs, opts?: CustomResourceOptions);
    @overload
    def StorageDomainRoutingRule(resource_name: str,
                                 args: StorageDomainRoutingRuleArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def StorageDomainRoutingRule(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 instance_id: Optional[str] = None,
                                 routes: Optional[Sequence[StorageDomainRoutingRuleRouteArgs]] = None)
    func NewStorageDomainRoutingRule(ctx *Context, name string, args StorageDomainRoutingRuleArgs, opts ...ResourceOption) (*StorageDomainRoutingRule, error)
    public StorageDomainRoutingRule(string name, StorageDomainRoutingRuleArgs args, CustomResourceOptions? opts = null)
    public StorageDomainRoutingRule(String name, StorageDomainRoutingRuleArgs args)
    public StorageDomainRoutingRule(String name, StorageDomainRoutingRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:cr:StorageDomainRoutingRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args StorageDomainRoutingRuleArgs
    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 StorageDomainRoutingRuleArgs
    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 StorageDomainRoutingRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StorageDomainRoutingRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args StorageDomainRoutingRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var storageDomainRoutingRuleResource = new AliCloud.CR.StorageDomainRoutingRule("storageDomainRoutingRuleResource", new()
    {
        InstanceId = "string",
        Routes = new[]
        {
            new AliCloud.CR.Inputs.StorageDomainRoutingRuleRouteArgs
            {
                EndpointType = "string",
                InstanceDomain = "string",
                StorageDomain = "string",
            },
        },
    });
    
    example, err := cr.NewStorageDomainRoutingRule(ctx, "storageDomainRoutingRuleResource", &cr.StorageDomainRoutingRuleArgs{
    	InstanceId: pulumi.String("string"),
    	Routes: cr.StorageDomainRoutingRuleRouteArray{
    		&cr.StorageDomainRoutingRuleRouteArgs{
    			EndpointType:   pulumi.String("string"),
    			InstanceDomain: pulumi.String("string"),
    			StorageDomain:  pulumi.String("string"),
    		},
    	},
    })
    
    var storageDomainRoutingRuleResource = new StorageDomainRoutingRule("storageDomainRoutingRuleResource", StorageDomainRoutingRuleArgs.builder()
        .instanceId("string")
        .routes(StorageDomainRoutingRuleRouteArgs.builder()
            .endpointType("string")
            .instanceDomain("string")
            .storageDomain("string")
            .build())
        .build());
    
    storage_domain_routing_rule_resource = alicloud.cr.StorageDomainRoutingRule("storageDomainRoutingRuleResource",
        instance_id="string",
        routes=[{
            "endpoint_type": "string",
            "instance_domain": "string",
            "storage_domain": "string",
        }])
    
    const storageDomainRoutingRuleResource = new alicloud.cr.StorageDomainRoutingRule("storageDomainRoutingRuleResource", {
        instanceId: "string",
        routes: [{
            endpointType: "string",
            instanceDomain: "string",
            storageDomain: "string",
        }],
    });
    
    type: alicloud:cr:StorageDomainRoutingRule
    properties:
        instanceId: string
        routes:
            - endpointType: string
              instanceDomain: string
              storageDomain: string
    

    StorageDomainRoutingRule Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The StorageDomainRoutingRule resource accepts the following input properties:

    InstanceId string
    The ID of the Container Registry Instance.
    Routes List<Pulumi.AliCloud.CR.Inputs.StorageDomainRoutingRuleRoute>
    Domain name routing entry See routes below.
    InstanceId string
    The ID of the Container Registry Instance.
    Routes []StorageDomainRoutingRuleRouteArgs
    Domain name routing entry See routes below.
    instanceId String
    The ID of the Container Registry Instance.
    routes List<StorageDomainRoutingRuleRoute>
    Domain name routing entry See routes below.
    instanceId string
    The ID of the Container Registry Instance.
    routes StorageDomainRoutingRuleRoute[]
    Domain name routing entry See routes below.
    instance_id str
    The ID of the Container Registry Instance.
    routes Sequence[StorageDomainRoutingRuleRouteArgs]
    Domain name routing entry See routes below.
    instanceId String
    The ID of the Container Registry Instance.
    routes List<Property Map>
    Domain name routing entry See routes below.

    Outputs

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

    CreateTime int
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    The ID of the Rule.
    CreateTime int
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    The ID of the Rule.
    createTime Integer
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    The ID of the Rule.
    createTime number
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    ruleId string
    The ID of the Rule.
    create_time int
    The creation time of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    rule_id str
    The ID of the Rule.
    createTime Number
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    The ID of the Rule.

    Look up Existing StorageDomainRoutingRule Resource

    Get an existing StorageDomainRoutingRule 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?: StorageDomainRoutingRuleState, opts?: CustomResourceOptions): StorageDomainRoutingRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[int] = None,
            instance_id: Optional[str] = None,
            routes: Optional[Sequence[StorageDomainRoutingRuleRouteArgs]] = None,
            rule_id: Optional[str] = None) -> StorageDomainRoutingRule
    func GetStorageDomainRoutingRule(ctx *Context, name string, id IDInput, state *StorageDomainRoutingRuleState, opts ...ResourceOption) (*StorageDomainRoutingRule, error)
    public static StorageDomainRoutingRule Get(string name, Input<string> id, StorageDomainRoutingRuleState? state, CustomResourceOptions? opts = null)
    public static StorageDomainRoutingRule get(String name, Output<String> id, StorageDomainRoutingRuleState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:cr:StorageDomainRoutingRule    get:      id: ${id}
    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.
    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:
    CreateTime int
    The creation time of the resource.
    InstanceId string
    The ID of the Container Registry Instance.
    Routes List<Pulumi.AliCloud.CR.Inputs.StorageDomainRoutingRuleRoute>
    Domain name routing entry See routes below.
    RuleId string
    The ID of the Rule.
    CreateTime int
    The creation time of the resource.
    InstanceId string
    The ID of the Container Registry Instance.
    Routes []StorageDomainRoutingRuleRouteArgs
    Domain name routing entry See routes below.
    RuleId string
    The ID of the Rule.
    createTime Integer
    The creation time of the resource.
    instanceId String
    The ID of the Container Registry Instance.
    routes List<StorageDomainRoutingRuleRoute>
    Domain name routing entry See routes below.
    ruleId String
    The ID of the Rule.
    createTime number
    The creation time of the resource.
    instanceId string
    The ID of the Container Registry Instance.
    routes StorageDomainRoutingRuleRoute[]
    Domain name routing entry See routes below.
    ruleId string
    The ID of the Rule.
    create_time int
    The creation time of the resource.
    instance_id str
    The ID of the Container Registry Instance.
    routes Sequence[StorageDomainRoutingRuleRouteArgs]
    Domain name routing entry See routes below.
    rule_id str
    The ID of the Rule.
    createTime Number
    The creation time of the resource.
    instanceId String
    The ID of the Container Registry Instance.
    routes List<Property Map>
    Domain name routing entry See routes below.
    ruleId String
    The ID of the Rule.

    Supporting Types

    StorageDomainRoutingRuleRoute, StorageDomainRoutingRuleRouteArgs

    EndpointType string
    Endpoint Type.
    InstanceDomain string
    Instance domain name.
    StorageDomain string
    Storage domain name.
    EndpointType string
    Endpoint Type.
    InstanceDomain string
    Instance domain name.
    StorageDomain string
    Storage domain name.
    endpointType String
    Endpoint Type.
    instanceDomain String
    Instance domain name.
    storageDomain String
    Storage domain name.
    endpointType string
    Endpoint Type.
    instanceDomain string
    Instance domain name.
    storageDomain string
    Storage domain name.
    endpoint_type str
    Endpoint Type.
    instance_domain str
    Instance domain name.
    storage_domain str
    Storage domain name.
    endpointType String
    Endpoint Type.
    instanceDomain String
    Instance domain name.
    storageDomain String
    Storage domain name.

    Import

    CR Storage Domain Routing Rule can be imported using the id, e.g.

    $ pulumi import alicloud:cr/storageDomainRoutingRule:StorageDomainRoutingRule example <instance_id>:<rule_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate