alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cen.TransitRouterVpnAttachment

Provides a Cloud Enterprise Network (CEN) Transit Router Vpn Attachment resource.

For information about Cloud Enterprise Network (CEN) Transit Router Vpn Attachment and how to use it, see What is Transit Router Vpn Attachment.

NOTE: Available in v1.183.0+.

Example Usage

Basic Example

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultTransitRouterAvailableResources = AliCloud.Cen.GetTransitRouterAvailableResources.Invoke();

    var defaultInstance = new AliCloud.Cen.Instance("defaultInstance", new()
    {
        CenInstanceName = "tf-example",
    });

    var defaultTransitRouter = new AliCloud.Cen.TransitRouter("defaultTransitRouter", new()
    {
        CenId = defaultInstance.Id,
        TransitRouterDescription = "tf-example-description",
        TransitRouterName = "tf-example-name",
    });

    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 = "tf-example-name",
    });

    var defaultTransitRouterVpnAttachment = new AliCloud.Cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", new()
    {
        AutoPublishRouteEnabled = false,
        TransitRouterAttachmentDescription = "tf-example-description",
        TransitRouterAttachmentName = "tf-example-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]),
            },
        },
    });

});
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 {
		defaultTransitRouterAvailableResources, err := cen.GetTransitRouterAvailableResources(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", &cen.InstanceArgs{
			CenInstanceName: pulumi.String("tf-example"),
		})
		if err != nil {
			return err
		}
		defaultTransitRouter, err := cen.NewTransitRouter(ctx, "defaultTransitRouter", &cen.TransitRouterArgs{
			CenId:                    defaultInstance.ID(),
			TransitRouterDescription: pulumi.String("tf-example-description"),
			TransitRouterName:        pulumi.String("tf-example-name"),
		})
		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.String("tf-example-name"),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterVpnAttachment(ctx, "defaultTransitRouterVpnAttachment", &cen.TransitRouterVpnAttachmentArgs{
			AutoPublishRouteEnabled:            pulumi.Bool(false),
			TransitRouterAttachmentDescription: pulumi.String("tf-example-description"),
			TransitRouterAttachmentName:        pulumi.String("tf-example-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
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.CenFunctions;
import com.pulumi.alicloud.cen.inputs.GetTransitRouterAvailableResourcesArgs;
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.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 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 defaultTransitRouterAvailableResources = CenFunctions.getTransitRouterAvailableResources();

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
            .cenInstanceName("tf-example")
            .build());

        var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()        
            .cenId(defaultInstance.id())
            .transitRouterDescription("tf-example-description")
            .transitRouterName("tf-example-name")
            .build());

        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("tf-example-name")
            .build());

        var defaultTransitRouterVpnAttachment = new TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", TransitRouterVpnAttachmentArgs.builder()        
            .autoPublishRouteEnabled(false)
            .transitRouterAttachmentDescription("tf-example-description")
            .transitRouterAttachmentName("tf-example-name")
            .cenId(defaultTransitRouter.cenId())
            .transitRouterId(defaultTransitRouter.transitRouterId())
            .vpnId(defaultGatewayVpnAttachment.id())
            .zones(TransitRouterVpnAttachmentZoneArgs.builder()
                .zoneId(defaultTransitRouterAvailableResources.applyValue(getTransitRouterAvailableResourcesResult -> getTransitRouterAvailableResourcesResult.resources()[0].masterZones()[0]))
                .build())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_transit_router_available_resources = alicloud.cen.get_transit_router_available_resources()
default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name="tf-example")
default_transit_router = alicloud.cen.TransitRouter("defaultTransitRouter",
    cen_id=default_instance.id,
    transit_router_description="tf-example-description",
    transit_router_name="tf-example-name")
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="tf-example-name")
default_transit_router_vpn_attachment = alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment",
    auto_publish_route_enabled=False,
    transit_router_attachment_description="tf-example-description",
    transit_router_attachment_name="tf-example-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],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultTransitRouterAvailableResources = alicloud.cen.getTransitRouterAvailableResources({});
const defaultInstance = new alicloud.cen.Instance("defaultInstance", {cenInstanceName: "tf-example"});
const defaultTransitRouter = new alicloud.cen.TransitRouter("defaultTransitRouter", {
    cenId: defaultInstance.id,
    transitRouterDescription: "tf-example-description",
    transitRouterName: "tf-example-name",
});
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: "tf-example-name",
});
const defaultTransitRouterVpnAttachment = new alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", {
    autoPublishRouteEnabled: false,
    transitRouterAttachmentDescription: "tf-example-description",
    transitRouterAttachmentName: "tf-example-name",
    cenId: defaultTransitRouter.cenId,
    transitRouterId: defaultTransitRouter.transitRouterId,
    vpnId: defaultGatewayVpnAttachment.id,
    zones: [{
        zoneId: defaultTransitRouterAvailableResources.then(defaultTransitRouterAvailableResources => defaultTransitRouterAvailableResources.resources?.[0]?.masterZones?.[0]),
    }],
});
resources:
  defaultInstance:
    type: alicloud:cen:Instance
    properties:
      cenInstanceName: tf-example
  defaultTransitRouter:
    type: alicloud:cen:TransitRouter
    properties:
      cenId: ${defaultInstance.id}
      transitRouterDescription: tf-example-description
      transitRouterName: tf-example-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: tf-example-name
  defaultTransitRouterVpnAttachment:
    type: alicloud:cen:TransitRouterVpnAttachment
    properties:
      autoPublishRouteEnabled: false
      transitRouterAttachmentDescription: tf-example-description
      transitRouterAttachmentName: tf-example-name
      cenId: ${defaultTransitRouter.cenId}
      transitRouterId: ${defaultTransitRouter.transitRouterId}
      vpnId: ${defaultGatewayVpnAttachment.id}
      zones:
        - zoneId: ${defaultTransitRouterAvailableResources.resources[0].masterZones[0]}
variables:
  defaultTransitRouterAvailableResources:
    fn::invoke:
      Function: alicloud:cen:getTransitRouterAvailableResources
      Arguments: {}

Example Create a Transit Router Vpn Attachment with Transit Router Cidr

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultTransitRouterAvailableResources = AliCloud.Cen.GetTransitRouterAvailableResources.Invoke();

    var defaultInstance = new AliCloud.Cen.Instance("defaultInstance", new()
    {
        CenInstanceName = "tf-example",
    });

    var defaultTransitRouter = new AliCloud.Cen.TransitRouter("defaultTransitRouter", new()
    {
        CenId = defaultInstance.Id,
    });

    var defaultTransitRouterCidr = new AliCloud.Cen.TransitRouterCidr("defaultTransitRouterCidr", new()
    {
        TransitRouterId = defaultTransitRouter.TransitRouterId,
        Cidr = "192.168.0.0/16",
        TransitRouterCidrName = "tf-example-name",
        Description = "tf-example-description",
        PublishCidrRoute = true,
    });

    var defaultCustomerGateway = new AliCloud.Vpn.CustomerGateway("defaultCustomerGateway", new()
    {
        IpAddress = "42.104.22.210",
        Asn = "45014",
    });

    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 = "tf-example-name",
    });

    var defaultTransitRouterVpnAttachment = new AliCloud.Cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", new()
    {
        AutoPublishRouteEnabled = false,
        TransitRouterAttachmentDescription = "tf-example-description",
        TransitRouterAttachmentName = "tf-example-name",
        CenId = defaultTransitRouter.CenId,
        TransitRouterId = defaultTransitRouterCidr.TransitRouterId,
        VpnId = defaultGatewayVpnAttachment.Id,
        Zones = new[]
        {
            new AliCloud.Cen.Inputs.TransitRouterVpnAttachmentZoneArgs
            {
                ZoneId = defaultTransitRouterAvailableResources.Apply(getTransitRouterAvailableResourcesResult => getTransitRouterAvailableResourcesResult.Resources[0]?.MasterZones[0]),
            },
        },
    });

});
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 {
		defaultTransitRouterAvailableResources, err := cen.GetTransitRouterAvailableResources(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", &cen.InstanceArgs{
			CenInstanceName: pulumi.String("tf-example"),
		})
		if err != nil {
			return err
		}
		defaultTransitRouter, err := cen.NewTransitRouter(ctx, "defaultTransitRouter", &cen.TransitRouterArgs{
			CenId: defaultInstance.ID(),
		})
		if err != nil {
			return err
		}
		defaultTransitRouterCidr, err := cen.NewTransitRouterCidr(ctx, "defaultTransitRouterCidr", &cen.TransitRouterCidrArgs{
			TransitRouterId:       defaultTransitRouter.TransitRouterId,
			Cidr:                  pulumi.String("192.168.0.0/16"),
			TransitRouterCidrName: pulumi.String("tf-example-name"),
			Description:           pulumi.String("tf-example-description"),
			PublishCidrRoute:      pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		defaultCustomerGateway, err := vpn.NewCustomerGateway(ctx, "defaultCustomerGateway", &vpn.CustomerGatewayArgs{
			IpAddress: pulumi.String("42.104.22.210"),
			Asn:       pulumi.String("45014"),
		})
		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.String("tf-example-name"),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterVpnAttachment(ctx, "defaultTransitRouterVpnAttachment", &cen.TransitRouterVpnAttachmentArgs{
			AutoPublishRouteEnabled:            pulumi.Bool(false),
			TransitRouterAttachmentDescription: pulumi.String("tf-example-description"),
			TransitRouterAttachmentName:        pulumi.String("tf-example-name"),
			CenId:                              defaultTransitRouter.CenId,
			TransitRouterId:                    defaultTransitRouterCidr.TransitRouterId,
			VpnId:                              defaultGatewayVpnAttachment.ID(),
			Zones: cen.TransitRouterVpnAttachmentZoneArray{
				&cen.TransitRouterVpnAttachmentZoneArgs{
					ZoneId: *pulumi.String(defaultTransitRouterAvailableResources.Resources[0].MasterZones[0]),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.CenFunctions;
import com.pulumi.alicloud.cen.inputs.GetTransitRouterAvailableResourcesArgs;
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.TransitRouterCidr;
import com.pulumi.alicloud.cen.TransitRouterCidrArgs;
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 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 defaultTransitRouterAvailableResources = CenFunctions.getTransitRouterAvailableResources();

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
            .cenInstanceName("tf-example")
            .build());

        var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()        
            .cenId(defaultInstance.id())
            .build());

        var defaultTransitRouterCidr = new TransitRouterCidr("defaultTransitRouterCidr", TransitRouterCidrArgs.builder()        
            .transitRouterId(defaultTransitRouter.transitRouterId())
            .cidr("192.168.0.0/16")
            .transitRouterCidrName("tf-example-name")
            .description("tf-example-description")
            .publishCidrRoute(true)
            .build());

        var defaultCustomerGateway = new CustomerGateway("defaultCustomerGateway", CustomerGatewayArgs.builder()        
            .ipAddress("42.104.22.210")
            .asn("45014")
            .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("tf-example-name")
            .build());

        var defaultTransitRouterVpnAttachment = new TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", TransitRouterVpnAttachmentArgs.builder()        
            .autoPublishRouteEnabled(false)
            .transitRouterAttachmentDescription("tf-example-description")
            .transitRouterAttachmentName("tf-example-name")
            .cenId(defaultTransitRouter.cenId())
            .transitRouterId(defaultTransitRouterCidr.transitRouterId())
            .vpnId(defaultGatewayVpnAttachment.id())
            .zones(TransitRouterVpnAttachmentZoneArgs.builder()
                .zoneId(defaultTransitRouterAvailableResources.applyValue(getTransitRouterAvailableResourcesResult -> getTransitRouterAvailableResourcesResult.resources()[0].masterZones()[0]))
                .build())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_transit_router_available_resources = alicloud.cen.get_transit_router_available_resources()
default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name="tf-example")
default_transit_router = alicloud.cen.TransitRouter("defaultTransitRouter", cen_id=default_instance.id)
default_transit_router_cidr = alicloud.cen.TransitRouterCidr("defaultTransitRouterCidr",
    transit_router_id=default_transit_router.transit_router_id,
    cidr="192.168.0.0/16",
    transit_router_cidr_name="tf-example-name",
    description="tf-example-description",
    publish_cidr_route=True)
default_customer_gateway = alicloud.vpn.CustomerGateway("defaultCustomerGateway",
    ip_address="42.104.22.210",
    asn="45014")
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="tf-example-name")
default_transit_router_vpn_attachment = alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment",
    auto_publish_route_enabled=False,
    transit_router_attachment_description="tf-example-description",
    transit_router_attachment_name="tf-example-name",
    cen_id=default_transit_router.cen_id,
    transit_router_id=default_transit_router_cidr.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],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultTransitRouterAvailableResources = alicloud.cen.getTransitRouterAvailableResources({});
const defaultInstance = new alicloud.cen.Instance("defaultInstance", {cenInstanceName: "tf-example"});
const defaultTransitRouter = new alicloud.cen.TransitRouter("defaultTransitRouter", {cenId: defaultInstance.id});
const defaultTransitRouterCidr = new alicloud.cen.TransitRouterCidr("defaultTransitRouterCidr", {
    transitRouterId: defaultTransitRouter.transitRouterId,
    cidr: "192.168.0.0/16",
    transitRouterCidrName: "tf-example-name",
    description: "tf-example-description",
    publishCidrRoute: true,
});
const defaultCustomerGateway = new alicloud.vpn.CustomerGateway("defaultCustomerGateway", {
    ipAddress: "42.104.22.210",
    asn: "45014",
});
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: "tf-example-name",
});
const defaultTransitRouterVpnAttachment = new alicloud.cen.TransitRouterVpnAttachment("defaultTransitRouterVpnAttachment", {
    autoPublishRouteEnabled: false,
    transitRouterAttachmentDescription: "tf-example-description",
    transitRouterAttachmentName: "tf-example-name",
    cenId: defaultTransitRouter.cenId,
    transitRouterId: defaultTransitRouterCidr.transitRouterId,
    vpnId: defaultGatewayVpnAttachment.id,
    zones: [{
        zoneId: defaultTransitRouterAvailableResources.then(defaultTransitRouterAvailableResources => defaultTransitRouterAvailableResources.resources?.[0]?.masterZones?.[0]),
    }],
});
resources:
  defaultInstance:
    type: alicloud:cen:Instance
    properties:
      cenInstanceName: tf-example
  defaultTransitRouter:
    type: alicloud:cen:TransitRouter
    properties:
      cenId: ${defaultInstance.id}
  defaultTransitRouterCidr:
    type: alicloud:cen:TransitRouterCidr
    properties:
      transitRouterId: ${defaultTransitRouter.transitRouterId}
      cidr: 192.168.0.0/16
      transitRouterCidrName: tf-example-name
      description: tf-example-description
      publishCidrRoute: true
  defaultCustomerGateway:
    type: alicloud:vpn:CustomerGateway
    properties:
      ipAddress: 42.104.22.210
      asn: '45014'
  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: tf-example-name
  defaultTransitRouterVpnAttachment:
    type: alicloud:cen:TransitRouterVpnAttachment
    properties:
      autoPublishRouteEnabled: false
      transitRouterAttachmentDescription: tf-example-description
      transitRouterAttachmentName: tf-example-name
      cenId: ${defaultTransitRouter.cenId}
      transitRouterId: ${defaultTransitRouterCidr.transitRouterId}
      vpnId: ${defaultGatewayVpnAttachment.id}
      zones:
        - zoneId: ${defaultTransitRouterAvailableResources.resources[0].masterZones[0]}
variables:
  defaultTransitRouterAvailableResources:
    fn::invoke:
      Function: alicloud:cen:getTransitRouterAvailableResources
      Arguments: {}

Create TransitRouterVpnAttachment Resource

new TransitRouterVpnAttachment(name: string, args: TransitRouterVpnAttachmentArgs, opts?: CustomResourceOptions);
@overload
def TransitRouterVpnAttachment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               auto_publish_route_enabled: Optional[bool] = None,
                               cen_id: Optional[str] = None,
                               tags: Optional[Mapping[str, Any]] = None,
                               transit_router_attachment_description: Optional[str] = None,
                               transit_router_attachment_name: Optional[str] = None,
                               transit_router_id: Optional[str] = None,
                               vpn_id: Optional[str] = None,
                               vpn_owner_id: Optional[str] = None,
                               zones: Optional[Sequence[TransitRouterVpnAttachmentZoneArgs]] = None)
@overload
def TransitRouterVpnAttachment(resource_name: str,
                               args: TransitRouterVpnAttachmentArgs,
                               opts: Optional[ResourceOptions] = None)
func NewTransitRouterVpnAttachment(ctx *Context, name string, args TransitRouterVpnAttachmentArgs, opts ...ResourceOption) (*TransitRouterVpnAttachment, error)
public TransitRouterVpnAttachment(string name, TransitRouterVpnAttachmentArgs args, CustomResourceOptions? opts = null)
public TransitRouterVpnAttachment(String name, TransitRouterVpnAttachmentArgs args)
public TransitRouterVpnAttachment(String name, TransitRouterVpnAttachmentArgs args, CustomResourceOptions options)
type: alicloud:cen:TransitRouterVpnAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args TransitRouterVpnAttachmentArgs
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 TransitRouterVpnAttachmentArgs
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 TransitRouterVpnAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TransitRouterVpnAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args TransitRouterVpnAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

TransitRouterId string

The ID of the forwarding router instance.

VpnId string

The id of the vpn.

Zones List<Pulumi.AliCloud.Cen.Inputs.TransitRouterVpnAttachmentZoneArgs>

The list of zone mapping. See the following Block zone.

AutoPublishRouteEnabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

CenId string

The id of the cen.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

TransitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

TransitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

VpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

TransitRouterId string

The ID of the forwarding router instance.

VpnId string

The id of the vpn.

Zones []TransitRouterVpnAttachmentZoneArgs

The list of zone mapping. See the following Block zone.

AutoPublishRouteEnabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

CenId string

The id of the cen.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

TransitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

TransitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

VpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

transitRouterId String

The ID of the forwarding router instance.

vpnId String

The id of the vpn.

zones List<TransitRouterVpnAttachmentZoneArgs>

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled Boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId String

The id of the cen.

tags Map<String,Object>

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription String

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName String

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

vpnOwnerId String

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

transitRouterId string

The ID of the forwarding router instance.

vpnId string

The id of the vpn.

zones TransitRouterVpnAttachmentZoneArgs[]

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId string

The id of the cen.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

vpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

transit_router_id str

The ID of the forwarding router instance.

vpn_id str

The id of the vpn.

zones Sequence[TransitRouterVpnAttachmentZoneArgs]

The list of zone mapping. See the following Block zone.

auto_publish_route_enabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cen_id str

The id of the cen.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

transit_router_attachment_description str

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transit_router_attachment_name str

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

vpn_owner_id str

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

transitRouterId String

The ID of the forwarding router instance.

vpnId String

The id of the vpn.

zones List<Property Map>

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled Boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId String

The id of the cen.

tags Map<Any>

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription String

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName String

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

vpnOwnerId String

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The associating status of the network.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The associating status of the network.

id String

The provider-assigned unique ID for this managed resource.

status String

The associating status of the network.

id string

The provider-assigned unique ID for this managed resource.

status string

The associating status of the network.

id str

The provider-assigned unique ID for this managed resource.

status str

The associating status of the network.

id String

The provider-assigned unique ID for this managed resource.

status String

The associating status of the network.

Look up Existing TransitRouterVpnAttachment Resource

Get an existing TransitRouterVpnAttachment 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?: TransitRouterVpnAttachmentState, opts?: CustomResourceOptions): TransitRouterVpnAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_publish_route_enabled: Optional[bool] = None,
        cen_id: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, Any]] = None,
        transit_router_attachment_description: Optional[str] = None,
        transit_router_attachment_name: Optional[str] = None,
        transit_router_id: Optional[str] = None,
        vpn_id: Optional[str] = None,
        vpn_owner_id: Optional[str] = None,
        zones: Optional[Sequence[TransitRouterVpnAttachmentZoneArgs]] = None) -> TransitRouterVpnAttachment
func GetTransitRouterVpnAttachment(ctx *Context, name string, id IDInput, state *TransitRouterVpnAttachmentState, opts ...ResourceOption) (*TransitRouterVpnAttachment, error)
public static TransitRouterVpnAttachment Get(string name, Input<string> id, TransitRouterVpnAttachmentState? state, CustomResourceOptions? opts = null)
public static TransitRouterVpnAttachment get(String name, Output<String> id, TransitRouterVpnAttachmentState 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:
AutoPublishRouteEnabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

CenId string

The id of the cen.

Status string

The associating status of the network.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

TransitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

TransitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

TransitRouterId string

The ID of the forwarding router instance.

VpnId string

The id of the vpn.

VpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

Zones List<Pulumi.AliCloud.Cen.Inputs.TransitRouterVpnAttachmentZoneArgs>

The list of zone mapping. See the following Block zone.

AutoPublishRouteEnabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

CenId string

The id of the cen.

Status string

The associating status of the network.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

TransitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

TransitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

TransitRouterId string

The ID of the forwarding router instance.

VpnId string

The id of the vpn.

VpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

Zones []TransitRouterVpnAttachmentZoneArgs

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled Boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId String

The id of the cen.

status String

The associating status of the network.

tags Map<String,Object>

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription String

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName String

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

transitRouterId String

The ID of the forwarding router instance.

vpnId String

The id of the vpn.

vpnOwnerId String

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

zones List<TransitRouterVpnAttachmentZoneArgs>

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId string

The id of the cen.

status string

The associating status of the network.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription string

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName string

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

transitRouterId string

The ID of the forwarding router instance.

vpnId string

The id of the vpn.

vpnOwnerId string

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

zones TransitRouterVpnAttachmentZoneArgs[]

The list of zone mapping. See the following Block zone.

auto_publish_route_enabled bool

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cen_id str

The id of the cen.

status str

The associating status of the network.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

transit_router_attachment_description str

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transit_router_attachment_name str

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

transit_router_id str

The ID of the forwarding router instance.

vpn_id str

The id of the vpn.

vpn_owner_id str

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

zones Sequence[TransitRouterVpnAttachmentZoneArgs]

The list of zone mapping. See the following Block zone.

autoPublishRouteEnabled Boolean

Whether to allow the forwarding router instance to automatically publish routing entries to IPsec connections.

cenId String

The id of the cen.

status String

The associating status of the network.

tags Map<Any>

A mapping of tags to assign to the resource.

transitRouterAttachmentDescription String

The description of the VPN connection. The description can contain 2 to 256 characters. The description must start with English letters, but cannot start with http:// or https://.

transitRouterAttachmentName String

The name of the VPN connection. The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

transitRouterId String

The ID of the forwarding router instance.

vpnId String

The id of the vpn.

vpnOwnerId String

The owner id of vpn. NOTE: You must set vpn_owner_id, if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.

zones List<Property Map>

The list of zone mapping. See the following Block zone.

Supporting Types

TransitRouterVpnAttachmentZone

ZoneId string

The id of the zone.

ZoneId string

The id of the zone.

zoneId String

The id of the zone.

zoneId string

The id of the zone.

zone_id str

The id of the zone.

zoneId String

The id of the zone.

Import

Cloud Enterprise Network (CEN) Transit Router Vpn Attachment can be imported using the id, e.g.

 $ pulumi import alicloud:cen/transitRouterVpnAttachment:TransitRouterVpnAttachment example <id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.