1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. RouteEntry
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.vpc.RouteEntry

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a route entry resource. A route entry represents a route item of one VPC route table.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultZones = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultInstanceTypes = defaultZones.then(defaultZones => alicloud.ecs.getInstanceTypes({
        availabilityZone: defaultZones.zones?.[0]?.id,
        cpuCoreCount: 1,
        memorySize: 2,
    }));
    const defaultImages = alicloud.ecs.getImages({
        nameRegex: "^ubuntu_18.*64",
        mostRecent: true,
        owners: "system",
    });
    const config = new pulumi.Config();
    const name = config.get("name") || "RouteEntryConfig";
    const fooNetwork = new alicloud.vpc.Network("fooNetwork", {
        vpcName: name,
        cidrBlock: "10.1.0.0/21",
    });
    const fooSwitch = new alicloud.vpc.Switch("fooSwitch", {
        vpcId: fooNetwork.id,
        cidrBlock: "10.1.1.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: name,
    });
    const tfTestFoo = new alicloud.ecs.SecurityGroup("tfTestFoo", {
        description: "foo",
        vpcId: fooNetwork.id,
    });
    const ingress = new alicloud.ecs.SecurityGroupRule("ingress", {
        type: "ingress",
        ipProtocol: "tcp",
        nicType: "intranet",
        policy: "accept",
        portRange: "22/22",
        priority: 1,
        securityGroupId: tfTestFoo.id,
        cidrIp: "0.0.0.0/0",
    });
    const fooInstance = new alicloud.ecs.Instance("fooInstance", {
        securityGroups: [tfTestFoo.id],
        vswitchId: fooSwitch.id,
        instanceChargeType: "PostPaid",
        instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.instanceTypes?.[0]?.id),
        internetChargeType: "PayByTraffic",
        internetMaxBandwidthOut: 5,
        systemDiskCategory: "cloud_efficiency",
        imageId: defaultImages.then(defaultImages => defaultImages.images?.[0]?.id),
        instanceName: name,
    });
    const fooRouteEntry = new alicloud.vpc.RouteEntry("fooRouteEntry", {
        routeTableId: fooNetwork.routeTableId,
        destinationCidrblock: "172.11.1.1/32",
        nexthopType: "Instance",
        nexthopId: fooInstance.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_zones = alicloud.get_zones(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(name_regex="^ubuntu_18.*64",
        most_recent=True,
        owners="system")
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "RouteEntryConfig"
    foo_network = alicloud.vpc.Network("fooNetwork",
        vpc_name=name,
        cidr_block="10.1.0.0/21")
    foo_switch = alicloud.vpc.Switch("fooSwitch",
        vpc_id=foo_network.id,
        cidr_block="10.1.1.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=name)
    tf_test_foo = alicloud.ecs.SecurityGroup("tfTestFoo",
        description="foo",
        vpc_id=foo_network.id)
    ingress = alicloud.ecs.SecurityGroupRule("ingress",
        type="ingress",
        ip_protocol="tcp",
        nic_type="intranet",
        policy="accept",
        port_range="22/22",
        priority=1,
        security_group_id=tf_test_foo.id,
        cidr_ip="0.0.0.0/0")
    foo_instance = alicloud.ecs.Instance("fooInstance",
        security_groups=[tf_test_foo.id],
        vswitch_id=foo_switch.id,
        instance_charge_type="PostPaid",
        instance_type=default_instance_types.instance_types[0].id,
        internet_charge_type="PayByTraffic",
        internet_max_bandwidth_out=5,
        system_disk_category="cloud_efficiency",
        image_id=default_images.images[0].id,
        instance_name=name)
    foo_route_entry = alicloud.vpc.RouteEntry("fooRouteEntry",
        route_table_id=foo_network.route_table_id,
        destination_cidrblock="172.11.1.1/32",
        nexthop_type="Instance",
        nexthop_id=foo_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 {
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
    			AvailabilityZone: pulumi.StringRef(defaultZones.Zones[0].Id),
    			CpuCoreCount:     pulumi.IntRef(1),
    			MemorySize:       pulumi.Float64Ref(2),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
    			NameRegex:  pulumi.StringRef("^ubuntu_18.*64"),
    			MostRecent: pulumi.BoolRef(true),
    			Owners:     pulumi.StringRef("system"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		cfg := config.New(ctx, "")
    		name := "RouteEntryConfig"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		fooNetwork, err := vpc.NewNetwork(ctx, "fooNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.1.0.0/21"),
    		})
    		if err != nil {
    			return err
    		}
    		fooSwitch, err := vpc.NewSwitch(ctx, "fooSwitch", &vpc.SwitchArgs{
    			VpcId:       fooNetwork.ID(),
    			CidrBlock:   pulumi.String("10.1.1.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		tfTestFoo, err := ecs.NewSecurityGroup(ctx, "tfTestFoo", &ecs.SecurityGroupArgs{
    			Description: pulumi.String("foo"),
    			VpcId:       fooNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewSecurityGroupRule(ctx, "ingress", &ecs.SecurityGroupRuleArgs{
    			Type:            pulumi.String("ingress"),
    			IpProtocol:      pulumi.String("tcp"),
    			NicType:         pulumi.String("intranet"),
    			Policy:          pulumi.String("accept"),
    			PortRange:       pulumi.String("22/22"),
    			Priority:        pulumi.Int(1),
    			SecurityGroupId: tfTestFoo.ID(),
    			CidrIp:          pulumi.String("0.0.0.0/0"),
    		})
    		if err != nil {
    			return err
    		}
    		fooInstance, err := ecs.NewInstance(ctx, "fooInstance", &ecs.InstanceArgs{
    			SecurityGroups: pulumi.StringArray{
    				tfTestFoo.ID(),
    			},
    			VswitchId:               fooSwitch.ID(),
    			InstanceChargeType:      pulumi.String("PostPaid"),
    			InstanceType:            pulumi.String(defaultInstanceTypes.InstanceTypes[0].Id),
    			InternetChargeType:      pulumi.String("PayByTraffic"),
    			InternetMaxBandwidthOut: pulumi.Int(5),
    			SystemDiskCategory:      pulumi.String("cloud_efficiency"),
    			ImageId:                 pulumi.String(defaultImages.Images[0].Id),
    			InstanceName:            pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewRouteEntry(ctx, "fooRouteEntry", &vpc.RouteEntryArgs{
    			RouteTableId:         fooNetwork.RouteTableId,
    			DestinationCidrblock: pulumi.String("172.11.1.1/32"),
    			NexthopType:          pulumi.String("Instance"),
    			NexthopId:            fooInstance.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 defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        {
            AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            CpuCoreCount = 1,
            MemorySize = 2,
        });
    
        var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
        {
            NameRegex = "^ubuntu_18.*64",
            MostRecent = true,
            Owners = "system",
        });
    
        var config = new Config();
        var name = config.Get("name") ?? "RouteEntryConfig";
        var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
        {
            VpcName = name,
            CidrBlock = "10.1.0.0/21",
        });
    
        var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new()
        {
            VpcId = fooNetwork.Id,
            CidrBlock = "10.1.1.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = name,
        });
    
        var tfTestFoo = new AliCloud.Ecs.SecurityGroup("tfTestFoo", new()
        {
            Description = "foo",
            VpcId = fooNetwork.Id,
        });
    
        var ingress = new AliCloud.Ecs.SecurityGroupRule("ingress", new()
        {
            Type = "ingress",
            IpProtocol = "tcp",
            NicType = "intranet",
            Policy = "accept",
            PortRange = "22/22",
            Priority = 1,
            SecurityGroupId = tfTestFoo.Id,
            CidrIp = "0.0.0.0/0",
        });
    
        var fooInstance = new AliCloud.Ecs.Instance("fooInstance", new()
        {
            SecurityGroups = new[]
            {
                tfTestFoo.Id,
            },
            VswitchId = fooSwitch.Id,
            InstanceChargeType = "PostPaid",
            InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
            InternetChargeType = "PayByTraffic",
            InternetMaxBandwidthOut = 5,
            SystemDiskCategory = "cloud_efficiency",
            ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
            InstanceName = name,
        });
    
        var fooRouteEntry = new AliCloud.Vpc.RouteEntry("fooRouteEntry", new()
        {
            RouteTableId = fooNetwork.RouteTableId,
            DestinationCidrblock = "172.11.1.1/32",
            NexthopType = "Instance",
            NexthopId = fooInstance.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.GetInstanceTypesArgs;
    import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
    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.SecurityGroupRule;
    import com.pulumi.alicloud.ecs.SecurityGroupRuleArgs;
    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 defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .cpuCoreCount(1)
                .memorySize(2)
                .build());
    
            final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
                .nameRegex("^ubuntu_18.*64")
                .mostRecent(true)
                .owners("system")
                .build());
    
            final var name = config.get("name").orElse("RouteEntryConfig");
            var fooNetwork = new Network("fooNetwork", NetworkArgs.builder()        
                .vpcName(name)
                .cidrBlock("10.1.0.0/21")
                .build());
    
            var fooSwitch = new Switch("fooSwitch", SwitchArgs.builder()        
                .vpcId(fooNetwork.id())
                .cidrBlock("10.1.1.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(name)
                .build());
    
            var tfTestFoo = new SecurityGroup("tfTestFoo", SecurityGroupArgs.builder()        
                .description("foo")
                .vpcId(fooNetwork.id())
                .build());
    
            var ingress = new SecurityGroupRule("ingress", SecurityGroupRuleArgs.builder()        
                .type("ingress")
                .ipProtocol("tcp")
                .nicType("intranet")
                .policy("accept")
                .portRange("22/22")
                .priority(1)
                .securityGroupId(tfTestFoo.id())
                .cidrIp("0.0.0.0/0")
                .build());
    
            var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
                .securityGroups(tfTestFoo.id())
                .vswitchId(fooSwitch.id())
                .instanceChargeType("PostPaid")
                .instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
                .internetChargeType("PayByTraffic")
                .internetMaxBandwidthOut(5)
                .systemDiskCategory("cloud_efficiency")
                .imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
                .instanceName(name)
                .build());
    
            var fooRouteEntry = new RouteEntry("fooRouteEntry", RouteEntryArgs.builder()        
                .routeTableId(fooNetwork.routeTableId())
                .destinationCidrblock("172.11.1.1/32")
                .nexthopType("Instance")
                .nexthopId(fooInstance.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: RouteEntryConfig
    resources:
      fooNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 10.1.0.0/21
      fooSwitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${fooNetwork.id}
          cidrBlock: 10.1.1.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${name}
      tfTestFoo:
        type: alicloud:ecs:SecurityGroup
        properties:
          description: foo
          vpcId: ${fooNetwork.id}
      ingress:
        type: alicloud:ecs:SecurityGroupRule
        properties:
          type: ingress
          ipProtocol: tcp
          nicType: intranet
          policy: accept
          portRange: 22/22
          priority: 1
          securityGroupId: ${tfTestFoo.id}
          cidrIp: 0.0.0.0/0
      fooInstance:
        type: alicloud:ecs:Instance
        properties:
          securityGroups:
            - ${tfTestFoo.id}
          vswitchId: ${fooSwitch.id}
          instanceChargeType: PostPaid
          instanceType: ${defaultInstanceTypes.instanceTypes[0].id}
          internetChargeType: PayByTraffic
          internetMaxBandwidthOut: 5
          systemDiskCategory: cloud_efficiency
          imageId: ${defaultImages.images[0].id}
          instanceName: ${name}
      fooRouteEntry:
        type: alicloud:vpc:RouteEntry
        properties:
          routeTableId: ${fooNetwork.routeTableId}
          destinationCidrblock: 172.11.1.1/32
          nexthopType: Instance
          nexthopId: ${fooInstance.id}
    variables:
      defaultZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
      defaultInstanceTypes:
        fn::invoke:
          Function: alicloud:ecs:getInstanceTypes
          Arguments:
            availabilityZone: ${defaultZones.zones[0].id}
            cpuCoreCount: 1
            memorySize: 2
      defaultImages:
        fn::invoke:
          Function: alicloud:ecs:getImages
          Arguments:
            nameRegex: ^ubuntu_18.*64
            mostRecent: true
            owners: system
    

    Module Support

    You can use to the existing vpc module to create a VPC, several VSwitches and add several route entries one-click.

    Create RouteEntry Resource

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

    Constructor syntax

    new RouteEntry(name: string, args: RouteEntryArgs, opts?: CustomResourceOptions);
    @overload
    def RouteEntry(resource_name: str,
                   args: RouteEntryArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def RouteEntry(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   route_table_id: Optional[str] = None,
                   destination_cidrblock: Optional[str] = None,
                   name: Optional[str] = None,
                   nexthop_id: Optional[str] = None,
                   nexthop_type: Optional[str] = None,
                   router_id: Optional[str] = None)
    func NewRouteEntry(ctx *Context, name string, args RouteEntryArgs, opts ...ResourceOption) (*RouteEntry, error)
    public RouteEntry(string name, RouteEntryArgs args, CustomResourceOptions? opts = null)
    public RouteEntry(String name, RouteEntryArgs args)
    public RouteEntry(String name, RouteEntryArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:RouteEntry
    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 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.
    args RouteEntryArgs
    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 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.
    name String
    The unique name of the resource.
    args RouteEntryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var alicloudRouteEntryResource = new AliCloud.Vpc.RouteEntry("alicloudRouteEntryResource", new()
    {
        RouteTableId = "string",
        DestinationCidrblock = "string",
        Name = "string",
        NexthopId = "string",
        NexthopType = "string",
    });
    
    example, err := vpc.NewRouteEntry(ctx, "alicloudRouteEntryResource", &vpc.RouteEntryArgs{
    	RouteTableId:         pulumi.String("string"),
    	DestinationCidrblock: pulumi.String("string"),
    	Name:                 pulumi.String("string"),
    	NexthopId:            pulumi.String("string"),
    	NexthopType:          pulumi.String("string"),
    })
    
    var alicloudRouteEntryResource = new RouteEntry("alicloudRouteEntryResource", RouteEntryArgs.builder()        
        .routeTableId("string")
        .destinationCidrblock("string")
        .name("string")
        .nexthopId("string")
        .nexthopType("string")
        .build());
    
    alicloud_route_entry_resource = alicloud.vpc.RouteEntry("alicloudRouteEntryResource",
        route_table_id="string",
        destination_cidrblock="string",
        name="string",
        nexthop_id="string",
        nexthop_type="string")
    
    const alicloudRouteEntryResource = new alicloud.vpc.RouteEntry("alicloudRouteEntryResource", {
        routeTableId: "string",
        destinationCidrblock: "string",
        name: "string",
        nexthopId: "string",
        nexthopType: "string",
    });
    
    type: alicloud:vpc:RouteEntry
    properties:
        destinationCidrblock: string
        name: string
        nexthopId: string
        nexthopType: string
        routeTableId: string
    

    RouteEntry 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 RouteEntry resource accepts the following input properties:

    RouteTableId string
    The ID of the route table.
    DestinationCidrblock string
    The RouteEntry's target network segment.
    Name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    NexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    NexthopType string
    The next hop type. Available values:
    RouterId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    RouteTableId string
    The ID of the route table.
    DestinationCidrblock string
    The RouteEntry's target network segment.
    Name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    NexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    NexthopType string
    The next hop type. Available values:
    RouterId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    routeTableId String
    The ID of the route table.
    destinationCidrblock String
    The RouteEntry's target network segment.
    name String
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId String
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType String
    The next hop type. Available values:
    routerId String
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    routeTableId string
    The ID of the route table.
    destinationCidrblock string
    The RouteEntry's target network segment.
    name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType string
    The next hop type. Available values:
    routerId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    route_table_id str
    The ID of the route table.
    destination_cidrblock str
    The RouteEntry's target network segment.
    name str
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthop_id str
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthop_type str
    The next hop type. Available values:
    router_id str
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    routeTableId String
    The ID of the route table.
    destinationCidrblock String
    The RouteEntry's target network segment.
    name String
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId String
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType String
    The next hop type. Available values:
    routerId String
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            destination_cidrblock: Optional[str] = None,
            name: Optional[str] = None,
            nexthop_id: Optional[str] = None,
            nexthop_type: Optional[str] = None,
            route_table_id: Optional[str] = None,
            router_id: Optional[str] = None) -> RouteEntry
    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)
    public static RouteEntry get(String name, Output<String> id, RouteEntryState 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.
    The following state arguments are supported:
    DestinationCidrblock string
    The RouteEntry's target network segment.
    Name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    NexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    NexthopType string
    The next hop type. Available values:
    RouteTableId string
    The ID of the route table.
    RouterId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    DestinationCidrblock string
    The RouteEntry's target network segment.
    Name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    NexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    NexthopType string
    The next hop type. Available values:
    RouteTableId string
    The ID of the route table.
    RouterId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    destinationCidrblock String
    The RouteEntry's target network segment.
    name String
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId String
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType String
    The next hop type. Available values:
    routeTableId String
    The ID of the route table.
    routerId String
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    destinationCidrblock string
    The RouteEntry's target network segment.
    name string
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId string
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType string
    The next hop type. Available values:
    routeTableId string
    The ID of the route table.
    routerId string
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    destination_cidrblock str
    The RouteEntry's target network segment.
    name str
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthop_id str
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthop_type str
    The next hop type. Available values:
    route_table_id str
    The ID of the route table.
    router_id str
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    destinationCidrblock String
    The RouteEntry's target network segment.
    name String
    The name of the route entry. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://.
    nexthopId String
    The route entry's next hop. ECS instance ID or VPC router interface ID.
    nexthopType String
    The next hop type. Available values:
    routeTableId String
    The ID of the route table.
    routerId String
    This argument has been deprecated. Please use other arguments to launch a custom route entry.

    Deprecated: Attribute router_id has been deprecated and suggest removing it from your template.

    Import

    Router entry can be imported using the id, e.g (formatted as<route_table_id:router_id:destination_cidrblock:nexthop_type:nexthop_id>).

    $ pulumi import alicloud:vpc/routeEntry:RouteEntry example vtb-123456:vrt-123456:0.0.0.0/0:NatGateway:ngw-123456
    

    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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi