RouteMapArgs

data class RouteMapArgs(val asPathMatchMode: Output<String>? = null, val cenId: Output<String>? = null, val cenRegionId: Output<String>? = null, val cidrMatchMode: Output<String>? = null, val communityMatchMode: Output<String>? = null, val communityOperateMode: Output<String>? = null, val description: Output<String>? = null, val destinationChildInstanceTypes: Output<List<String>>? = null, val destinationCidrBlocks: Output<List<String>>? = null, val destinationInstanceIds: Output<List<String>>? = null, val destinationInstanceIdsReverseMatch: Output<Boolean>? = null, val destinationRouteTableIds: Output<List<String>>? = null, val mapResult: Output<String>? = null, val matchAsns: Output<List<String>>? = null, val matchCommunitySets: Output<List<String>>? = null, val nextPriority: Output<Int>? = null, val operateCommunitySets: Output<List<String>>? = null, val preference: Output<Int>? = null, val prependAsPaths: Output<List<String>>? = null, val priority: Output<Int>? = null, val routeTypes: Output<List<String>>? = null, val sourceChildInstanceTypes: Output<List<String>>? = null, val sourceInstanceIds: Output<List<String>>? = null, val sourceInstanceIdsReverseMatch: Output<Boolean>? = null, val sourceRegionIds: Output<List<String>>? = null, val sourceRouteTableIds: Output<List<String>>? = null, val transitRouterRouteTableId: Output<String>? = null, val transmitDirection: Output<String>? = null) : ConvertibleToJava<RouteMapArgs>

This topic provides an overview of the route map function of Cloud Enterprise Networks (CENs). You can use the route map function to filter routes and modify route attributes. By doing so, you can manage the communication between networks attached to a CEN. For information about CEN Route Map and how to use it, see Manage CEN Route Map.

NOTE: Available since v1.82.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.Provider;
import com.pulumi.alicloud.ProviderArgs;
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.RouteMap;
import com.pulumi.alicloud.cen.RouteMapArgs;
import com.pulumi.resources.CustomResourceOptions;
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 sourceRegion = config.get("sourceRegion").orElse("cn-hangzhou");
final var destinationRegion = config.get("destinationRegion").orElse("cn-shanghai");
var hz = new Provider("hz", ProviderArgs.builder()
.region(sourceRegion)
.build());
var sh = new Provider("sh", ProviderArgs.builder()
.region(destinationRegion)
.build());
var exampleHzNetwork = new Network("exampleHzNetwork", NetworkArgs.builder()
.vpcName("tf_example")
.cidrBlock("192.168.0.0/16")
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var exampleShNetwork = new Network("exampleShNetwork", NetworkArgs.builder()
.vpcName("tf_example")
.cidrBlock("172.16.0.0/12")
.build(), CustomResourceOptions.builder()
.provider(alicloud.sh())
.build());
var example = new Instance("example", InstanceArgs.builder()
.cenInstanceName("tf_example")
.description("an example for cen")
.build());
var exampleHzInstanceAttachment = new InstanceAttachment("exampleHzInstanceAttachment", InstanceAttachmentArgs.builder()
.instanceId(example.id())
.childInstanceId(exampleHzNetwork.id())
.childInstanceType("VPC")
.childInstanceRegionId(sourceRegion)
.build());
var exampleShInstanceAttachment = new InstanceAttachment("exampleShInstanceAttachment", InstanceAttachmentArgs.builder()
.instanceId(example.id())
.childInstanceId(exampleShNetwork.id())
.childInstanceType("VPC")
.childInstanceRegionId(destinationRegion)
.build());
var default_ = new RouteMap("default", RouteMapArgs.builder()
.cenRegionId(sourceRegion)
.cenId(example.id())
.description("tf_example")
.priority("1")
.transmitDirection("RegionIn")
.mapResult("Permit")
.nextPriority("1")
.sourceRegionIds(sourceRegion)
.sourceInstanceIds(exampleHzInstanceAttachment.childInstanceId())
.sourceInstanceIdsReverseMatch("false")
.destinationInstanceIds(exampleShInstanceAttachment.childInstanceId())
.destinationInstanceIdsReverseMatch("false")
.sourceRouteTableIds(exampleHzNetwork.routeTableId())
.destinationRouteTableIds(exampleShNetwork.routeTableId())
.sourceChildInstanceTypes("VPC")
.destinationChildInstanceTypes("VPC")
.destinationCidrBlocks(exampleShNetwork.cidrBlock())
.cidrMatchMode("Include")
.routeTypes("System")
.matchAsns("65501")
.asPathMatchMode("Include")
.matchCommunitySets("65501:1")
.communityMatchMode("Include")
.communityOperateMode("Additive")
.operateCommunitySets("65501:1")
.preference("20")
.prependAsPaths("65501")
.build());
}
}

Import

CEN RouteMap can be imported using the id, e.g.

$ pulumi import alicloud:cen/routeMap:RouteMap default <cen_id>:<route_map_id>.

Constructors

Link copied to clipboard
fun RouteMapArgs(asPathMatchMode: Output<String>? = null, cenId: Output<String>? = null, cenRegionId: Output<String>? = null, cidrMatchMode: Output<String>? = null, communityMatchMode: Output<String>? = null, communityOperateMode: Output<String>? = null, description: Output<String>? = null, destinationChildInstanceTypes: Output<List<String>>? = null, destinationCidrBlocks: Output<List<String>>? = null, destinationInstanceIds: Output<List<String>>? = null, destinationInstanceIdsReverseMatch: Output<Boolean>? = null, destinationRouteTableIds: Output<List<String>>? = null, mapResult: Output<String>? = null, matchAsns: Output<List<String>>? = null, matchCommunitySets: Output<List<String>>? = null, nextPriority: Output<Int>? = null, operateCommunitySets: Output<List<String>>? = null, preference: Output<Int>? = null, prependAsPaths: Output<List<String>>? = null, priority: Output<Int>? = null, routeTypes: Output<List<String>>? = null, sourceChildInstanceTypes: Output<List<String>>? = null, sourceInstanceIds: Output<List<String>>? = null, sourceInstanceIdsReverseMatch: Output<Boolean>? = null, sourceRegionIds: Output<List<String>>? = null, sourceRouteTableIds: Output<List<String>>? = null, transitRouterRouteTableId: Output<String>? = null, transmitDirection: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): RouteMapArgs

Properties

Link copied to clipboard
val asPathMatchMode: Output<String>? = null

A match statement. It indicates the mode in which the AS path attribute is matched. Valid values: "Include", "Complete".

Link copied to clipboard
val cenId: Output<String>? = null

The ID of the CEN instance.

Link copied to clipboard
val cenRegionId: Output<String>? = null

The ID of the region to which the CEN instance belongs.

Link copied to clipboard
val cidrMatchMode: Output<String>? = null

A match statement. It indicates the mode in which the prefix attribute is matched. Valid values: "Include", "Complete".

Link copied to clipboard
val communityMatchMode: Output<String>? = null

A match statement. It indicates the mode in which the community attribute is matched. Valid values: "Include", "Complete".

Link copied to clipboard
val communityOperateMode: Output<String>? = null

An action statement. It indicates the mode in which the community attribute is operated. Valid values: "Additive", "Replace".

Link copied to clipboard
val description: Output<String>? = null

The description of the route map.

Link copied to clipboard

A match statement that indicates the list of destination instance types. Valid values: "VPC", "VBR", "CCN", "VPN".

Link copied to clipboard
val destinationCidrBlocks: Output<List<String>>? = null

A match statement that indicates the prefix list. The prefix is in the CIDR format. You can enter a maximum of 32 CIDR blocks.

Link copied to clipboard
val destinationInstanceIds: Output<List<String>>? = null

A match statement that indicates the list of IDs of the destination instances.

Link copied to clipboard

Indicates whether to enable the reverse match method for the DestinationInstanceIds match condition. Valid values: "false", "true". Default to "false".

Link copied to clipboard
val destinationRouteTableIds: Output<List<String>>? = null

A match statement that indicates the list of IDs of the destination route tables. You can enter a maximum of 32 route table IDs.

Link copied to clipboard
val mapResult: Output<String>? = null

The action that is performed to a route if the route matches all the match conditions. Valid values: "Permit", "Deny".

Link copied to clipboard
val matchAsns: Output<List<String>>? = null

A match statement that indicates the AS path list. The AS path is a well-known mandatory attribute, which describes the numbers of the ASs that a BGP route passes through during transmission.

Link copied to clipboard
val matchCommunitySets: Output<List<String>>? = null

A match statement that indicates the community set. The format of each community is nn:nn, which ranges from 1 to 65535. You can enter a maximum of 32 communities. Communities must comply with RFC 1997. Large communities (RFC 8092) are not supported.

Link copied to clipboard
val nextPriority: Output<Int>? = null

The priority of the next route map that is associated with the current route map. Value range: 1 to 100.

Link copied to clipboard
val operateCommunitySets: Output<List<String>>? = null

An action statement that operates the community attribute. The format of each community is nn:nn, which ranges from 1 to 65535. You can enter a maximum of 32 communities. Communities must comply with RFC 1997. Large communities (RFC 8092) are not supported.

Link copied to clipboard
val preference: Output<Int>? = null

An action statement that modifies the priority of the route. Value range: 1 to 100. The default priority of a route is 50. A lower value indicates a higher preference.

Link copied to clipboard
val prependAsPaths: Output<List<String>>? = null

An action statement that indicates an AS path is prepended when the regional gateway receives or advertises a route.

Link copied to clipboard
val priority: Output<Int>? = null

The priority of the route map. Value range: 1 to 100. A lower value indicates a higher priority.

Link copied to clipboard
val routeTypes: Output<List<String>>? = null

A match statement that indicates the list of route types. Valid values: "System", "Custom", "BGP".

Link copied to clipboard
val sourceChildInstanceTypes: Output<List<String>>? = null

A match statement that indicates the list of source instance types. Valid values: "VPC", "VBR", "CCN".

Link copied to clipboard
val sourceInstanceIds: Output<List<String>>? = null

A match statement that indicates the list of IDs of the source instances.

Link copied to clipboard

Indicates whether to enable the reverse match method for the SourceInstanceIds match condition. Valid values: "false", "true". Default to "false".

Link copied to clipboard
val sourceRegionIds: Output<List<String>>? = null

A match statement that indicates the list of IDs of the source regions. You can enter a maximum of 32 region IDs.

Link copied to clipboard
val sourceRouteTableIds: Output<List<String>>? = null

A match statement that indicates the list of IDs of the source route tables. You can enter a maximum of 32 route table IDs.

Link copied to clipboard
val transitRouterRouteTableId: Output<String>? = null

The routing table ID of the forwarding router. If you do not enter the routing table ID, the routing policy is automatically associated with the default routing table of the forwarding router.

Link copied to clipboard
val transmitDirection: Output<String>? = null

The direction in which the route map is applied. Valid values: "RegionIn", "RegionOut".