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:
- Instance
Id string - The ID of the Container Registry Instance.
- Routes
List<Pulumi.
Ali Cloud. CR. Inputs. Storage Domain Routing Rule Route> - Domain name routing entry See
routesbelow.
- Instance
Id string - The ID of the Container Registry Instance.
- Routes
[]Storage
Domain Routing Rule Route Args - Domain name routing entry See
routesbelow.
- instance
Id String - The ID of the Container Registry Instance.
- routes
List<Storage
Domain Routing Rule Route> - Domain name routing entry See
routesbelow.
- instance
Id string - The ID of the Container Registry Instance.
- routes
Storage
Domain Routing Rule Route[] - Domain name routing entry See
routesbelow.
- instance_
id str - The ID of the Container Registry Instance.
- routes
Sequence[Storage
Domain Routing Rule Route Args] - Domain name routing entry See
routesbelow.
- instance
Id String - The ID of the Container Registry Instance.
- routes List<Property Map>
- Domain name routing entry See
routesbelow.
Outputs
All input properties are implicitly available as output properties. Additionally, the StorageDomainRoutingRule resource produces the following output properties:
- Create
Time int - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Id string - The ID of the Rule.
- Create
Time int - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Id string - The ID of the Rule.
- create
Time Integer - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Id String - The ID of the Rule.
- create
Time number - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- rule
Id 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.
- create
Time Number - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Id 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) -> StorageDomainRoutingRulefunc 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.
- Create
Time int - The creation time of the resource.
- Instance
Id string - The ID of the Container Registry Instance.
- Routes
List<Pulumi.
Ali Cloud. CR. Inputs. Storage Domain Routing Rule Route> - Domain name routing entry See
routesbelow. - Rule
Id string - The ID of the Rule.
- Create
Time int - The creation time of the resource.
- Instance
Id string - The ID of the Container Registry Instance.
- Routes
[]Storage
Domain Routing Rule Route Args - Domain name routing entry See
routesbelow. - Rule
Id string - The ID of the Rule.
- create
Time Integer - The creation time of the resource.
- instance
Id String - The ID of the Container Registry Instance.
- routes
List<Storage
Domain Routing Rule Route> - Domain name routing entry See
routesbelow. - rule
Id String - The ID of the Rule.
- create
Time number - The creation time of the resource.
- instance
Id string - The ID of the Container Registry Instance.
- routes
Storage
Domain Routing Rule Route[] - Domain name routing entry See
routesbelow. - rule
Id 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[Storage
Domain Routing Rule Route Args] - Domain name routing entry See
routesbelow. - rule_
id str - The ID of the Rule.
- create
Time Number - The creation time of the resource.
- instance
Id String - The ID of the Container Registry Instance.
- routes List<Property Map>
- Domain name routing entry See
routesbelow. - rule
Id String - The ID of the Rule.
Supporting Types
StorageDomainRoutingRuleRoute, StorageDomainRoutingRuleRouteArgs
- Endpoint
Type string - Endpoint Type.
- Instance
Domain string - Instance domain name.
- Storage
Domain string - Storage domain name.
- Endpoint
Type string - Endpoint Type.
- Instance
Domain string - Instance domain name.
- Storage
Domain string - Storage domain name.
- endpoint
Type String - Endpoint Type.
- instance
Domain String - Instance domain name.
- storage
Domain String - Storage domain name.
- endpoint
Type string - Endpoint Type.
- instance
Domain string - Instance domain name.
- storage
Domain string - Storage domain name.
- endpoint_
type str - Endpoint Type.
- instance_
domain str - Instance domain name.
- storage_
domain str - Storage domain name.
- endpoint
Type String - Endpoint Type.
- instance
Domain String - Instance domain name.
- storage
Domain 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
alicloudTerraform Provider.
