RouteEntry

Provides a CEN route entry resource. Cloud Enterprise Network (CEN) supports publishing and withdrawing route entries of attached networks. You can publish a route entry of an attached VPC or VBR to a CEN instance, then other attached networks can learn the route if there is no route conflict. You can withdraw a published route entry when CEN does not need it any more.

For information about CEN route entries publishment and how to use it, see Manage network routes.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var hz = new AliCloud.Provider("hz", new AliCloud.ProviderArgs
        {
            Region = "cn-hangzhou",
        });
        var config = new Config();
        var name = config.Get("name") ?? "tf-testAccCenRouteEntryConfig";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultInstanceTypes = defaultZones.Apply(defaultZones => Output.Create(AliCloud.Ecs.GetInstanceTypes.InvokeAsync(new AliCloud.Ecs.GetInstanceTypesArgs
        {
            AvailabilityZone = defaultZones.Zones[0].Id,
            CpuCoreCount = 1,
            MemorySize = 2,
        })));
        var defaultImages = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
        {
            MostRecent = true,
            NameRegex = "^ubuntu_18.*64",
            Owners = "system",
        }));
        var vpc = new AliCloud.Vpc.Network("vpc", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/12",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "172.16.0.0/21",
            VpcId = vpc.Id,
        });
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new AliCloud.Ecs.SecurityGroupArgs
        {
            Description = "foo",
            VpcId = vpc.Id,
        });
        var defaultInstance = new AliCloud.Ecs.Instance("defaultInstance", new AliCloud.Ecs.InstanceArgs
        {
            ImageId = defaultImages.Apply(defaultImages => defaultImages.Images[0].Id),
            InstanceName = name,
            InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.InstanceTypes[0].Id),
            InternetChargeType = "PayByTraffic",
            InternetMaxBandwidthOut = 5,
            SecurityGroups = 
            {
                defaultSecurityGroup.Id,
            },
            SystemDiskCategory = "cloud_efficiency",
            VswitchId = defaultSwitch.Id,
        });
        var cen = new AliCloud.Cen.Instance("cen", new AliCloud.Cen.InstanceArgs
        {
        });
        var attach = new AliCloud.Cen.InstanceAttachment("attach", new AliCloud.Cen.InstanceAttachmentArgs
        {
            ChildInstanceId = vpc.Id,
            ChildInstanceRegionId = "cn-hangzhou",
            InstanceId = cen.Id,
        });
        var route = new AliCloud.Vpc.RouteEntry("route", new AliCloud.Vpc.RouteEntryArgs
        {
            DestinationCidrblock = "11.0.0.0/16",
            NexthopId = defaultInstance.Id,
            NexthopType = "Instance",
            RouteTableId = vpc.RouteTableId,
        });
        var foo = new AliCloud.Cen.RouteEntry("foo", new AliCloud.Cen.RouteEntryArgs
        {
            CidrBlock = route.DestinationCidrblock,
            InstanceId = cen.Id,
            RouteTableId = vpc.RouteTableId,
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud
import pulumi_pulumi as pulumi

hz = pulumi.providers.Alicloud("hz", region="cn-hangzhou")
config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testAccCenRouteEntryConfig"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
    cpu_core_count=1,
    memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
    name_regex="^ubuntu_18.*64",
    owners="system")
vpc = alicloud.vpc.Network("vpc", cidr_block="172.16.0.0/12")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/21",
    vpc_id=vpc.id)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup",
    description="foo",
    vpc_id=vpc.id)
default_instance = alicloud.ecs.Instance("defaultInstance",
    image_id=default_images.images[0]["id"],
    instance_name=name,
    instance_type=default_instance_types.instance_types[0]["id"],
    internet_charge_type="PayByTraffic",
    internet_max_bandwidth_out=5,
    security_groups=[default_security_group.id],
    system_disk_category="cloud_efficiency",
    vswitch_id=default_switch.id)
cen = alicloud.cen.Instance("cen")
attach = alicloud.cen.InstanceAttachment("attach",
    child_instance_id=vpc.id,
    child_instance_region_id="cn-hangzhou",
    instance_id=cen.id)
route = alicloud.vpc.RouteEntry("route",
    destination_cidrblock="11.0.0.0/16",
    nexthop_id=default_instance.id,
    nexthop_type="Instance",
    route_table_id=vpc.route_table_id)
foo = alicloud.cen.RouteEntry("foo",
    cidr_block=route.destination_cidrblock,
    instance_id=cen.id,
    route_table_id=vpc.route_table_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-testAccCenRouteEntryConfig";

const hz = new alicloud.Provider("hz", {
    region: "cn-hangzhou",
});
const defaultZones = pulumi.output(alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
}, { provider: hz, async: true }));
const defaultInstanceTypes = defaultZones.apply(defaultZones => alicloud.ecs.getInstanceTypes({
    availabilityZone: defaultZones.zones[0].id,
    cpuCoreCount: 1,
    memorySize: 2,
}, { provider: hz, async: true }));
const defaultImages = pulumi.output(alicloud.ecs.getImages({
    mostRecent: true,
    nameRegex: "^ubuntu_18.*64",
    owners: "system",
}, { provider: hz, async: true }));
const vpc = new alicloud.vpc.Network("vpc", {
    cidrBlock: "172.16.0.0/12",
}, { provider: hz });
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/21",
    vpcId: vpc.id,
}, { provider: hz });
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
    description: "foo",
    vpcId: vpc.id,
}, { provider: hz });
const defaultInstance = new alicloud.ecs.Instance("default", {
    imageId: defaultImages.images[0].id,
    instanceName: name,
    instanceType: defaultInstanceTypes.instanceTypes[0].id,
    internetChargeType: "PayByTraffic",
    internetMaxBandwidthOut: 5,
    securityGroups: [defaultSecurityGroup.id],
    systemDiskCategory: "cloud_efficiency",
    vswitchId: defaultSwitch.id,
}, { provider: hz });
const cen = new alicloud.cen.Instance("cen", {});
const attach = new alicloud.cen.InstanceAttachment("attach", {
    childInstanceId: vpc.id,
    childInstanceRegionId: "cn-hangzhou",
    instanceId: cen.id,
}, { dependsOn: [defaultSwitch] });
const route = new alicloud.vpc.RouteEntry("route", {
    destinationCidrblock: "11.0.0.0/16",
    nexthopId: defaultInstance.id,
    nexthopType: "Instance",
    routeTableId: vpc.routeTableId,
}, { provider: hz });
const foo = new alicloud.cen.RouteEntry("foo", {
    cidrBlock: route.destinationCidrblock,
    instanceId: cen.id,
    routeTableId: vpc.routeTableId,
}, { provider: hz, dependsOn: [attach] });

Create a RouteEntry Resource

def RouteEntry(resource_name, opts=None, cidr_block=None, instance_id=None, route_table_id=None, __props__=None);
func NewRouteEntry(ctx *Context, name string, args RouteEntryArgs, opts ...ResourceOption) (*RouteEntry, error)
public RouteEntry(string name, RouteEntryArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RouteEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RouteEntryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RouteEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RouteEntry Resource Properties

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

Inputs

The RouteEntry resource accepts the following input properties:

CidrBlock string

The destination CIDR block of the route entry to publish.

InstanceId string

The ID of the CEN.

RouteTableId string

The route table of the attached VBR or VPC.

CidrBlock string

The destination CIDR block of the route entry to publish.

InstanceId string

The ID of the CEN.

RouteTableId string

The route table of the attached VBR or VPC.

cidrBlock string

The destination CIDR block of the route entry to publish.

instanceId string

The ID of the CEN.

routeTableId string

The route table of the attached VBR or VPC.

cidr_block str

The destination CIDR block of the route entry to publish.

instance_id str

The ID of the CEN.

route_table_id str

The route table of the attached VBR or VPC.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing RouteEntry Resource

Get an existing RouteEntry 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?: RouteEntryState, opts?: CustomResourceOptions): RouteEntry
static get(resource_name, id, opts=None, cidr_block=None, instance_id=None, route_table_id=None, __props__=None);
func GetRouteEntry(ctx *Context, name string, id IDInput, state *RouteEntryState, opts ...ResourceOption) (*RouteEntry, error)
public static RouteEntry Get(string name, Input<string> id, RouteEntryState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

CidrBlock string

The destination CIDR block of the route entry to publish.

InstanceId string

The ID of the CEN.

RouteTableId string

The route table of the attached VBR or VPC.

CidrBlock string

The destination CIDR block of the route entry to publish.

InstanceId string

The ID of the CEN.

RouteTableId string

The route table of the attached VBR or VPC.

cidrBlock string

The destination CIDR block of the route entry to publish.

instanceId string

The ID of the CEN.

routeTableId string

The route table of the attached VBR or VPC.

cidr_block str

The destination CIDR block of the route entry to publish.

instance_id str

The ID of the CEN.

route_table_id str

The route table of the attached VBR or VPC.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.