alicloud.cen.RouteService
Explore with Pulumi AI
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 example = new alicloud.vpc.Network("example", {
vpcName: "tf_example",
cidrBlock: "172.17.3.0/24",
});
const exampleInstance = new alicloud.cen.Instance("example", {
cenInstanceName: "tf_example",
description: "an example for cen",
});
const exampleInstanceAttachment = new alicloud.cen.InstanceAttachment("example", {
instanceId: exampleInstance.id,
childInstanceId: example.id,
childInstanceType: "VPC",
childInstanceRegionId: _default.then(_default => _default.regions?.[0]?.id),
});
const exampleRouteService = new alicloud.cen.RouteService("example", {
accessRegionId: _default.then(_default => _default.regions?.[0]?.id),
hostRegionId: _default.then(_default => _default.regions?.[0]?.id),
hostVpcId: example.id,
cenId: exampleInstanceAttachment.instanceId,
host: "100.118.28.52/32",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.get_regions(current=True)
example = alicloud.vpc.Network("example",
vpc_name="tf_example",
cidr_block="172.17.3.0/24")
example_instance = alicloud.cen.Instance("example",
cen_instance_name="tf_example",
description="an example for cen")
example_instance_attachment = alicloud.cen.InstanceAttachment("example",
instance_id=example_instance.id,
child_instance_id=example.id,
child_instance_type="VPC",
child_instance_region_id=default.regions[0].id)
example_route_service = alicloud.cen.RouteService("example",
access_region_id=default.regions[0].id,
host_region_id=default.regions[0].id,
host_vpc_id=example.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
}
example, err := vpc.NewNetwork(ctx, "example", &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, "example", &cen.InstanceArgs{
CenInstanceName: pulumi.String("tf_example"),
Description: pulumi.String("an example for cen"),
})
if err != nil {
return err
}
exampleInstanceAttachment, err := cen.NewInstanceAttachment(ctx, "example", &cen.InstanceAttachmentArgs{
InstanceId: exampleInstance.ID(),
ChildInstanceId: example.ID(),
ChildInstanceType: pulumi.String("VPC"),
ChildInstanceRegionId: pulumi.String(_default.Regions[0].Id),
})
if err != nil {
return err
}
_, err = cen.NewRouteService(ctx, "example", &cen.RouteServiceArgs{
AccessRegionId: pulumi.String(_default.Regions[0].Id),
HostRegionId: pulumi.String(_default.Regions[0].Id),
HostVpcId: example.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 example = new AliCloud.Vpc.Network("example", new()
{
VpcName = "tf_example",
CidrBlock = "172.17.3.0/24",
});
var exampleInstance = new AliCloud.Cen.Instance("example", new()
{
CenInstanceName = "tf_example",
Description = "an example for cen",
});
var exampleInstanceAttachment = new AliCloud.Cen.InstanceAttachment("example", new()
{
InstanceId = exampleInstance.Id,
ChildInstanceId = example.Id,
ChildInstanceType = "VPC",
ChildInstanceRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
});
var exampleRouteService = new AliCloud.Cen.RouteService("example", new()
{
AccessRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
HostRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
HostVpcId = example.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 example = new Network("example", 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(example.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(example.id())
.cenId(exampleInstanceAttachment.instanceId())
.host("100.118.28.52/32")
.build());
}
}
resources:
example:
type: alicloud:vpc:Network
properties:
vpcName: tf_example
cidrBlock: 172.17.3.0/24
exampleInstance:
type: alicloud:cen:Instance
name: example
properties:
cenInstanceName: tf_example
description: an example for cen
exampleInstanceAttachment:
type: alicloud:cen:InstanceAttachment
name: example
properties:
instanceId: ${exampleInstance.id}
childInstanceId: ${example.id}
childInstanceType: VPC
childInstanceRegionId: ${default.regions[0].id}
exampleRouteService:
type: alicloud:cen:RouteService
name: example
properties:
accessRegionId: ${default.regions[0].id}
hostRegionId: ${default.regions[0].id}
hostVpcId: ${example.id}
cenId: ${exampleInstanceAttachment.instanceId}
host: 100.118.28.52/32
variables:
default:
fn::invoke:
Function: alicloud:getRegions
Arguments:
current: true
Create RouteService Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RouteService(name: string, args: RouteServiceArgs, opts?: CustomResourceOptions);
@overload
def RouteService(resource_name: str,
args: RouteServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RouteService(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_region_id: Optional[str] = None,
cen_id: Optional[str] = None,
host: Optional[str] = None,
host_region_id: Optional[str] = None,
host_vpc_id: Optional[str] = None,
description: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var routeServiceResource = new AliCloud.Cen.RouteService("routeServiceResource", new()
{
AccessRegionId = "string",
CenId = "string",
Host = "string",
HostRegionId = "string",
HostVpcId = "string",
Description = "string",
});
example, err := cen.NewRouteService(ctx, "routeServiceResource", &cen.RouteServiceArgs{
AccessRegionId: pulumi.String("string"),
CenId: pulumi.String("string"),
Host: pulumi.String("string"),
HostRegionId: pulumi.String("string"),
HostVpcId: pulumi.String("string"),
Description: pulumi.String("string"),
})
var routeServiceResource = new RouteService("routeServiceResource", RouteServiceArgs.builder()
.accessRegionId("string")
.cenId("string")
.host("string")
.hostRegionId("string")
.hostVpcId("string")
.description("string")
.build());
route_service_resource = alicloud.cen.RouteService("routeServiceResource",
access_region_id="string",
cen_id="string",
host="string",
host_region_id="string",
host_vpc_id="string",
description="string")
const routeServiceResource = new alicloud.cen.RouteService("routeServiceResource", {
accessRegionId: "string",
cenId: "string",
host: "string",
hostRegionId: "string",
hostVpcId: "string",
description: "string",
});
type: alicloud:cen:RouteService
properties:
accessRegionId: string
cenId: string
description: string
host: string
hostRegionId: string
hostVpcId: string
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:
- Access
Region stringId - The region of the network instances that access the cloud services.
- Cen
Id string - The ID of the CEN instance.
- Host string
- The domain name or IP address of the cloud service.
- Host
Region stringId - The region of the cloud service.
- Host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- Description string
- The description of the cloud service.
- Access
Region stringId - The region of the network instances that access the cloud services.
- Cen
Id string - The ID of the CEN instance.
- Host string
- The domain name or IP address of the cloud service.
- Host
Region stringId - The region of the cloud service.
- Host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- Description string
- The description of the cloud service.
- access
Region StringId - The region of the network instances that access the cloud services.
- cen
Id String - The ID of the CEN instance.
- host String
- The domain name or IP address of the cloud service.
- host
Region StringId - The region of the cloud service.
- host
Vpc StringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- description String
- The description of the cloud service.
- access
Region stringId - The region of the network instances that access the cloud services.
- cen
Id string - The ID of the CEN instance.
- host string
- The domain name or IP address of the cloud service.
- host
Region stringId - The region of the cloud service.
- host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- description string
- The description of the cloud service.
- access_
region_ strid - 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_ strid - The region of the cloud service.
- host_
vpc_ strid The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- description str
- The description of the cloud service.
- access
Region StringId - The region of the network instances that access the cloud services.
- cen
Id String - The ID of the CEN instance.
- host String
- The domain name or IP address of the cloud service.
- host
Region StringId - The region of the cloud service.
- host
Vpc StringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_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:
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.
- Access
Region stringId - The region of the network instances that access the cloud services.
- Cen
Id 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.
- Host
Region stringId - The region of the cloud service.
- Host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- Status string
- The status of the cloud service.
- Access
Region stringId - The region of the network instances that access the cloud services.
- Cen
Id 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.
- Host
Region stringId - The region of the cloud service.
- Host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- Status string
- The status of the cloud service.
- access
Region StringId - The region of the network instances that access the cloud services.
- cen
Id 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.
- host
Region StringId - The region of the cloud service.
- host
Vpc StringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- status String
- The status of the cloud service.
- access
Region stringId - The region of the network instances that access the cloud services.
- cen
Id 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.
- host
Region stringId - The region of the cloud service.
- host
Vpc stringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- status string
- The status of the cloud service.
- access_
region_ strid - 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_ strid - The region of the cloud service.
- host_
vpc_ strid The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_region_id
must be consistent.- status str
- The status of the cloud service.
- access
Region StringId - The region of the network instances that access the cloud services.
- cen
Id 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.
- host
Region StringId - The region of the cloud service.
- host
Vpc StringId The VPC associated with the cloud service.
NOTE: The values of
host_region_id
andaccess_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
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.