alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cen.RouteService

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 in v1.99.0+.

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

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "tf-test";
    var exampleNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    {
        IsDefault = true,
    });

    var exampleInstance = new AliCloud.Cen.Instance("exampleInstance");

    var vpc = new AliCloud.Cen.InstanceAttachment("vpc", new()
    {
        InstanceId = exampleInstance.Id,
        ChildInstanceId = exampleNetworks.Apply(getNetworksResult => getNetworksResult.Vpcs[0]?.Id),
        ChildInstanceType = "VPC",
        ChildInstanceRegionId = exampleNetworks.Apply(getNetworksResult => getNetworksResult.Vpcs[0]?.RegionId),
    });

    var @this = new AliCloud.Cen.RouteService("this", new()
    {
        AccessRegionId = exampleNetworks.Apply(getNetworksResult => getNetworksResult.Vpcs[0]?.RegionId),
        HostRegionId = exampleNetworks.Apply(getNetworksResult => getNetworksResult.Vpcs[0]?.RegionId),
        HostVpcId = exampleNetworks.Apply(getNetworksResult => getNetworksResult.Vpcs[0]?.Id),
        CenId = vpc.InstanceId,
        Host = "100.118.28.52/32",
    });

});
package main

import (
	"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"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf-test"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		exampleNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			IsDefault: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		exampleInstance, err := cen.NewInstance(ctx, "exampleInstance", nil)
		if err != nil {
			return err
		}
		vpc, err := cen.NewInstanceAttachment(ctx, "vpc", &cen.InstanceAttachmentArgs{
			InstanceId:            exampleInstance.ID(),
			ChildInstanceId:       *pulumi.String(exampleNetworks.Vpcs[0].Id),
			ChildInstanceType:     pulumi.String("VPC"),
			ChildInstanceRegionId: *pulumi.String(exampleNetworks.Vpcs[0].RegionId),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewRouteService(ctx, "this", &cen.RouteServiceArgs{
			AccessRegionId: *pulumi.String(exampleNetworks.Vpcs[0].RegionId),
			HostRegionId:   *pulumi.String(exampleNetworks.Vpcs[0].RegionId),
			HostVpcId:      *pulumi.String(exampleNetworks.Vpcs[0].Id),
			CenId:          vpc.InstanceId,
			Host:           pulumi.String("100.118.28.52/32"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.cen.Instance;
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 config = ctx.config();
        final var name = config.get("name").orElse("tf-test");
        final var exampleNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .isDefault(true)
            .build());

        var exampleInstance = new Instance("exampleInstance");

        var vpc = new InstanceAttachment("vpc", InstanceAttachmentArgs.builder()        
            .instanceId(exampleInstance.id())
            .childInstanceId(exampleNetworks.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].id()))
            .childInstanceType("VPC")
            .childInstanceRegionId(exampleNetworks.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].regionId()))
            .build());

        var this_ = new RouteService("this", RouteServiceArgs.builder()        
            .accessRegionId(exampleNetworks.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].regionId()))
            .hostRegionId(exampleNetworks.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].regionId()))
            .hostVpcId(exampleNetworks.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].id()))
            .cenId(vpc.instanceId())
            .host("100.118.28.52/32")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-test"
example_networks = alicloud.vpc.get_networks(is_default=True)
example_instance = alicloud.cen.Instance("exampleInstance")
vpc = alicloud.cen.InstanceAttachment("vpc",
    instance_id=example_instance.id,
    child_instance_id=example_networks.vpcs[0].id,
    child_instance_type="VPC",
    child_instance_region_id=example_networks.vpcs[0].region_id)
this = alicloud.cen.RouteService("this",
    access_region_id=example_networks.vpcs[0].region_id,
    host_region_id=example_networks.vpcs[0].region_id,
    host_vpc_id=example_networks.vpcs[0].id,
    cen_id=vpc.instance_id,
    host="100.118.28.52/32")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-test";
const exampleNetworks = alicloud.vpc.getNetworks({
    isDefault: true,
});
const exampleInstance = new alicloud.cen.Instance("exampleInstance", {});
const vpc = new alicloud.cen.InstanceAttachment("vpc", {
    instanceId: exampleInstance.id,
    childInstanceId: exampleNetworks.then(exampleNetworks => exampleNetworks.vpcs?.[0]?.id),
    childInstanceType: "VPC",
    childInstanceRegionId: exampleNetworks.then(exampleNetworks => exampleNetworks.vpcs?.[0]?.regionId),
});
const _this = new alicloud.cen.RouteService("this", {
    accessRegionId: exampleNetworks.then(exampleNetworks => exampleNetworks.vpcs?.[0]?.regionId),
    hostRegionId: exampleNetworks.then(exampleNetworks => exampleNetworks.vpcs?.[0]?.regionId),
    hostVpcId: exampleNetworks.then(exampleNetworks => exampleNetworks.vpcs?.[0]?.id),
    cenId: vpc.instanceId,
    host: "100.118.28.52/32",
});
configuration:
  name:
    type: string
    default: tf-test
resources:
  exampleInstance:
    type: alicloud:cen:Instance
  vpc:
    type: alicloud:cen:InstanceAttachment
    properties:
      instanceId: ${exampleInstance.id}
      childInstanceId: ${exampleNetworks.vpcs[0].id}
      childInstanceType: VPC
      childInstanceRegionId: ${exampleNetworks.vpcs[0].regionId}
  this:
    type: alicloud:cen:RouteService
    properties:
      accessRegionId: ${exampleNetworks.vpcs[0].regionId}
      hostRegionId: ${exampleNetworks.vpcs[0].regionId}
      hostVpcId: ${exampleNetworks.vpcs[0].id}
      cenId: ${vpc.instanceId}
      host: 100.118.28.52/32
variables:
  exampleNetworks:
    fn::invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        isDefault: 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.