1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. VPCRouteEntry
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.vpc.VPCRouteEntry

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    Provides a VPC Route Entry resource.

    There are route entries in the routing table, and the next hop is judged based on the route entries.

    For information about VPC Route Entry and how to use it, see What is Route Entry.

    NOTE: Available since v1.245.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.getZones({
        availableDiskCategory: "cloud_efficiency",
        availableResourceCreation: "VSwitch",
    });
    const defaultGetImages = alicloud.ecs.getImages({
        mostRecent: true,
        owners: "system",
    });
    const defaultGetInstanceTypes = Promise.all([_default, defaultGetImages]).then(([_default, defaultGetImages]) => alicloud.ecs.getInstanceTypes({
        availabilityZone: _default.zones?.[0]?.id,
        imageId: defaultGetImages.images?.[0]?.id,
    }));
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "192.168.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: name,
        vpcId: defaultNetwork.id,
        cidrBlock: "192.168.192.0/24",
        zoneId: _default.then(_default => _default.zones?.[0]?.id),
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
        name: name,
        vpcId: defaultNetwork.id,
    });
    const defaultInstance = new alicloud.ecs.Instance("default", {
        imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
        instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
        securityGroups: [defaultSecurityGroup].map(__item => __item.id),
        internetChargeType: "PayByTraffic",
        internetMaxBandwidthOut: 10,
        availabilityZone: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.availabilityZones?.[0]),
        instanceChargeType: "PostPaid",
        systemDiskCategory: "cloud_efficiency",
        vswitchId: defaultSwitch.id,
        instanceName: name,
    });
    const foo = new alicloud.vpc.RouteEntry("foo", {
        routeTableId: defaultNetwork.routeTableId,
        destinationCidrblock: "172.11.1.1/32",
        nexthopType: "Instance",
        nexthopId: defaultInstance.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.get_zones(available_disk_category="cloud_efficiency",
        available_resource_creation="VSwitch")
    default_get_images = alicloud.ecs.get_images(most_recent=True,
        owners="system")
    default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
        image_id=default_get_images.images[0].id)
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="192.168.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=name,
        vpc_id=default_network.id,
        cidr_block="192.168.192.0/24",
        zone_id=default.zones[0].id)
    default_security_group = alicloud.ecs.SecurityGroup("default",
        name=name,
        vpc_id=default_network.id)
    default_instance = alicloud.ecs.Instance("default",
        image_id=default_get_images.images[0].id,
        instance_type=default_get_instance_types.instance_types[0].id,
        security_groups=[__item.id for __item in [default_security_group]],
        internet_charge_type="PayByTraffic",
        internet_max_bandwidth_out=10,
        availability_zone=default_get_instance_types.instance_types[0].availability_zones[0],
        instance_charge_type="PostPaid",
        system_disk_category="cloud_efficiency",
        vswitch_id=default_switch.id,
        instance_name=name)
    foo = alicloud.vpc.RouteEntry("foo",
        route_table_id=default_network.route_table_id,
        destination_cidrblock="172.11.1.1/32",
        nexthop_type="Instance",
        nexthop_id=default_instance.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"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 := "terraform-example";
    if param := cfg.Get("name"); param != ""{
    name = param
    }
    _default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    AvailableDiskCategory: pulumi.StringRef("cloud_efficiency"),
    AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    }, nil);
    if err != nil {
    return err
    }
    defaultGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
    MostRecent: pulumi.BoolRef(true),
    Owners: pulumi.StringRef("system"),
    }, nil);
    if err != nil {
    return err
    }
    defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
    AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
    ImageId: pulumi.StringRef(defaultGetImages.Images[0].Id),
    }, nil);
    if err != nil {
    return err
    }
    defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    VpcName: pulumi.String(name),
    CidrBlock: pulumi.String("192.168.0.0/16"),
    })
    if err != nil {
    return err
    }
    defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    VswitchName: pulumi.String(name),
    VpcId: defaultNetwork.ID(),
    CidrBlock: pulumi.String("192.168.192.0/24"),
    ZoneId: pulumi.String(_default.Zones[0].Id),
    })
    if err != nil {
    return err
    }
    defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
    Name: pulumi.String(name),
    VpcId: defaultNetwork.ID(),
    })
    if err != nil {
    return err
    }
    var splat0 pulumi.StringArray
    for _, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
    splat0 = append(splat0, val0.ID())
    }
    defaultInstance, err := ecs.NewInstance(ctx, "default", &ecs.InstanceArgs{
    ImageId: pulumi.String(defaultGetImages.Images[0].Id),
    InstanceType: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
    SecurityGroups: splat0,
    InternetChargeType: pulumi.String("PayByTraffic"),
    InternetMaxBandwidthOut: pulumi.Int(10),
    AvailabilityZone: pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].AvailabilityZones[0]),
    InstanceChargeType: pulumi.String("PostPaid"),
    SystemDiskCategory: pulumi.String("cloud_efficiency"),
    VswitchId: defaultSwitch.ID(),
    InstanceName: pulumi.String(name),
    })
    if err != nil {
    return err
    }
    _, err = vpc.NewRouteEntry(ctx, "foo", &vpc.RouteEntryArgs{
    RouteTableId: defaultNetwork.RouteTableId,
    DestinationCidrblock: pulumi.String("172.11.1.1/32"),
    NexthopType: pulumi.String("Instance"),
    NexthopId: defaultInstance.ID(),
    })
    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 config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultGetImages = AliCloud.Ecs.GetImages.Invoke(new()
        {
            MostRecent = true,
            Owners = "system",
        });
    
        var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        {
            AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "192.168.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = name,
            VpcId = defaultNetwork.Id,
            CidrBlock = "192.168.192.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
        {
            Name = name,
            VpcId = defaultNetwork.Id,
        });
    
        var defaultInstance = new AliCloud.Ecs.Instance("default", new()
        {
            ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
            InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
            SecurityGroups = new[]
            {
                defaultSecurityGroup,
            }.Select(__item => __item.Id).ToList(),
            InternetChargeType = "PayByTraffic",
            InternetMaxBandwidthOut = 10,
            AvailabilityZone = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.AvailabilityZones[0]),
            InstanceChargeType = "PostPaid",
            SystemDiskCategory = "cloud_efficiency",
            VswitchId = defaultSwitch.Id,
            InstanceName = name,
        });
    
        var foo = new AliCloud.Vpc.RouteEntry("foo", new()
        {
            RouteTableId = defaultNetwork.RouteTableId,
            DestinationCidrblock = "172.11.1.1/32",
            NexthopType = "Instance",
            NexthopId = defaultInstance.Id,
        });
    
    });
    
    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.GetZonesArgs;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
    import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.ecs.Instance;
    import com.pulumi.alicloud.ecs.InstanceArgs;
    import com.pulumi.alicloud.vpc.RouteEntry;
    import com.pulumi.alicloud.vpc.RouteEntryArgs;
    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("terraform-example");
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableDiskCategory("cloud_efficiency")
                .availableResourceCreation("VSwitch")
                .build());
    
            final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
                .mostRecent(true)
                .owners("system")
                .build());
    
            final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .availabilityZone(default_.zones()[0].id())
                .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("192.168.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vswitchName(name)
                .vpcId(defaultNetwork.id())
                .cidrBlock("192.168.192.0/24")
                .zoneId(default_.zones()[0].id())
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
                .name(name)
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
                .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
                .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
                .securityGroups(defaultSecurityGroup.stream().map(element -> element.id()).collect(toList()))
                .internetChargeType("PayByTraffic")
                .internetMaxBandwidthOut("10")
                .availabilityZone(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].availabilityZones()[0]))
                .instanceChargeType("PostPaid")
                .systemDiskCategory("cloud_efficiency")
                .vswitchId(defaultSwitch.id())
                .instanceName(name)
                .build());
    
            var foo = new RouteEntry("foo", RouteEntryArgs.builder()
                .routeTableId(defaultNetwork.routeTableId())
                .destinationCidrblock("172.11.1.1/32")
                .nexthopType("Instance")
                .nexthopId(defaultInstance.id())
                .build());
    
        }
    }
    
    Coming soon!
    

    Create VPCRouteEntry Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VPCRouteEntry(name: string, args: VPCRouteEntryArgs, opts?: CustomResourceOptions);
    @overload
    def VPCRouteEntry(resource_name: str,
                      args: VPCRouteEntryArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def VPCRouteEntry(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      destination_cidr_block: Optional[str] = None,
                      route_table_id: Optional[str] = None,
                      description: Optional[str] = None,
                      next_hops: Optional[Sequence[VPCRouteEntryNextHopArgs]] = None,
                      nexthop_id: Optional[str] = None,
                      nexthop_type: Optional[str] = None,
                      route_entry_name: Optional[str] = None,
                      route_publish_targets: Optional[Sequence[VPCRouteEntryRoutePublishTargetArgs]] = None)
    func NewVPCRouteEntry(ctx *Context, name string, args VPCRouteEntryArgs, opts ...ResourceOption) (*VPCRouteEntry, error)
    public VPCRouteEntry(string name, VPCRouteEntryArgs args, CustomResourceOptions? opts = null)
    public VPCRouteEntry(String name, VPCRouteEntryArgs args)
    public VPCRouteEntry(String name, VPCRouteEntryArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:VPCRouteEntry
    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 VPCRouteEntryArgs
    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 VPCRouteEntryArgs
    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 VPCRouteEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VPCRouteEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VPCRouteEntryArgs
    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 vpcrouteEntryResource = new AliCloud.Vpc.VPCRouteEntry("vpcrouteEntryResource", new()
    {
        DestinationCidrBlock = "string",
        RouteTableId = "string",
        Description = "string",
        NextHops = new[]
        {
            new AliCloud.Vpc.Inputs.VPCRouteEntryNextHopArgs
            {
                Enabled = 0,
                NextHopRegionId = "string",
                NextHopRelatedInfo = new AliCloud.Vpc.Inputs.VPCRouteEntryNextHopNextHopRelatedInfoArgs
                {
                    InstanceId = "string",
                    InstanceType = "string",
                    RegionId = "string",
                },
                NexthopId = "string",
                NexthopType = "string",
                Weight = 0,
            },
        },
        NexthopId = "string",
        NexthopType = "string",
        RouteEntryName = "string",
        RoutePublishTargets = new[]
        {
            new AliCloud.Vpc.Inputs.VPCRouteEntryRoutePublishTargetArgs
            {
                TargetType = "string",
                PublishStatus = "string",
                TargetInstanceId = "string",
            },
        },
    });
    
    example, err := vpc.NewVPCRouteEntry(ctx, "vpcrouteEntryResource", &vpc.VPCRouteEntryArgs{
    	DestinationCidrBlock: pulumi.String("string"),
    	RouteTableId:         pulumi.String("string"),
    	Description:          pulumi.String("string"),
    	NextHops: vpc.VPCRouteEntryNextHopArray{
    		&vpc.VPCRouteEntryNextHopArgs{
    			Enabled:         pulumi.Int(0),
    			NextHopRegionId: pulumi.String("string"),
    			NextHopRelatedInfo: &vpc.VPCRouteEntryNextHopNextHopRelatedInfoArgs{
    				InstanceId:   pulumi.String("string"),
    				InstanceType: pulumi.String("string"),
    				RegionId:     pulumi.String("string"),
    			},
    			NexthopId:   pulumi.String("string"),
    			NexthopType: pulumi.String("string"),
    			Weight:      pulumi.Int(0),
    		},
    	},
    	NexthopId:      pulumi.String("string"),
    	NexthopType:    pulumi.String("string"),
    	RouteEntryName: pulumi.String("string"),
    	RoutePublishTargets: vpc.VPCRouteEntryRoutePublishTargetArray{
    		&vpc.VPCRouteEntryRoutePublishTargetArgs{
    			TargetType:       pulumi.String("string"),
    			PublishStatus:    pulumi.String("string"),
    			TargetInstanceId: pulumi.String("string"),
    		},
    	},
    })
    
    var vpcrouteEntryResource = new VPCRouteEntry("vpcrouteEntryResource", VPCRouteEntryArgs.builder()
        .destinationCidrBlock("string")
        .routeTableId("string")
        .description("string")
        .nextHops(VPCRouteEntryNextHopArgs.builder()
            .enabled(0)
            .nextHopRegionId("string")
            .nextHopRelatedInfo(VPCRouteEntryNextHopNextHopRelatedInfoArgs.builder()
                .instanceId("string")
                .instanceType("string")
                .regionId("string")
                .build())
            .nexthopId("string")
            .nexthopType("string")
            .weight(0)
            .build())
        .nexthopId("string")
        .nexthopType("string")
        .routeEntryName("string")
        .routePublishTargets(VPCRouteEntryRoutePublishTargetArgs.builder()
            .targetType("string")
            .publishStatus("string")
            .targetInstanceId("string")
            .build())
        .build());
    
    vpcroute_entry_resource = alicloud.vpc.VPCRouteEntry("vpcrouteEntryResource",
        destination_cidr_block="string",
        route_table_id="string",
        description="string",
        next_hops=[{
            "enabled": 0,
            "next_hop_region_id": "string",
            "next_hop_related_info": {
                "instance_id": "string",
                "instance_type": "string",
                "region_id": "string",
            },
            "nexthop_id": "string",
            "nexthop_type": "string",
            "weight": 0,
        }],
        nexthop_id="string",
        nexthop_type="string",
        route_entry_name="string",
        route_publish_targets=[{
            "target_type": "string",
            "publish_status": "string",
            "target_instance_id": "string",
        }])
    
    const vpcrouteEntryResource = new alicloud.vpc.VPCRouteEntry("vpcrouteEntryResource", {
        destinationCidrBlock: "string",
        routeTableId: "string",
        description: "string",
        nextHops: [{
            enabled: 0,
            nextHopRegionId: "string",
            nextHopRelatedInfo: {
                instanceId: "string",
                instanceType: "string",
                regionId: "string",
            },
            nexthopId: "string",
            nexthopType: "string",
            weight: 0,
        }],
        nexthopId: "string",
        nexthopType: "string",
        routeEntryName: "string",
        routePublishTargets: [{
            targetType: "string",
            publishStatus: "string",
            targetInstanceId: "string",
        }],
    });
    
    type: alicloud:vpc:VPCRouteEntry
    properties:
        description: string
        destinationCidrBlock: string
        nextHops:
            - enabled: 0
              nextHopRegionId: string
              nextHopRelatedInfo:
                instanceId: string
                instanceType: string
                regionId: string
              nexthopId: string
              nexthopType: string
              weight: 0
        nexthopId: string
        nexthopType: string
        routeEntryName: string
        routePublishTargets:
            - publishStatus: string
              targetInstanceId: string
              targetType: string
        routeTableId: string
    

    VPCRouteEntry Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VPCRouteEntry resource accepts the following input properties:

    DestinationCidrBlock string
    The destination network segment of the routing entry.
    RouteTableId string
    Routing table ID
    Description string
    Description of the route entry.
    NextHops List<Pulumi.AliCloud.Vpc.Inputs.VPCRouteEntryNextHop>
    Next jump See next_hops below.
    NexthopId string
    The ID of the next hop instance of the custom route entry.
    NexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    RouteEntryName string
    The name of the route entry.
    RoutePublishTargets List<Pulumi.AliCloud.Vpc.Inputs.VPCRouteEntryRoutePublishTarget>
    Route publish status and publish target type See route_publish_targets below.
    DestinationCidrBlock string
    The destination network segment of the routing entry.
    RouteTableId string
    Routing table ID
    Description string
    Description of the route entry.
    NextHops []VPCRouteEntryNextHopArgs
    Next jump See next_hops below.
    NexthopId string
    The ID of the next hop instance of the custom route entry.
    NexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    RouteEntryName string
    The name of the route entry.
    RoutePublishTargets []VPCRouteEntryRoutePublishTargetArgs
    Route publish status and publish target type See route_publish_targets below.
    destinationCidrBlock String
    The destination network segment of the routing entry.
    routeTableId String
    Routing table ID
    description String
    Description of the route entry.
    nextHops List<VPCRouteEntryNextHop>
    Next jump See next_hops below.
    nexthopId String
    The ID of the next hop instance of the custom route entry.
    nexthopType String
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName String
    The name of the route entry.
    routePublishTargets List<VPCRouteEntryRoutePublishTarget>
    Route publish status and publish target type See route_publish_targets below.
    destinationCidrBlock string
    The destination network segment of the routing entry.
    routeTableId string
    Routing table ID
    description string
    Description of the route entry.
    nextHops VPCRouteEntryNextHop[]
    Next jump See next_hops below.
    nexthopId string
    The ID of the next hop instance of the custom route entry.
    nexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName string
    The name of the route entry.
    routePublishTargets VPCRouteEntryRoutePublishTarget[]
    Route publish status and publish target type See route_publish_targets below.
    destination_cidr_block str
    The destination network segment of the routing entry.
    route_table_id str
    Routing table ID
    description str
    Description of the route entry.
    next_hops Sequence[VPCRouteEntryNextHopArgs]
    Next jump See next_hops below.
    nexthop_id str
    The ID of the next hop instance of the custom route entry.
    nexthop_type str
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    route_entry_name str
    The name of the route entry.
    route_publish_targets Sequence[VPCRouteEntryRoutePublishTargetArgs]
    Route publish status and publish target type See route_publish_targets below.
    destinationCidrBlock String
    The destination network segment of the routing entry.
    routeTableId String
    Routing table ID
    description String
    Description of the route entry.
    nextHops List<Property Map>
    Next jump See next_hops below.
    nexthopId String
    The ID of the next hop instance of the custom route entry.
    nexthopType String
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName String
    The name of the route entry.
    routePublishTargets List<Property Map>
    Route publish status and publish target type See route_publish_targets below.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the route entry.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the route entry.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the route entry.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the route entry.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the route entry.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the route entry.

    Look up Existing VPCRouteEntry Resource

    Get an existing VPCRouteEntry 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?: VPCRouteEntryState, opts?: CustomResourceOptions): VPCRouteEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            destination_cidr_block: Optional[str] = None,
            next_hops: Optional[Sequence[VPCRouteEntryNextHopArgs]] = None,
            nexthop_id: Optional[str] = None,
            nexthop_type: Optional[str] = None,
            route_entry_name: Optional[str] = None,
            route_publish_targets: Optional[Sequence[VPCRouteEntryRoutePublishTargetArgs]] = None,
            route_table_id: Optional[str] = None,
            status: Optional[str] = None) -> VPCRouteEntry
    func GetVPCRouteEntry(ctx *Context, name string, id IDInput, state *VPCRouteEntryState, opts ...ResourceOption) (*VPCRouteEntry, error)
    public static VPCRouteEntry Get(string name, Input<string> id, VPCRouteEntryState? state, CustomResourceOptions? opts = null)
    public static VPCRouteEntry get(String name, Output<String> id, VPCRouteEntryState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:vpc:VPCRouteEntry    get:      id: ${id}
    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:
    Description string
    Description of the route entry.
    DestinationCidrBlock string
    The destination network segment of the routing entry.
    NextHops List<Pulumi.AliCloud.Vpc.Inputs.VPCRouteEntryNextHop>
    Next jump See next_hops below.
    NexthopId string
    The ID of the next hop instance of the custom route entry.
    NexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    RouteEntryName string
    The name of the route entry.
    RoutePublishTargets List<Pulumi.AliCloud.Vpc.Inputs.VPCRouteEntryRoutePublishTarget>
    Route publish status and publish target type See route_publish_targets below.
    RouteTableId string
    Routing table ID
    Status string
    The status of the route entry.
    Description string
    Description of the route entry.
    DestinationCidrBlock string
    The destination network segment of the routing entry.
    NextHops []VPCRouteEntryNextHopArgs
    Next jump See next_hops below.
    NexthopId string
    The ID of the next hop instance of the custom route entry.
    NexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    RouteEntryName string
    The name of the route entry.
    RoutePublishTargets []VPCRouteEntryRoutePublishTargetArgs
    Route publish status and publish target type See route_publish_targets below.
    RouteTableId string
    Routing table ID
    Status string
    The status of the route entry.
    description String
    Description of the route entry.
    destinationCidrBlock String
    The destination network segment of the routing entry.
    nextHops List<VPCRouteEntryNextHop>
    Next jump See next_hops below.
    nexthopId String
    The ID of the next hop instance of the custom route entry.
    nexthopType String
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName String
    The name of the route entry.
    routePublishTargets List<VPCRouteEntryRoutePublishTarget>
    Route publish status and publish target type See route_publish_targets below.
    routeTableId String
    Routing table ID
    status String
    The status of the route entry.
    description string
    Description of the route entry.
    destinationCidrBlock string
    The destination network segment of the routing entry.
    nextHops VPCRouteEntryNextHop[]
    Next jump See next_hops below.
    nexthopId string
    The ID of the next hop instance of the custom route entry.
    nexthopType string
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName string
    The name of the route entry.
    routePublishTargets VPCRouteEntryRoutePublishTarget[]
    Route publish status and publish target type See route_publish_targets below.
    routeTableId string
    Routing table ID
    status string
    The status of the route entry.
    description str
    Description of the route entry.
    destination_cidr_block str
    The destination network segment of the routing entry.
    next_hops Sequence[VPCRouteEntryNextHopArgs]
    Next jump See next_hops below.
    nexthop_id str
    The ID of the next hop instance of the custom route entry.
    nexthop_type str
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    route_entry_name str
    The name of the route entry.
    route_publish_targets Sequence[VPCRouteEntryRoutePublishTargetArgs]
    Route publish status and publish target type See route_publish_targets below.
    route_table_id str
    Routing table ID
    status str
    The status of the route entry.
    description String
    Description of the route entry.
    destinationCidrBlock String
    The destination network segment of the routing entry.
    nextHops List<Property Map>
    Next jump See next_hops below.
    nexthopId String
    The ID of the next hop instance of the custom route entry.
    nexthopType String
    The type of the next hop of the custom route entry. Valid values:

    • Instance (default): The ECS Instance.
    • HaVip: a highly available virtual IP address.
    • RouterInterface: indicates the router interface.
    • Network interface: ENI.
    • VpnGateway: the VPN gateway.
    • IPv6Gateway:IPv6 gateway.
    • NatGateway:NAT gateway.
    • Attachment: The forwarding router.
    • VpcPeer:VPC peer connection.
    • Ipv4Gateway:IPv4 Gateway.
    • GatewayEndpoint: the gateway endpoint.
    • Ecr: Leased line gateway.
    • GatewayLoadBalancerEndpoint: The Gateway-based load balancing endpoint.
    routeEntryName String
    The name of the route entry.
    routePublishTargets List<Property Map>
    Route publish status and publish target type See route_publish_targets below.
    routeTableId String
    Routing table ID
    status String
    The status of the route entry.

    Supporting Types

    VPCRouteEntryNextHop, VPCRouteEntryNextHopArgs

    Enabled int
    Whether the route is available.
    NextHopRegionId string
    The region of the next instance.
    NextHopRelatedInfo Pulumi.AliCloud.Vpc.Inputs.VPCRouteEntryNextHopNextHopRelatedInfo
    Next hop information.
    NexthopId string
    ID of next hop
    NexthopType string
    type of next hop
    Weight int
    The weight of the route entry.
    Enabled int
    Whether the route is available.
    NextHopRegionId string
    The region of the next instance.
    NextHopRelatedInfo VPCRouteEntryNextHopNextHopRelatedInfo
    Next hop information.
    NexthopId string
    ID of next hop
    NexthopType string
    type of next hop
    Weight int
    The weight of the route entry.
    enabled Integer
    Whether the route is available.
    nextHopRegionId String
    The region of the next instance.
    nextHopRelatedInfo VPCRouteEntryNextHopNextHopRelatedInfo
    Next hop information.
    nexthopId String
    ID of next hop
    nexthopType String
    type of next hop
    weight Integer
    The weight of the route entry.
    enabled number
    Whether the route is available.
    nextHopRegionId string
    The region of the next instance.
    nextHopRelatedInfo VPCRouteEntryNextHopNextHopRelatedInfo
    Next hop information.
    nexthopId string
    ID of next hop
    nexthopType string
    type of next hop
    weight number
    The weight of the route entry.
    enabled int
    Whether the route is available.
    next_hop_region_id str
    The region of the next instance.
    next_hop_related_info VPCRouteEntryNextHopNextHopRelatedInfo
    Next hop information.
    nexthop_id str
    ID of next hop
    nexthop_type str
    type of next hop
    weight int
    The weight of the route entry.
    enabled Number
    Whether the route is available.
    nextHopRegionId String
    The region of the next instance.
    nextHopRelatedInfo Property Map
    Next hop information.
    nexthopId String
    ID of next hop
    nexthopType String
    type of next hop
    weight Number
    The weight of the route entry.

    VPCRouteEntryNextHopNextHopRelatedInfo, VPCRouteEntryNextHopNextHopRelatedInfoArgs

    InstanceId string
    InstanceId
    InstanceType string
    InstanceType
    RegionId string
    The region of the instance associated with the next hop.
    InstanceId string
    InstanceId
    InstanceType string
    InstanceType
    RegionId string
    The region of the instance associated with the next hop.
    instanceId String
    InstanceId
    instanceType String
    InstanceType
    regionId String
    The region of the instance associated with the next hop.
    instanceId string
    InstanceId
    instanceType string
    InstanceType
    regionId string
    The region of the instance associated with the next hop.
    instance_id str
    InstanceId
    instance_type str
    InstanceType
    region_id str
    The region of the instance associated with the next hop.
    instanceId String
    InstanceId
    instanceType String
    InstanceType
    regionId String
    The region of the instance associated with the next hop.

    VPCRouteEntryRoutePublishTarget, VPCRouteEntryRoutePublishTargetArgs

    TargetType string
    Route publish target type
    PublishStatus string
    Route Publish Status
    TargetInstanceId string
    Route publish target instance id.
    TargetType string
    Route publish target type
    PublishStatus string
    Route Publish Status
    TargetInstanceId string
    Route publish target instance id.
    targetType String
    Route publish target type
    publishStatus String
    Route Publish Status
    targetInstanceId String
    Route publish target instance id.
    targetType string
    Route publish target type
    publishStatus string
    Route Publish Status
    targetInstanceId string
    Route publish target instance id.
    target_type str
    Route publish target type
    publish_status str
    Route Publish Status
    target_instance_id str
    Route publish target instance id.
    targetType String
    Route publish target type
    publishStatus String
    Route Publish Status
    targetInstanceId String
    Route publish target instance id.

    Import

    VPC Route Entry can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/vPCRouteEntry:VPCRouteEntry example <route_table_id>:<destination_cidr_block>
    

    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.
    alicloud logo
    Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi