1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. RouteService
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.cen.RouteService

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a CEN Route Service resource. The virtual border routers (VBRs) and Cloud Connect Network (CCN) instances attached to Cloud Enterprise Network (CEN) instances can access the cloud services deployed in VPCs through the CEN instances.

    For information about CEN Route Service and how to use it, see What is Route Service.

    NOTE: Available since v1.99.0.

    NOTE: Ensure that at least one VPC in the selected region is attached to the CEN instance.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.getRegions({
        current: true,
    });
    const exampleNetwork = new alicloud.vpc.Network("exampleNetwork", {
        vpcName: "tf_example",
        cidrBlock: "172.17.3.0/24",
    });
    const exampleInstance = new alicloud.cen.Instance("exampleInstance", {
        cenInstanceName: "tf_example",
        description: "an example for cen",
    });
    const exampleInstanceAttachment = new alicloud.cen.InstanceAttachment("exampleInstanceAttachment", {
        instanceId: exampleInstance.id,
        childInstanceId: exampleNetwork.id,
        childInstanceType: "VPC",
        childInstanceRegionId: _default.then(_default => _default.regions?.[0]?.id),
    });
    const exampleRouteService = new alicloud.cen.RouteService("exampleRouteService", {
        accessRegionId: _default.then(_default => _default.regions?.[0]?.id),
        hostRegionId: _default.then(_default => _default.regions?.[0]?.id),
        hostVpcId: exampleNetwork.id,
        cenId: exampleInstanceAttachment.instanceId,
        host: "100.118.28.52/32",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.get_regions(current=True)
    example_network = alicloud.vpc.Network("exampleNetwork",
        vpc_name="tf_example",
        cidr_block="172.17.3.0/24")
    example_instance = alicloud.cen.Instance("exampleInstance",
        cen_instance_name="tf_example",
        description="an example for cen")
    example_instance_attachment = alicloud.cen.InstanceAttachment("exampleInstanceAttachment",
        instance_id=example_instance.id,
        child_instance_id=example_network.id,
        child_instance_type="VPC",
        child_instance_region_id=default.regions[0].id)
    example_route_service = alicloud.cen.RouteService("exampleRouteService",
        access_region_id=default.regions[0].id,
        host_region_id=default.regions[0].id,
        host_vpc_id=example_network.id,
        cen_id=example_instance_attachment.instance_id,
        host="100.118.28.52/32")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleNetwork, err := vpc.NewNetwork(ctx, "exampleNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String("tf_example"),
    			CidrBlock: pulumi.String("172.17.3.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleInstance, err := cen.NewInstance(ctx, "exampleInstance", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String("tf_example"),
    			Description:     pulumi.String("an example for cen"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleInstanceAttachment, err := cen.NewInstanceAttachment(ctx, "exampleInstanceAttachment", &cen.InstanceAttachmentArgs{
    			InstanceId:            exampleInstance.ID(),
    			ChildInstanceId:       exampleNetwork.ID(),
    			ChildInstanceType:     pulumi.String("VPC"),
    			ChildInstanceRegionId: pulumi.String(_default.Regions[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewRouteService(ctx, "exampleRouteService", &cen.RouteServiceArgs{
    			AccessRegionId: pulumi.String(_default.Regions[0].Id),
    			HostRegionId:   pulumi.String(_default.Regions[0].Id),
    			HostVpcId:      exampleNetwork.ID(),
    			CenId:          exampleInstanceAttachment.InstanceId,
    			Host:           pulumi.String("100.118.28.52/32"),
    		})
    		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 @default = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
        {
            VpcName = "tf_example",
            CidrBlock = "172.17.3.0/24",
        });
    
        var exampleInstance = new AliCloud.Cen.Instance("exampleInstance", new()
        {
            CenInstanceName = "tf_example",
            Description = "an example for cen",
        });
    
        var exampleInstanceAttachment = new AliCloud.Cen.InstanceAttachment("exampleInstanceAttachment", new()
        {
            InstanceId = exampleInstance.Id,
            ChildInstanceId = exampleNetwork.Id,
            ChildInstanceType = "VPC",
            ChildInstanceRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
        });
    
        var exampleRouteService = new AliCloud.Cen.RouteService("exampleRouteService", new()
        {
            AccessRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
            HostRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
            HostVpcId = exampleNetwork.Id,
            CenId = exampleInstanceAttachment.InstanceId,
            Host = "100.118.28.52/32",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.cen.Instance;
    import com.pulumi.alicloud.cen.InstanceArgs;
    import com.pulumi.alicloud.cen.InstanceAttachment;
    import com.pulumi.alicloud.cen.InstanceAttachmentArgs;
    import com.pulumi.alicloud.cen.RouteService;
    import com.pulumi.alicloud.cen.RouteServiceArgs;
    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 default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()        
                .vpcName("tf_example")
                .cidrBlock("172.17.3.0/24")
                .build());
    
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()        
                .cenInstanceName("tf_example")
                .description("an example for cen")
                .build());
    
            var exampleInstanceAttachment = new InstanceAttachment("exampleInstanceAttachment", InstanceAttachmentArgs.builder()        
                .instanceId(exampleInstance.id())
                .childInstanceId(exampleNetwork.id())
                .childInstanceType("VPC")
                .childInstanceRegionId(default_.regions()[0].id())
                .build());
    
            var exampleRouteService = new RouteService("exampleRouteService", RouteServiceArgs.builder()        
                .accessRegionId(default_.regions()[0].id())
                .hostRegionId(default_.regions()[0].id())
                .hostVpcId(exampleNetwork.id())
                .cenId(exampleInstanceAttachment.instanceId())
                .host("100.118.28.52/32")
                .build());
    
        }
    }
    
    resources:
      exampleNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: tf_example
          cidrBlock: 172.17.3.0/24
      exampleInstance:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: tf_example
          description: an example for cen
      exampleInstanceAttachment:
        type: alicloud:cen:InstanceAttachment
        properties:
          instanceId: ${exampleInstance.id}
          childInstanceId: ${exampleNetwork.id}
          childInstanceType: VPC
          childInstanceRegionId: ${default.regions[0].id}
      exampleRouteService:
        type: alicloud:cen:RouteService
        properties:
          accessRegionId: ${default.regions[0].id}
          hostRegionId: ${default.regions[0].id}
          hostVpcId: ${exampleNetwork.id}
          cenId: ${exampleInstanceAttachment.instanceId}
          host: 100.118.28.52/32
    variables:
      default:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    Create RouteService Resource

    new RouteService(name: string, args: RouteServiceArgs, opts?: CustomResourceOptions);
    @overload
    def RouteService(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     access_region_id: Optional[str] = None,
                     cen_id: Optional[str] = None,
                     description: Optional[str] = None,
                     host: Optional[str] = None,
                     host_region_id: Optional[str] = None,
                     host_vpc_id: Optional[str] = None)
    @overload
    def RouteService(resource_name: str,
                     args: RouteServiceArgs,
                     opts: Optional[ResourceOptions] = None)
    func NewRouteService(ctx *Context, name string, args RouteServiceArgs, opts ...ResourceOption) (*RouteService, error)
    public RouteService(string name, RouteServiceArgs args, CustomResourceOptions? opts = null)
    public RouteService(String name, RouteServiceArgs args)
    public RouteService(String name, RouteServiceArgs args, CustomResourceOptions options)
    
    type: alicloud:cen:RouteService
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RouteServiceArgs
    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 RouteServiceArgs
    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 RouteServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouteServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouteServiceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RouteService 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 RouteService resource accepts the following input properties:

    AccessRegionId string
    The region of the network instances that access the cloud services.
    CenId string
    The ID of the CEN instance.
    Host string
    The domain name or IP address of the cloud service.
    HostRegionId string
    The region of the cloud service.
    HostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    Description string
    The description of the cloud service.
    AccessRegionId string
    The region of the network instances that access the cloud services.
    CenId string
    The ID of the CEN instance.
    Host string
    The domain name or IP address of the cloud service.
    HostRegionId string
    The region of the cloud service.
    HostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    Description string
    The description of the cloud service.
    accessRegionId String
    The region of the network instances that access the cloud services.
    cenId String
    The ID of the CEN instance.
    host String
    The domain name or IP address of the cloud service.
    hostRegionId String
    The region of the cloud service.
    hostVpcId String

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    description String
    The description of the cloud service.
    accessRegionId string
    The region of the network instances that access the cloud services.
    cenId string
    The ID of the CEN instance.
    host string
    The domain name or IP address of the cloud service.
    hostRegionId string
    The region of the cloud service.
    hostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    description string
    The description of the cloud service.
    access_region_id str
    The region of the network instances that access the cloud services.
    cen_id str
    The ID of the CEN instance.
    host str
    The domain name or IP address of the cloud service.
    host_region_id str
    The region of the cloud service.
    host_vpc_id str

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    description str
    The description of the cloud service.
    accessRegionId String
    The region of the network instances that access the cloud services.
    cenId String
    The ID of the CEN instance.
    host String
    The domain name or IP address of the cloud service.
    hostRegionId String
    The region of the cloud service.
    hostVpcId String

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    description String
    The description of the cloud service.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the cloud service.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the cloud service.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the cloud service.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the cloud service.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the cloud service.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the cloud service.

    Look up Existing RouteService Resource

    Get an existing RouteService 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?: RouteServiceState, opts?: CustomResourceOptions): RouteService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_region_id: Optional[str] = None,
            cen_id: Optional[str] = None,
            description: Optional[str] = None,
            host: Optional[str] = None,
            host_region_id: Optional[str] = None,
            host_vpc_id: Optional[str] = None,
            status: Optional[str] = None) -> RouteService
    func GetRouteService(ctx *Context, name string, id IDInput, state *RouteServiceState, opts ...ResourceOption) (*RouteService, error)
    public static RouteService Get(string name, Input<string> id, RouteServiceState? state, CustomResourceOptions? opts = null)
    public static RouteService get(String name, Output<String> id, RouteServiceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AccessRegionId string
    The region of the network instances that access the cloud services.
    CenId string
    The ID of the CEN instance.
    Description string
    The description of the cloud service.
    Host string
    The domain name or IP address of the cloud service.
    HostRegionId string
    The region of the cloud service.
    HostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    Status string
    The status of the cloud service.
    AccessRegionId string
    The region of the network instances that access the cloud services.
    CenId string
    The ID of the CEN instance.
    Description string
    The description of the cloud service.
    Host string
    The domain name or IP address of the cloud service.
    HostRegionId string
    The region of the cloud service.
    HostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    Status string
    The status of the cloud service.
    accessRegionId String
    The region of the network instances that access the cloud services.
    cenId String
    The ID of the CEN instance.
    description String
    The description of the cloud service.
    host String
    The domain name or IP address of the cloud service.
    hostRegionId String
    The region of the cloud service.
    hostVpcId String

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    status String
    The status of the cloud service.
    accessRegionId string
    The region of the network instances that access the cloud services.
    cenId string
    The ID of the CEN instance.
    description string
    The description of the cloud service.
    host string
    The domain name or IP address of the cloud service.
    hostRegionId string
    The region of the cloud service.
    hostVpcId string

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    status string
    The status of the cloud service.
    access_region_id str
    The region of the network instances that access the cloud services.
    cen_id str
    The ID of the CEN instance.
    description str
    The description of the cloud service.
    host str
    The domain name or IP address of the cloud service.
    host_region_id str
    The region of the cloud service.
    host_vpc_id str

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    status str
    The status of the cloud service.
    accessRegionId String
    The region of the network instances that access the cloud services.
    cenId String
    The ID of the CEN instance.
    description String
    The description of the cloud service.
    host String
    The domain name or IP address of the cloud service.
    hostRegionId String
    The region of the cloud service.
    hostVpcId String

    The VPC associated with the cloud service.

    NOTE: The values of host_region_id and access_region_id must be consistent.

    status String
    The status of the cloud service.

    Import

    CEN Route Service can be imported using the id, e.g.

    $ pulumi import alicloud:cen/routeService:RouteService example cen-ahixm0efqh********:cn-shanghai:100.118.28.52/32:cn-shanghai
    

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi