Class 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,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Cen
Assembly: Pulumi.AliCloud.dll
Syntax
public class RouteEntry : CustomResource
Constructors
View SourceRouteEntry(String, RouteEntryArgs, CustomResourceOptions)
Create a RouteEntry resource with the given unique name, arguments, and options.
Declaration
public RouteEntry(string name, RouteEntryArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RouteEntryArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCidrBlock
The destination CIDR block of the route entry to publish.
Declaration
public Output<string> CidrBlock { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceId
The ID of the CEN.
Declaration
public Output<string> InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RouteTableId
The route table of the attached VBR or VPC.
Declaration
public Output<string> RouteTableId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, RouteEntryState, CustomResourceOptions)
Get an existing RouteEntry resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static RouteEntry Get(string name, Input<string> id, RouteEntryState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| RouteEntryState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| RouteEntry |