1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpn
  5. getGatewayVcoRoutes
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

alicloud.vpn.getGatewayVcoRoutes

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

    This data source provides the Vpn Gateway Vco Routes of the current Alibaba Cloud user.

    NOTE: Available in v1.183.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var defaultInstance = new AliCloud.Cen.Instance("defaultInstance", new()
        {
            CenInstanceName = @var.Name,
        });
    
        var defaultTransitRouter = new AliCloud.Cen.TransitRouter("defaultTransitRouter", new()
        {
            CenId = defaultInstance.Id,
            TransitRouterDescription = "desd",
            TransitRouterName = @var.Name,
        });
    
        var defaultTransitRouterAvailableResources = AliCloud.Cen.GetTransitRouterAvailableResources.Invoke();
    
        var defaultCustomerGateway = new AliCloud.Vpn.CustomerGateway("defaultCustomerGateway", new()
        {
            IpAddress = "42.104.22.210",
            Asn = "45014",
            Description = "testAccVpnConnectionDesc",
        });
    
        var defaultGatewayVpnAttachment = new AliCloud.Vpn.GatewayVpnAttachment("defaultGatewayVpnAttachment", new()
        {
            CustomerGatewayId = defaultCustomerGateway.Id,
            NetworkType = "public",
            LocalSubnet = "0.0.0.0/0",
            RemoteSubnet = "0.0.0.0/0",
            EffectImmediately = false,
            IkeConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentIkeConfigArgs
            {
                IkeAuthAlg = "md5",
                IkeEncAlg = "des",
                IkeVersion = "ikev2",
                IkeMode = "main",
                IkeLifetime = 86400,
                Psk = "tf-testvpn2",
                IkePfs = "group1",
                RemoteId = "testbob2",
                LocalId = "testalice2",
            },
            IpsecConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentIpsecConfigArgs
            {
                IpsecPfs = "group5",
                IpsecEncAlg = "des",
                IpsecAuthAlg = "md5",
                IpsecLifetime = 86400,
            },
            BgpConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentBgpConfigArgs
            {
                Enable = true,
                LocalAsn = 45014,
                TunnelCidr = "169.254.11.0/30",
                LocalBgpIp = "169.254.11.1",
            },
            HealthCheckConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentHealthCheckConfigArgs
            {
                Enable = true,
                Sip = "192.168.1.1",
                Dip = "10.0.0.1",
                Interval = 10,
                Retry = 10,
                Policy = "revoke_route",
            },
            EnableDpd = true,
            EnableNatTraversal = true,
            VpnAttachmentName = @var.Name,
        });
    
        var defaultTransitRouterVpnAttachment = new AliCloud.Cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", new()
        {
            AutoPublishRouteEnabled = false,
            TransitRouterAttachmentDescription = @var.Name,
            TransitRouterAttachmentName = @var.Name,
            CenId = defaultTransitRouter.CenId,
            TransitRouterId = defaultTransitRouter.TransitRouterId,
            VpnId = defaultGatewayVpnAttachment.Id,
            Zones = new[]
            {
                new AliCloud.Cen.Inputs.TransitRouterVpnAttachmentZoneArgs
                {
                    ZoneId = defaultTransitRouterAvailableResources.Apply(getTransitRouterAvailableResourcesResult => getTransitRouterAvailableResourcesResult.Resources[0]?.MasterZones[0]),
                },
            },
        });
    
        var defaultGatewayVcoRoute = new AliCloud.Vpn.GatewayVcoRoute("defaultGatewayVcoRoute", new()
        {
            RouteDest = "192.168.12.0/24",
            NextHop = defaultTransitRouterVpnAttachment.VpnId,
            VpnConnectionId = defaultTransitRouterVpnAttachment.VpnId,
            Weight = 100,
        });
    
        var defaultGatewayVcoRoutes = AliCloud.Vpn.GetGatewayVcoRoutes.Invoke(new()
        {
            VpnConnectionId = defaultTransitRouterVpnAttachment.VpnId,
        });
    
        return new Dictionary<string, object?>
        {
            ["vpnGatewayVcoRouteId1"] = data.Alicloud_vpn_gateway_vco_routes.Ids.Routes[0].Id,
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", &cen.InstanceArgs{
    			CenInstanceName: pulumi.Any(_var.Name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultTransitRouter, err := cen.NewTransitRouter(ctx, "defaultTransitRouter", &cen.TransitRouterArgs{
    			CenId:                    defaultInstance.ID(),
    			TransitRouterDescription: pulumi.String("desd"),
    			TransitRouterName:        pulumi.Any(_var.Name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultTransitRouterAvailableResources, err := cen.GetTransitRouterAvailableResources(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultCustomerGateway, err := vpn.NewCustomerGateway(ctx, "defaultCustomerGateway", &vpn.CustomerGatewayArgs{
    			IpAddress:   pulumi.String("42.104.22.210"),
    			Asn:         pulumi.String("45014"),
    			Description: pulumi.String("testAccVpnConnectionDesc"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGatewayVpnAttachment, err := vpn.NewGatewayVpnAttachment(ctx, "defaultGatewayVpnAttachment", &vpn.GatewayVpnAttachmentArgs{
    			CustomerGatewayId: defaultCustomerGateway.ID(),
    			NetworkType:       pulumi.String("public"),
    			LocalSubnet:       pulumi.String("0.0.0.0/0"),
    			RemoteSubnet:      pulumi.String("0.0.0.0/0"),
    			EffectImmediately: pulumi.Bool(false),
    			IkeConfig: &vpn.GatewayVpnAttachmentIkeConfigArgs{
    				IkeAuthAlg:  pulumi.String("md5"),
    				IkeEncAlg:   pulumi.String("des"),
    				IkeVersion:  pulumi.String("ikev2"),
    				IkeMode:     pulumi.String("main"),
    				IkeLifetime: pulumi.Int(86400),
    				Psk:         pulumi.String("tf-testvpn2"),
    				IkePfs:      pulumi.String("group1"),
    				RemoteId:    pulumi.String("testbob2"),
    				LocalId:     pulumi.String("testalice2"),
    			},
    			IpsecConfig: &vpn.GatewayVpnAttachmentIpsecConfigArgs{
    				IpsecPfs:      pulumi.String("group5"),
    				IpsecEncAlg:   pulumi.String("des"),
    				IpsecAuthAlg:  pulumi.String("md5"),
    				IpsecLifetime: pulumi.Int(86400),
    			},
    			BgpConfig: &vpn.GatewayVpnAttachmentBgpConfigArgs{
    				Enable:     pulumi.Bool(true),
    				LocalAsn:   pulumi.Int(45014),
    				TunnelCidr: pulumi.String("169.254.11.0/30"),
    				LocalBgpIp: pulumi.String("169.254.11.1"),
    			},
    			HealthCheckConfig: &vpn.GatewayVpnAttachmentHealthCheckConfigArgs{
    				Enable:   pulumi.Bool(true),
    				Sip:      pulumi.String("192.168.1.1"),
    				Dip:      pulumi.String("10.0.0.1"),
    				Interval: pulumi.Int(10),
    				Retry:    pulumi.Int(10),
    				Policy:   pulumi.String("revoke_route"),
    			},
    			EnableDpd:          pulumi.Bool(true),
    			EnableNatTraversal: pulumi.Bool(true),
    			VpnAttachmentName:  pulumi.Any(_var.Name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultTransitRouterVpnAttachment, err := cen.NewTransitRouterVpnAttachment(ctx, "defaultTransitRouterVpnAttachment", &cen.TransitRouterVpnAttachmentArgs{
    			AutoPublishRouteEnabled:            pulumi.Bool(false),
    			TransitRouterAttachmentDescription: pulumi.Any(_var.Name),
    			TransitRouterAttachmentName:        pulumi.Any(_var.Name),
    			CenId:                              defaultTransitRouter.CenId,
    			TransitRouterId:                    defaultTransitRouter.TransitRouterId,
    			VpnId:                              defaultGatewayVpnAttachment.ID(),
    			Zones: cen.TransitRouterVpnAttachmentZoneArray{
    				&cen.TransitRouterVpnAttachmentZoneArgs{
    					ZoneId: *pulumi.String(defaultTransitRouterAvailableResources.Resources[0].MasterZones[0]),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpn.NewGatewayVcoRoute(ctx, "defaultGatewayVcoRoute", &vpn.GatewayVcoRouteArgs{
    			RouteDest:       pulumi.String("192.168.12.0/24"),
    			NextHop:         defaultTransitRouterVpnAttachment.VpnId,
    			VpnConnectionId: defaultTransitRouterVpnAttachment.VpnId,
    			Weight:          pulumi.Int(100),
    		})
    		if err != nil {
    			return err
    		}
    		_ = vpn.GetGatewayVcoRoutesOutput(ctx, vpn.GetGatewayVcoRoutesOutputArgs{
    			VpnConnectionId: defaultTransitRouterVpnAttachment.VpnId,
    		}, nil)
    		ctx.Export("vpnGatewayVcoRouteId1", data.Alicloud_vpn_gateway_vco_routes.Ids.Routes[0].Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cen.Instance;
    import com.pulumi.alicloud.cen.InstanceArgs;
    import com.pulumi.alicloud.cen.TransitRouter;
    import com.pulumi.alicloud.cen.TransitRouterArgs;
    import com.pulumi.alicloud.cen.CenFunctions;
    import com.pulumi.alicloud.cen.inputs.GetTransitRouterAvailableResourcesArgs;
    import com.pulumi.alicloud.vpn.CustomerGateway;
    import com.pulumi.alicloud.vpn.CustomerGatewayArgs;
    import com.pulumi.alicloud.vpn.GatewayVpnAttachment;
    import com.pulumi.alicloud.vpn.GatewayVpnAttachmentArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentIkeConfigArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentIpsecConfigArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentBgpConfigArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentHealthCheckConfigArgs;
    import com.pulumi.alicloud.cen.TransitRouterVpnAttachment;
    import com.pulumi.alicloud.cen.TransitRouterVpnAttachmentArgs;
    import com.pulumi.alicloud.cen.inputs.TransitRouterVpnAttachmentZoneArgs;
    import com.pulumi.alicloud.vpn.GatewayVcoRoute;
    import com.pulumi.alicloud.vpn.GatewayVcoRouteArgs;
    import com.pulumi.alicloud.vpn.VpnFunctions;
    import com.pulumi.alicloud.vpn.inputs.GetGatewayVcoRoutesArgs;
    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) {
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
                .cenInstanceName(var_.name())
                .build());
    
            var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()        
                .cenId(defaultInstance.id())
                .transitRouterDescription("desd")
                .transitRouterName(var_.name())
                .build());
    
            final var defaultTransitRouterAvailableResources = CenFunctions.getTransitRouterAvailableResources();
    
            var defaultCustomerGateway = new CustomerGateway("defaultCustomerGateway", CustomerGatewayArgs.builder()        
                .ipAddress("42.104.22.210")
                .asn("45014")
                .description("testAccVpnConnectionDesc")
                .build());
    
            var defaultGatewayVpnAttachment = new GatewayVpnAttachment("defaultGatewayVpnAttachment", GatewayVpnAttachmentArgs.builder()        
                .customerGatewayId(defaultCustomerGateway.id())
                .networkType("public")
                .localSubnet("0.0.0.0/0")
                .remoteSubnet("0.0.0.0/0")
                .effectImmediately(false)
                .ikeConfig(GatewayVpnAttachmentIkeConfigArgs.builder()
                    .ikeAuthAlg("md5")
                    .ikeEncAlg("des")
                    .ikeVersion("ikev2")
                    .ikeMode("main")
                    .ikeLifetime(86400)
                    .psk("tf-testvpn2")
                    .ikePfs("group1")
                    .remoteId("testbob2")
                    .localId("testalice2")
                    .build())
                .ipsecConfig(GatewayVpnAttachmentIpsecConfigArgs.builder()
                    .ipsecPfs("group5")
                    .ipsecEncAlg("des")
                    .ipsecAuthAlg("md5")
                    .ipsecLifetime(86400)
                    .build())
                .bgpConfig(GatewayVpnAttachmentBgpConfigArgs.builder()
                    .enable(true)
                    .localAsn(45014)
                    .tunnelCidr("169.254.11.0/30")
                    .localBgpIp("169.254.11.1")
                    .build())
                .healthCheckConfig(GatewayVpnAttachmentHealthCheckConfigArgs.builder()
                    .enable(true)
                    .sip("192.168.1.1")
                    .dip("10.0.0.1")
                    .interval(10)
                    .retry(10)
                    .policy("revoke_route")
                    .build())
                .enableDpd(true)
                .enableNatTraversal(true)
                .vpnAttachmentName(var_.name())
                .build());
    
            var defaultTransitRouterVpnAttachment = new TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", TransitRouterVpnAttachmentArgs.builder()        
                .autoPublishRouteEnabled(false)
                .transitRouterAttachmentDescription(var_.name())
                .transitRouterAttachmentName(var_.name())
                .cenId(defaultTransitRouter.cenId())
                .transitRouterId(defaultTransitRouter.transitRouterId())
                .vpnId(defaultGatewayVpnAttachment.id())
                .zones(TransitRouterVpnAttachmentZoneArgs.builder()
                    .zoneId(defaultTransitRouterAvailableResources.applyValue(getTransitRouterAvailableResourcesResult -> getTransitRouterAvailableResourcesResult.resources()[0].masterZones()[0]))
                    .build())
                .build());
    
            var defaultGatewayVcoRoute = new GatewayVcoRoute("defaultGatewayVcoRoute", GatewayVcoRouteArgs.builder()        
                .routeDest("192.168.12.0/24")
                .nextHop(defaultTransitRouterVpnAttachment.vpnId())
                .vpnConnectionId(defaultTransitRouterVpnAttachment.vpnId())
                .weight(100)
                .build());
    
            final var defaultGatewayVcoRoutes = VpnFunctions.getGatewayVcoRoutes(GetGatewayVcoRoutesArgs.builder()
                .vpnConnectionId(defaultTransitRouterVpnAttachment.vpnId())
                .build());
    
            ctx.export("vpnGatewayVcoRouteId1", data.alicloud_vpn_gateway_vco_routes().ids().routes()[0].id());
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name=var["name"])
    default_transit_router = alicloud.cen.TransitRouter("defaultTransitRouter",
        cen_id=default_instance.id,
        transit_router_description="desd",
        transit_router_name=var["name"])
    default_transit_router_available_resources = alicloud.cen.get_transit_router_available_resources()
    default_customer_gateway = alicloud.vpn.CustomerGateway("defaultCustomerGateway",
        ip_address="42.104.22.210",
        asn="45014",
        description="testAccVpnConnectionDesc")
    default_gateway_vpn_attachment = alicloud.vpn.GatewayVpnAttachment("defaultGatewayVpnAttachment",
        customer_gateway_id=default_customer_gateway.id,
        network_type="public",
        local_subnet="0.0.0.0/0",
        remote_subnet="0.0.0.0/0",
        effect_immediately=False,
        ike_config=alicloud.vpn.GatewayVpnAttachmentIkeConfigArgs(
            ike_auth_alg="md5",
            ike_enc_alg="des",
            ike_version="ikev2",
            ike_mode="main",
            ike_lifetime=86400,
            psk="tf-testvpn2",
            ike_pfs="group1",
            remote_id="testbob2",
            local_id="testalice2",
        ),
        ipsec_config=alicloud.vpn.GatewayVpnAttachmentIpsecConfigArgs(
            ipsec_pfs="group5",
            ipsec_enc_alg="des",
            ipsec_auth_alg="md5",
            ipsec_lifetime=86400,
        ),
        bgp_config=alicloud.vpn.GatewayVpnAttachmentBgpConfigArgs(
            enable=True,
            local_asn=45014,
            tunnel_cidr="169.254.11.0/30",
            local_bgp_ip="169.254.11.1",
        ),
        health_check_config=alicloud.vpn.GatewayVpnAttachmentHealthCheckConfigArgs(
            enable=True,
            sip="192.168.1.1",
            dip="10.0.0.1",
            interval=10,
            retry=10,
            policy="revoke_route",
        ),
        enable_dpd=True,
        enable_nat_traversal=True,
        vpn_attachment_name=var["name"])
    default_transit_router_vpn_attachment = alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment",
        auto_publish_route_enabled=False,
        transit_router_attachment_description=var["name"],
        transit_router_attachment_name=var["name"],
        cen_id=default_transit_router.cen_id,
        transit_router_id=default_transit_router.transit_router_id,
        vpn_id=default_gateway_vpn_attachment.id,
        zones=[alicloud.cen.TransitRouterVpnAttachmentZoneArgs(
            zone_id=default_transit_router_available_resources.resources[0].master_zones[0],
        )])
    default_gateway_vco_route = alicloud.vpn.GatewayVcoRoute("defaultGatewayVcoRoute",
        route_dest="192.168.12.0/24",
        next_hop=default_transit_router_vpn_attachment.vpn_id,
        vpn_connection_id=default_transit_router_vpn_attachment.vpn_id,
        weight=100)
    default_gateway_vco_routes = alicloud.vpn.get_gateway_vco_routes_output(vpn_connection_id=default_transit_router_vpn_attachment.vpn_id)
    pulumi.export("vpnGatewayVcoRouteId1", data["alicloud_vpn_gateway_vco_routes"]["ids"]["routes"][0]["id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const defaultInstance = new alicloud.cen.Instance("defaultInstance", {cenInstanceName: _var.name});
    const defaultTransitRouter = new alicloud.cen.TransitRouter("defaultTransitRouter", {
        cenId: defaultInstance.id,
        transitRouterDescription: "desd",
        transitRouterName: _var.name,
    });
    const defaultTransitRouterAvailableResources = alicloud.cen.getTransitRouterAvailableResources({});
    const defaultCustomerGateway = new alicloud.vpn.CustomerGateway("defaultCustomerGateway", {
        ipAddress: "42.104.22.210",
        asn: "45014",
        description: "testAccVpnConnectionDesc",
    });
    const defaultGatewayVpnAttachment = new alicloud.vpn.GatewayVpnAttachment("defaultGatewayVpnAttachment", {
        customerGatewayId: defaultCustomerGateway.id,
        networkType: "public",
        localSubnet: "0.0.0.0/0",
        remoteSubnet: "0.0.0.0/0",
        effectImmediately: false,
        ikeConfig: {
            ikeAuthAlg: "md5",
            ikeEncAlg: "des",
            ikeVersion: "ikev2",
            ikeMode: "main",
            ikeLifetime: 86400,
            psk: "tf-testvpn2",
            ikePfs: "group1",
            remoteId: "testbob2",
            localId: "testalice2",
        },
        ipsecConfig: {
            ipsecPfs: "group5",
            ipsecEncAlg: "des",
            ipsecAuthAlg: "md5",
            ipsecLifetime: 86400,
        },
        bgpConfig: {
            enable: true,
            localAsn: 45014,
            tunnelCidr: "169.254.11.0/30",
            localBgpIp: "169.254.11.1",
        },
        healthCheckConfig: {
            enable: true,
            sip: "192.168.1.1",
            dip: "10.0.0.1",
            interval: 10,
            retry: 10,
            policy: "revoke_route",
        },
        enableDpd: true,
        enableNatTraversal: true,
        vpnAttachmentName: _var.name,
    });
    const defaultTransitRouterVpnAttachment = new alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", {
        autoPublishRouteEnabled: false,
        transitRouterAttachmentDescription: _var.name,
        transitRouterAttachmentName: _var.name,
        cenId: defaultTransitRouter.cenId,
        transitRouterId: defaultTransitRouter.transitRouterId,
        vpnId: defaultGatewayVpnAttachment.id,
        zones: [{
            zoneId: defaultTransitRouterAvailableResources.then(defaultTransitRouterAvailableResources => defaultTransitRouterAvailableResources.resources?.[0]?.masterZones?.[0]),
        }],
    });
    const defaultGatewayVcoRoute = new alicloud.vpn.GatewayVcoRoute("defaultGatewayVcoRoute", {
        routeDest: "192.168.12.0/24",
        nextHop: defaultTransitRouterVpnAttachment.vpnId,
        vpnConnectionId: defaultTransitRouterVpnAttachment.vpnId,
        weight: 100,
    });
    const defaultGatewayVcoRoutes = alicloud.vpn.getGatewayVcoRoutesOutput({
        vpnConnectionId: defaultTransitRouterVpnAttachment.vpnId,
    });
    export const vpnGatewayVcoRouteId1 = data.alicloud_vpn_gateway_vco_routes.ids.routes[0].id;
    
    resources:
      defaultInstance:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: ${var.name}
      defaultTransitRouter:
        type: alicloud:cen:TransitRouter
        properties:
          cenId: ${defaultInstance.id}
          transitRouterDescription: desd
          transitRouterName: ${var.name}
      defaultCustomerGateway:
        type: alicloud:vpn:CustomerGateway
        properties:
          ipAddress: 42.104.22.210
          asn: '45014'
          description: testAccVpnConnectionDesc
      defaultGatewayVpnAttachment:
        type: alicloud:vpn:GatewayVpnAttachment
        properties:
          customerGatewayId: ${defaultCustomerGateway.id}
          networkType: public
          localSubnet: 0.0.0.0/0
          remoteSubnet: 0.0.0.0/0
          effectImmediately: false
          ikeConfig:
            ikeAuthAlg: md5
            ikeEncAlg: des
            ikeVersion: ikev2
            ikeMode: main
            ikeLifetime: 86400
            psk: tf-testvpn2
            ikePfs: group1
            remoteId: testbob2
            localId: testalice2
          ipsecConfig:
            ipsecPfs: group5
            ipsecEncAlg: des
            ipsecAuthAlg: md5
            ipsecLifetime: 86400
          bgpConfig:
            enable: true
            localAsn: 45014
            tunnelCidr: 169.254.11.0/30
            localBgpIp: 169.254.11.1
          healthCheckConfig:
            enable: true
            sip: 192.168.1.1
            dip: 10.0.0.1
            interval: 10
            retry: 10
            policy: revoke_route
          enableDpd: true
          enableNatTraversal: true
          vpnAttachmentName: ${var.name}
      defaultTransitRouterVpnAttachment:
        type: alicloud:cen:TransitRouterVpnAttachment
        properties:
          autoPublishRouteEnabled: false
          transitRouterAttachmentDescription: ${var.name}
          transitRouterAttachmentName: ${var.name}
          cenId: ${defaultTransitRouter.cenId}
          transitRouterId: ${defaultTransitRouter.transitRouterId}
          vpnId: ${defaultGatewayVpnAttachment.id}
          zones:
            - zoneId: ${defaultTransitRouterAvailableResources.resources[0].masterZones[0]}
      defaultGatewayVcoRoute:
        type: alicloud:vpn:GatewayVcoRoute
        properties:
          routeDest: 192.168.12.0/24
          nextHop: ${defaultTransitRouterVpnAttachment.vpnId}
          vpnConnectionId: ${defaultTransitRouterVpnAttachment.vpnId}
          weight: 100
    variables:
      defaultTransitRouterAvailableResources:
        fn::invoke:
          Function: alicloud:cen:getTransitRouterAvailableResources
          Arguments: {}
      defaultGatewayVcoRoutes:
        fn::invoke:
          Function: alicloud:vpn:getGatewayVcoRoutes
          Arguments:
            vpnConnectionId: ${defaultTransitRouterVpnAttachment.vpnId}
    outputs:
      vpnGatewayVcoRouteId1: ${data.alicloud_vpn_gateway_vco_routes.ids.routes[0].id}
    

    Using getGatewayVcoRoutes

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGatewayVcoRoutes(args: GetGatewayVcoRoutesArgs, opts?: InvokeOptions): Promise<GetGatewayVcoRoutesResult>
    function getGatewayVcoRoutesOutput(args: GetGatewayVcoRoutesOutputArgs, opts?: InvokeOptions): Output<GetGatewayVcoRoutesResult>
    def get_gateway_vco_routes(ids: Optional[Sequence[str]] = None,
                               output_file: Optional[str] = None,
                               page_number: Optional[int] = None,
                               page_size: Optional[int] = None,
                               route_entry_type: Optional[str] = None,
                               status: Optional[str] = None,
                               vpn_connection_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetGatewayVcoRoutesResult
    def get_gateway_vco_routes_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               output_file: Optional[pulumi.Input[str]] = None,
                               page_number: Optional[pulumi.Input[int]] = None,
                               page_size: Optional[pulumi.Input[int]] = None,
                               route_entry_type: Optional[pulumi.Input[str]] = None,
                               status: Optional[pulumi.Input[str]] = None,
                               vpn_connection_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetGatewayVcoRoutesResult]
    func GetGatewayVcoRoutes(ctx *Context, args *GetGatewayVcoRoutesArgs, opts ...InvokeOption) (*GetGatewayVcoRoutesResult, error)
    func GetGatewayVcoRoutesOutput(ctx *Context, args *GetGatewayVcoRoutesOutputArgs, opts ...InvokeOption) GetGatewayVcoRoutesResultOutput

    > Note: This function is named GetGatewayVcoRoutes in the Go SDK.

    public static class GetGatewayVcoRoutes 
    {
        public static Task<GetGatewayVcoRoutesResult> InvokeAsync(GetGatewayVcoRoutesArgs args, InvokeOptions? opts = null)
        public static Output<GetGatewayVcoRoutesResult> Invoke(GetGatewayVcoRoutesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGatewayVcoRoutesResult> getGatewayVcoRoutes(GetGatewayVcoRoutesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpn/getGatewayVcoRoutes:getGatewayVcoRoutes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    VpnConnectionId string
    The id of the vpn connection.
    Ids List<string>
    A list of Vco Route IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    RouteEntryType string
    The Routing input type. Valid values: custom, bgp.
    Status string
    The status of the vpn route entry.
    VpnConnectionId string
    The id of the vpn connection.
    Ids []string
    A list of Vco Route IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    RouteEntryType string
    The Routing input type. Valid values: custom, bgp.
    Status string
    The status of the vpn route entry.
    vpnConnectionId String
    The id of the vpn connection.
    ids List<String>
    A list of Vco Route IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    routeEntryType String
    The Routing input type. Valid values: custom, bgp.
    status String
    The status of the vpn route entry.
    vpnConnectionId string
    The id of the vpn connection.
    ids string[]
    A list of Vco Route IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    routeEntryType string
    The Routing input type. Valid values: custom, bgp.
    status string
    The status of the vpn route entry.
    vpn_connection_id str
    The id of the vpn connection.
    ids Sequence[str]
    A list of Vco Route IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    route_entry_type str
    The Routing input type. Valid values: custom, bgp.
    status str
    The status of the vpn route entry.
    vpnConnectionId String
    The id of the vpn connection.
    ids List<String>
    A list of Vco Route IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    routeEntryType String
    The Routing input type. Valid values: custom, bgp.
    status String
    The status of the vpn route entry.

    getGatewayVcoRoutes Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Routes List<Pulumi.AliCloud.Vpn.Outputs.GetGatewayVcoRoutesRoute>
    VpnConnectionId string
    OutputFile string
    PageNumber int
    PageSize int
    RouteEntryType string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Routes []GetGatewayVcoRoutesRoute
    VpnConnectionId string
    OutputFile string
    PageNumber int
    PageSize int
    RouteEntryType string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    routes List<GetGatewayVcoRoutesRoute>
    vpnConnectionId String
    outputFile String
    pageNumber Integer
    pageSize Integer
    routeEntryType String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    routes GetGatewayVcoRoutesRoute[]
    vpnConnectionId string
    outputFile string
    pageNumber number
    pageSize number
    routeEntryType string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    routes Sequence[GetGatewayVcoRoutesRoute]
    vpn_connection_id str
    output_file str
    page_number int
    page_size int
    route_entry_type str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    routes List<Property Map>
    vpnConnectionId String
    outputFile String
    pageNumber Number
    pageSize Number
    routeEntryType String
    status String

    Supporting Types

    GetGatewayVcoRoutesRoute

    AsPath string
    List of autonomous system numbers through which BGP routing entries pass.
    CreateTime string
    The creation time of the VPN destination route.
    Id string
    The ID of the Vpn Gateway Vco Routes.
    NextHop string
    The next hop of the destination route.
    RouteDest string
    The destination network segment of the destination route.
    Source string
    The source CIDR block of the destination route.
    Status string
    The status of the vpn route entry.
    VpnConnectionId string
    The id of the vpn connection.
    Weight int
    The weight value of the destination route.
    AsPath string
    List of autonomous system numbers through which BGP routing entries pass.
    CreateTime string
    The creation time of the VPN destination route.
    Id string
    The ID of the Vpn Gateway Vco Routes.
    NextHop string
    The next hop of the destination route.
    RouteDest string
    The destination network segment of the destination route.
    Source string
    The source CIDR block of the destination route.
    Status string
    The status of the vpn route entry.
    VpnConnectionId string
    The id of the vpn connection.
    Weight int
    The weight value of the destination route.
    asPath String
    List of autonomous system numbers through which BGP routing entries pass.
    createTime String
    The creation time of the VPN destination route.
    id String
    The ID of the Vpn Gateway Vco Routes.
    nextHop String
    The next hop of the destination route.
    routeDest String
    The destination network segment of the destination route.
    source String
    The source CIDR block of the destination route.
    status String
    The status of the vpn route entry.
    vpnConnectionId String
    The id of the vpn connection.
    weight Integer
    The weight value of the destination route.
    asPath string
    List of autonomous system numbers through which BGP routing entries pass.
    createTime string
    The creation time of the VPN destination route.
    id string
    The ID of the Vpn Gateway Vco Routes.
    nextHop string
    The next hop of the destination route.
    routeDest string
    The destination network segment of the destination route.
    source string
    The source CIDR block of the destination route.
    status string
    The status of the vpn route entry.
    vpnConnectionId string
    The id of the vpn connection.
    weight number
    The weight value of the destination route.
    as_path str
    List of autonomous system numbers through which BGP routing entries pass.
    create_time str
    The creation time of the VPN destination route.
    id str
    The ID of the Vpn Gateway Vco Routes.
    next_hop str
    The next hop of the destination route.
    route_dest str
    The destination network segment of the destination route.
    source str
    The source CIDR block of the destination route.
    status str
    The status of the vpn route entry.
    vpn_connection_id str
    The id of the vpn connection.
    weight int
    The weight value of the destination route.
    asPath String
    List of autonomous system numbers through which BGP routing entries pass.
    createTime String
    The creation time of the VPN destination route.
    id String
    The ID of the Vpn Gateway Vco Routes.
    nextHop String
    The next hop of the destination route.
    routeDest String
    The destination network segment of the destination route.
    source String
    The source CIDR block of the destination route.
    status String
    The status of the vpn route entry.
    vpnConnectionId String
    The id of the vpn connection.
    weight Number
    The weight value of the destination route.

    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.49.0 published on Sunday, Feb 4, 2024 by Pulumi