1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. cen
  6. TransitRouterVpnAttachment
Viewing docs for Alibaba Cloud v3.102.0
published on Sunday, May 10, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.102.0
published on Sunday, May 10, 2026 by Pulumi

    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 since v1.183.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_example";
    const example = new alicloud.cen.Instance("example", {cenInstanceName: name});
    const exampleTransitRouter = new alicloud.cen.TransitRouter("example", {
        cenId: example.id,
        transitRouterDescription: name,
        transitRouterName: name,
    });
    const exampleCustomerGateway = new alicloud.vpn.CustomerGateway("example", {
        customerGatewayName: name,
        ipAddress: "42.104.22.210",
        asn: "45014",
        description: name,
    });
    const exampleGatewayVpnAttachment = new alicloud.vpn.GatewayVpnAttachment("example", {
        networkType: "public",
        localSubnet: "0.0.0.0/0",
        remoteSubnet: "0.0.0.0/0",
        effectImmediately: false,
        tunnelOptionsSpecifications: [
            {
                customerGatewayId: exampleCustomerGateway.id,
                role: "master",
                tunnelIndex: 1,
                enableDpd: true,
                enableNatTraversal: true,
                tunnelIkeConfig: {
                    ikeAuthAlg: "md5",
                    ikeEncAlg: "des",
                    ikeVersion: "ikev2",
                    ikeMode: "main",
                    ikeLifetime: 86400,
                    psk: "tf-examplevpn1",
                    ikePfs: "group1",
                    remoteId: "examplebob1",
                    localId: "examplealice1",
                },
                tunnelIpsecConfig: {
                    ipsecPfs: "group5",
                    ipsecEncAlg: "des",
                    ipsecAuthAlg: "md5",
                    ipsecLifetime: 86400,
                },
            },
            {
                customerGatewayId: exampleCustomerGateway.id,
                role: "slave",
                tunnelIndex: 2,
                enableDpd: true,
                enableNatTraversal: true,
                tunnelIkeConfig: {
                    ikeAuthAlg: "md5",
                    ikeEncAlg: "des",
                    ikeVersion: "ikev2",
                    ikeMode: "main",
                    ikeLifetime: 86400,
                    psk: "tf-examplevpn2",
                    ikePfs: "group1",
                    remoteId: "examplebob2",
                    localId: "examplealice2",
                },
                tunnelIpsecConfig: {
                    ipsecPfs: "group5",
                    ipsecEncAlg: "des",
                    ipsecAuthAlg: "md5",
                    ipsecLifetime: 86400,
                },
            },
        ],
        vpnAttachmentName: name,
    });
    const exampleTransitRouterCidr = new alicloud.cen.TransitRouterCidr("example", {
        transitRouterId: exampleTransitRouter.transitRouterId,
        cidr: "192.168.0.0/16",
        transitRouterCidrName: name,
        description: name,
        publishCidrRoute: true,
    });
    const exampleTransitRouterVpnAttachment = new alicloud.cen.TransitRouterVpnAttachment("example", {
        autoPublishRouteEnabled: false,
        transitRouterAttachmentDescription: name,
        transitRouterVpnAttachmentName: name,
        cenId: exampleTransitRouter.cenId,
        transitRouterId: exampleTransitRouterCidr.transitRouterId,
        vpnId: exampleGatewayVpnAttachment.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    example = alicloud.cen.Instance("example", cen_instance_name=name)
    example_transit_router = alicloud.cen.TransitRouter("example",
        cen_id=example.id,
        transit_router_description=name,
        transit_router_name=name)
    example_customer_gateway = alicloud.vpn.CustomerGateway("example",
        customer_gateway_name=name,
        ip_address="42.104.22.210",
        asn="45014",
        description=name)
    example_gateway_vpn_attachment = alicloud.vpn.GatewayVpnAttachment("example",
        network_type="public",
        local_subnet="0.0.0.0/0",
        remote_subnet="0.0.0.0/0",
        effect_immediately=False,
        tunnel_options_specifications=[
            {
                "customer_gateway_id": example_customer_gateway.id,
                "role": "master",
                "tunnel_index": 1,
                "enable_dpd": True,
                "enable_nat_traversal": True,
                "tunnel_ike_config": {
                    "ike_auth_alg": "md5",
                    "ike_enc_alg": "des",
                    "ike_version": "ikev2",
                    "ike_mode": "main",
                    "ike_lifetime": 86400,
                    "psk": "tf-examplevpn1",
                    "ike_pfs": "group1",
                    "remote_id": "examplebob1",
                    "local_id": "examplealice1",
                },
                "tunnel_ipsec_config": {
                    "ipsec_pfs": "group5",
                    "ipsec_enc_alg": "des",
                    "ipsec_auth_alg": "md5",
                    "ipsec_lifetime": 86400,
                },
            },
            {
                "customer_gateway_id": example_customer_gateway.id,
                "role": "slave",
                "tunnel_index": 2,
                "enable_dpd": True,
                "enable_nat_traversal": True,
                "tunnel_ike_config": {
                    "ike_auth_alg": "md5",
                    "ike_enc_alg": "des",
                    "ike_version": "ikev2",
                    "ike_mode": "main",
                    "ike_lifetime": 86400,
                    "psk": "tf-examplevpn2",
                    "ike_pfs": "group1",
                    "remote_id": "examplebob2",
                    "local_id": "examplealice2",
                },
                "tunnel_ipsec_config": {
                    "ipsec_pfs": "group5",
                    "ipsec_enc_alg": "des",
                    "ipsec_auth_alg": "md5",
                    "ipsec_lifetime": 86400,
                },
            },
        ],
        vpn_attachment_name=name)
    example_transit_router_cidr = alicloud.cen.TransitRouterCidr("example",
        transit_router_id=example_transit_router.transit_router_id,
        cidr="192.168.0.0/16",
        transit_router_cidr_name=name,
        description=name,
        publish_cidr_route=True)
    example_transit_router_vpn_attachment = alicloud.cen.TransitRouterVpnAttachment("example",
        auto_publish_route_enabled=False,
        transit_router_attachment_description=name,
        transit_router_vpn_attachment_name=name,
        cen_id=example_transit_router.cen_id,
        transit_router_id=example_transit_router_cidr.transit_router_id,
        vpn_id=example_gateway_vpn_attachment.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"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		example, err := cen.NewInstance(ctx, "example", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitRouter, err := cen.NewTransitRouter(ctx, "example", &cen.TransitRouterArgs{
    			CenId:                    example.ID(),
    			TransitRouterDescription: pulumi.String(pulumi.String(name)),
    			TransitRouterName:        pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		exampleCustomerGateway, err := vpn.NewCustomerGateway(ctx, "example", &vpn.CustomerGatewayArgs{
    			CustomerGatewayName: pulumi.String(pulumi.String(name)),
    			IpAddress:           pulumi.String("42.104.22.210"),
    			Asn:                 pulumi.String("45014"),
    			Description:         pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGatewayVpnAttachment, err := vpn.NewGatewayVpnAttachment(ctx, "example", &vpn.GatewayVpnAttachmentArgs{
    			NetworkType:       pulumi.String("public"),
    			LocalSubnet:       pulumi.String("0.0.0.0/0"),
    			RemoteSubnet:      pulumi.String("0.0.0.0/0"),
    			EffectImmediately: pulumi.Bool(false),
    			TunnelOptionsSpecifications: vpn.GatewayVpnAttachmentTunnelOptionsSpecificationArray{
    				&vpn.GatewayVpnAttachmentTunnelOptionsSpecificationArgs{
    					CustomerGatewayId:  exampleCustomerGateway.ID(),
    					Role:               pulumi.String("master"),
    					TunnelIndex:        pulumi.Int(1),
    					EnableDpd:          pulumi.Bool(true),
    					EnableNatTraversal: pulumi.Bool(true),
    					TunnelIkeConfig: &vpn.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs{
    						IkeAuthAlg:  pulumi.String("md5"),
    						IkeEncAlg:   pulumi.String("des"),
    						IkeVersion:  pulumi.String("ikev2"),
    						IkeMode:     pulumi.String("main"),
    						IkeLifetime: pulumi.Int(86400),
    						Psk:         pulumi.String("tf-examplevpn1"),
    						IkePfs:      pulumi.String("group1"),
    						RemoteId:    pulumi.String("examplebob1"),
    						LocalId:     pulumi.String("examplealice1"),
    					},
    					TunnelIpsecConfig: &vpn.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs{
    						IpsecPfs:      pulumi.String("group5"),
    						IpsecEncAlg:   pulumi.String("des"),
    						IpsecAuthAlg:  pulumi.String("md5"),
    						IpsecLifetime: pulumi.Int(86400),
    					},
    				},
    				&vpn.GatewayVpnAttachmentTunnelOptionsSpecificationArgs{
    					CustomerGatewayId:  exampleCustomerGateway.ID(),
    					Role:               pulumi.String("slave"),
    					TunnelIndex:        pulumi.Int(2),
    					EnableDpd:          pulumi.Bool(true),
    					EnableNatTraversal: pulumi.Bool(true),
    					TunnelIkeConfig: &vpn.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs{
    						IkeAuthAlg:  pulumi.String("md5"),
    						IkeEncAlg:   pulumi.String("des"),
    						IkeVersion:  pulumi.String("ikev2"),
    						IkeMode:     pulumi.String("main"),
    						IkeLifetime: pulumi.Int(86400),
    						Psk:         pulumi.String("tf-examplevpn2"),
    						IkePfs:      pulumi.String("group1"),
    						RemoteId:    pulumi.String("examplebob2"),
    						LocalId:     pulumi.String("examplealice2"),
    					},
    					TunnelIpsecConfig: &vpn.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs{
    						IpsecPfs:      pulumi.String("group5"),
    						IpsecEncAlg:   pulumi.String("des"),
    						IpsecAuthAlg:  pulumi.String("md5"),
    						IpsecLifetime: pulumi.Int(86400),
    					},
    				},
    			},
    			VpnAttachmentName: pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		exampleTransitRouterCidr, err := cen.NewTransitRouterCidr(ctx, "example", &cen.TransitRouterCidrArgs{
    			TransitRouterId:       exampleTransitRouter.TransitRouterId,
    			Cidr:                  pulumi.String("192.168.0.0/16"),
    			TransitRouterCidrName: pulumi.String(pulumi.String(name)),
    			Description:           pulumi.String(pulumi.String(name)),
    			PublishCidrRoute:      pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewTransitRouterVpnAttachment(ctx, "example", &cen.TransitRouterVpnAttachmentArgs{
    			AutoPublishRouteEnabled:            pulumi.Bool(false),
    			TransitRouterAttachmentDescription: pulumi.String(pulumi.String(name)),
    			TransitRouterVpnAttachmentName:     pulumi.String(pulumi.String(name)),
    			CenId:                              exampleTransitRouter.CenId,
    			TransitRouterId:                    exampleTransitRouterCidr.TransitRouterId,
    			VpnId:                              exampleGatewayVpnAttachment.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf_example";
        var example = new AliCloud.Cen.Instance("example", new()
        {
            CenInstanceName = name,
        });
    
        var exampleTransitRouter = new AliCloud.Cen.TransitRouter("example", new()
        {
            CenId = example.Id,
            TransitRouterDescription = name,
            TransitRouterName = name,
        });
    
        var exampleCustomerGateway = new AliCloud.Vpn.CustomerGateway("example", new()
        {
            CustomerGatewayName = name,
            IpAddress = "42.104.22.210",
            Asn = "45014",
            Description = name,
        });
    
        var exampleGatewayVpnAttachment = new AliCloud.Vpn.GatewayVpnAttachment("example", new()
        {
            NetworkType = "public",
            LocalSubnet = "0.0.0.0/0",
            RemoteSubnet = "0.0.0.0/0",
            EffectImmediately = false,
            TunnelOptionsSpecifications = new[]
            {
                new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationArgs
                {
                    CustomerGatewayId = exampleCustomerGateway.Id,
                    Role = "master",
                    TunnelIndex = 1,
                    EnableDpd = true,
                    EnableNatTraversal = true,
                    TunnelIkeConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs
                    {
                        IkeAuthAlg = "md5",
                        IkeEncAlg = "des",
                        IkeVersion = "ikev2",
                        IkeMode = "main",
                        IkeLifetime = 86400,
                        Psk = "tf-examplevpn1",
                        IkePfs = "group1",
                        RemoteId = "examplebob1",
                        LocalId = "examplealice1",
                    },
                    TunnelIpsecConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs
                    {
                        IpsecPfs = "group5",
                        IpsecEncAlg = "des",
                        IpsecAuthAlg = "md5",
                        IpsecLifetime = 86400,
                    },
                },
                new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationArgs
                {
                    CustomerGatewayId = exampleCustomerGateway.Id,
                    Role = "slave",
                    TunnelIndex = 2,
                    EnableDpd = true,
                    EnableNatTraversal = true,
                    TunnelIkeConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs
                    {
                        IkeAuthAlg = "md5",
                        IkeEncAlg = "des",
                        IkeVersion = "ikev2",
                        IkeMode = "main",
                        IkeLifetime = 86400,
                        Psk = "tf-examplevpn2",
                        IkePfs = "group1",
                        RemoteId = "examplebob2",
                        LocalId = "examplealice2",
                    },
                    TunnelIpsecConfig = new AliCloud.Vpn.Inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs
                    {
                        IpsecPfs = "group5",
                        IpsecEncAlg = "des",
                        IpsecAuthAlg = "md5",
                        IpsecLifetime = 86400,
                    },
                },
            },
            VpnAttachmentName = name,
        });
    
        var exampleTransitRouterCidr = new AliCloud.Cen.TransitRouterCidr("example", new()
        {
            TransitRouterId = exampleTransitRouter.TransitRouterId,
            Cidr = "192.168.0.0/16",
            TransitRouterCidrName = name,
            Description = name,
            PublishCidrRoute = true,
        });
    
        var exampleTransitRouterVpnAttachment = new AliCloud.Cen.TransitRouterVpnAttachment("example", new()
        {
            AutoPublishRouteEnabled = false,
            TransitRouterAttachmentDescription = name,
            TransitRouterVpnAttachmentName = name,
            CenId = exampleTransitRouter.CenId,
            TransitRouterId = exampleTransitRouterCidr.TransitRouterId,
            VpnId = exampleGatewayVpnAttachment.Id,
        });
    
    });
    
    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.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.GatewayVpnAttachmentTunnelOptionsSpecificationArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs;
    import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs;
    import com.pulumi.alicloud.cen.TransitRouterCidr;
    import com.pulumi.alicloud.cen.TransitRouterCidrArgs;
    import com.pulumi.alicloud.cen.TransitRouterVpnAttachment;
    import com.pulumi.alicloud.cen.TransitRouterVpnAttachmentArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf_example");
            var example = new Instance("example", InstanceArgs.builder()
                .cenInstanceName(name)
                .build());
    
            var exampleTransitRouter = new TransitRouter("exampleTransitRouter", TransitRouterArgs.builder()
                .cenId(example.id())
                .transitRouterDescription(name)
                .transitRouterName(name)
                .build());
    
            var exampleCustomerGateway = new CustomerGateway("exampleCustomerGateway", CustomerGatewayArgs.builder()
                .customerGatewayName(name)
                .ipAddress("42.104.22.210")
                .asn("45014")
                .description(name)
                .build());
    
            var exampleGatewayVpnAttachment = new GatewayVpnAttachment("exampleGatewayVpnAttachment", GatewayVpnAttachmentArgs.builder()
                .networkType("public")
                .localSubnet("0.0.0.0/0")
                .remoteSubnet("0.0.0.0/0")
                .effectImmediately(false)
                .tunnelOptionsSpecifications(            
                    GatewayVpnAttachmentTunnelOptionsSpecificationArgs.builder()
                        .customerGatewayId(exampleCustomerGateway.id())
                        .role("master")
                        .tunnelIndex(1)
                        .enableDpd(true)
                        .enableNatTraversal(true)
                        .tunnelIkeConfig(GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs.builder()
                            .ikeAuthAlg("md5")
                            .ikeEncAlg("des")
                            .ikeVersion("ikev2")
                            .ikeMode("main")
                            .ikeLifetime(86400)
                            .psk("tf-examplevpn1")
                            .ikePfs("group1")
                            .remoteId("examplebob1")
                            .localId("examplealice1")
                            .build())
                        .tunnelIpsecConfig(GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs.builder()
                            .ipsecPfs("group5")
                            .ipsecEncAlg("des")
                            .ipsecAuthAlg("md5")
                            .ipsecLifetime(86400)
                            .build())
                        .build(),
                    GatewayVpnAttachmentTunnelOptionsSpecificationArgs.builder()
                        .customerGatewayId(exampleCustomerGateway.id())
                        .role("slave")
                        .tunnelIndex(2)
                        .enableDpd(true)
                        .enableNatTraversal(true)
                        .tunnelIkeConfig(GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIkeConfigArgs.builder()
                            .ikeAuthAlg("md5")
                            .ikeEncAlg("des")
                            .ikeVersion("ikev2")
                            .ikeMode("main")
                            .ikeLifetime(86400)
                            .psk("tf-examplevpn2")
                            .ikePfs("group1")
                            .remoteId("examplebob2")
                            .localId("examplealice2")
                            .build())
                        .tunnelIpsecConfig(GatewayVpnAttachmentTunnelOptionsSpecificationTunnelIpsecConfigArgs.builder()
                            .ipsecPfs("group5")
                            .ipsecEncAlg("des")
                            .ipsecAuthAlg("md5")
                            .ipsecLifetime(86400)
                            .build())
                        .build())
                .vpnAttachmentName(name)
                .build());
    
            var exampleTransitRouterCidr = new TransitRouterCidr("exampleTransitRouterCidr", TransitRouterCidrArgs.builder()
                .transitRouterId(exampleTransitRouter.transitRouterId())
                .cidr("192.168.0.0/16")
                .transitRouterCidrName(name)
                .description(name)
                .publishCidrRoute(true)
                .build());
    
            var exampleTransitRouterVpnAttachment = new TransitRouterVpnAttachment("exampleTransitRouterVpnAttachment", TransitRouterVpnAttachmentArgs.builder()
                .autoPublishRouteEnabled(false)
                .transitRouterAttachmentDescription(name)
                .transitRouterVpnAttachmentName(name)
                .cenId(exampleTransitRouter.cenId())
                .transitRouterId(exampleTransitRouterCidr.transitRouterId())
                .vpnId(exampleGatewayVpnAttachment.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf_example
    resources:
      example:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: ${name}
      exampleTransitRouter:
        type: alicloud:cen:TransitRouter
        name: example
        properties:
          cenId: ${example.id}
          transitRouterDescription: ${name}
          transitRouterName: ${name}
      exampleCustomerGateway:
        type: alicloud:vpn:CustomerGateway
        name: example
        properties:
          customerGatewayName: ${name}
          ipAddress: 42.104.22.210
          asn: '45014'
          description: ${name}
      exampleGatewayVpnAttachment:
        type: alicloud:vpn:GatewayVpnAttachment
        name: example
        properties:
          networkType: public
          localSubnet: 0.0.0.0/0
          remoteSubnet: 0.0.0.0/0
          effectImmediately: false
          tunnelOptionsSpecifications:
            - customerGatewayId: ${exampleCustomerGateway.id}
              role: master
              tunnelIndex: 1
              enableDpd: true
              enableNatTraversal: true
              tunnelIkeConfig:
                ikeAuthAlg: md5
                ikeEncAlg: des
                ikeVersion: ikev2
                ikeMode: main
                ikeLifetime: 86400
                psk: tf-examplevpn1
                ikePfs: group1
                remoteId: examplebob1
                localId: examplealice1
              tunnelIpsecConfig:
                ipsecPfs: group5
                ipsecEncAlg: des
                ipsecAuthAlg: md5
                ipsecLifetime: 86400
            - customerGatewayId: ${exampleCustomerGateway.id}
              role: slave
              tunnelIndex: 2
              enableDpd: true
              enableNatTraversal: true
              tunnelIkeConfig:
                ikeAuthAlg: md5
                ikeEncAlg: des
                ikeVersion: ikev2
                ikeMode: main
                ikeLifetime: 86400
                psk: tf-examplevpn2
                ikePfs: group1
                remoteId: examplebob2
                localId: examplealice2
              tunnelIpsecConfig:
                ipsecPfs: group5
                ipsecEncAlg: des
                ipsecAuthAlg: md5
                ipsecLifetime: 86400
          vpnAttachmentName: ${name}
      exampleTransitRouterCidr:
        type: alicloud:cen:TransitRouterCidr
        name: example
        properties:
          transitRouterId: ${exampleTransitRouter.transitRouterId}
          cidr: 192.168.0.0/16
          transitRouterCidrName: ${name}
          description: ${name}
          publishCidrRoute: true
      exampleTransitRouterVpnAttachment:
        type: alicloud:cen:TransitRouterVpnAttachment
        name: example
        properties:
          autoPublishRouteEnabled: false
          transitRouterAttachmentDescription: ${name}
          transitRouterVpnAttachmentName: ${name}
          cenId: ${exampleTransitRouter.cenId}
          transitRouterId: ${exampleTransitRouterCidr.transitRouterId}
          vpnId: ${exampleGatewayVpnAttachment.id}
    
    Example coming soon!
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create TransitRouterVpnAttachment Resource

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

    Constructor syntax

    new TransitRouterVpnAttachment(name: string, args: TransitRouterVpnAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def TransitRouterVpnAttachment(resource_name: str,
                                   args: TransitRouterVpnAttachmentArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def TransitRouterVpnAttachment(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   vpn_id: Optional[str] = None,
                                   auto_publish_route_enabled: Optional[bool] = None,
                                   cen_id: Optional[str] = None,
                                   charge_type: Optional[str] = None,
                                   order_type: Optional[str] = None,
                                   tags: Optional[Mapping[str, str]] = None,
                                   transit_router_attachment_description: Optional[str] = None,
                                   transit_router_attachment_name: Optional[str] = None,
                                   transit_router_id: Optional[str] = None,
                                   transit_router_vpn_attachment_name: Optional[str] = None,
                                   vpn_owner_id: Optional[str] = None,
                                   zones: Optional[Sequence[TransitRouterVpnAttachmentZoneArgs]] = 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.
    
    
    resource "alicloud_cen_transitroutervpnattachment" "name" {
        # resource properties
    }

    Parameters

    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.

    Constructor example

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

    var transitRouterVpnAttachmentResource = new AliCloud.Cen.TransitRouterVpnAttachment("transitRouterVpnAttachmentResource", new()
    {
        VpnId = "string",
        AutoPublishRouteEnabled = false,
        CenId = "string",
        ChargeType = "string",
        OrderType = "string",
        Tags = 
        {
            { "string", "string" },
        },
        TransitRouterAttachmentDescription = "string",
        TransitRouterId = "string",
        TransitRouterVpnAttachmentName = "string",
        VpnOwnerId = "string",
        Zones = new[]
        {
            new AliCloud.Cen.Inputs.TransitRouterVpnAttachmentZoneArgs
            {
                ZoneId = "string",
            },
        },
    });
    
    example, err := cen.NewTransitRouterVpnAttachment(ctx, "transitRouterVpnAttachmentResource", &cen.TransitRouterVpnAttachmentArgs{
    	VpnId:                   pulumi.String("string"),
    	AutoPublishRouteEnabled: pulumi.Bool(false),
    	CenId:                   pulumi.String("string"),
    	ChargeType:              pulumi.String("string"),
    	OrderType:               pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	TransitRouterAttachmentDescription: pulumi.String("string"),
    	TransitRouterId:                    pulumi.String("string"),
    	TransitRouterVpnAttachmentName:     pulumi.String("string"),
    	VpnOwnerId:                         pulumi.String("string"),
    	Zones: cen.TransitRouterVpnAttachmentZoneArray{
    		&cen.TransitRouterVpnAttachmentZoneArgs{
    			ZoneId: pulumi.String("string"),
    		},
    	},
    })
    
    resource "alicloud_cen_transitroutervpnattachment" "transitRouterVpnAttachmentResource" {
      vpn_id                     = "string"
      auto_publish_route_enabled = false
      cen_id                     = "string"
      charge_type                = "string"
      order_type                 = "string"
      tags = {
        "string" = "string"
      }
      transit_router_attachment_description = "string"
      transit_router_id                     = "string"
      transit_router_vpn_attachment_name    = "string"
      vpn_owner_id                          = "string"
      zones {
        zone_id = "string"
      }
    }
    
    var transitRouterVpnAttachmentResource = new TransitRouterVpnAttachment("transitRouterVpnAttachmentResource", TransitRouterVpnAttachmentArgs.builder()
        .vpnId("string")
        .autoPublishRouteEnabled(false)
        .cenId("string")
        .chargeType("string")
        .orderType("string")
        .tags(Map.of("string", "string"))
        .transitRouterAttachmentDescription("string")
        .transitRouterId("string")
        .transitRouterVpnAttachmentName("string")
        .vpnOwnerId("string")
        .zones(TransitRouterVpnAttachmentZoneArgs.builder()
            .zoneId("string")
            .build())
        .build());
    
    transit_router_vpn_attachment_resource = alicloud.cen.TransitRouterVpnAttachment("transitRouterVpnAttachmentResource",
        vpn_id="string",
        auto_publish_route_enabled=False,
        cen_id="string",
        charge_type="string",
        order_type="string",
        tags={
            "string": "string",
        },
        transit_router_attachment_description="string",
        transit_router_id="string",
        transit_router_vpn_attachment_name="string",
        vpn_owner_id="string",
        zones=[{
            "zone_id": "string",
        }])
    
    const transitRouterVpnAttachmentResource = new alicloud.cen.TransitRouterVpnAttachment("transitRouterVpnAttachmentResource", {
        vpnId: "string",
        autoPublishRouteEnabled: false,
        cenId: "string",
        chargeType: "string",
        orderType: "string",
        tags: {
            string: "string",
        },
        transitRouterAttachmentDescription: "string",
        transitRouterId: "string",
        transitRouterVpnAttachmentName: "string",
        vpnOwnerId: "string",
        zones: [{
            zoneId: "string",
        }],
    });
    
    type: alicloud:cen:TransitRouterVpnAttachment
    properties:
        autoPublishRouteEnabled: false
        cenId: string
        chargeType: string
        orderType: string
        tags:
            string: string
        transitRouterAttachmentDescription: string
        transitRouterId: string
        transitRouterVpnAttachmentName: string
        vpnId: string
        vpnOwnerId: string
        zones:
            - zoneId: string
    

    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

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

    The TransitRouterVpnAttachment resource accepts the following input properties:

    VpnId string
    The ID of the IPsec-VPN attachment.
    AutoPublishRouteEnabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    CenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    ChargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    OrderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    Tags Dictionary<string, string>
    The tag of the resource
    TransitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    TransitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    TransitRouterId string
    The ID of the transit router.
    TransitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    VpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId 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.TransitRouterVpnAttachmentZone>

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    VpnId string
    The ID of the IPsec-VPN attachment.
    AutoPublishRouteEnabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    CenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    ChargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    OrderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    Tags map[string]string
    The tag of the resource
    TransitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    TransitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    TransitRouterId string
    The ID of the transit router.
    TransitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    VpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    Zones []TransitRouterVpnAttachmentZoneArgs

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    vpn_id string
    The ID of the IPsec-VPN attachment.
    auto_publish_route_enabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cen_id string
    The ID of the Cloud Enterprise Network (CEN) instance.
    charge_type string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    order_type string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    tags map(string)
    The tag of the resource
    transit_router_attachment_description string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transit_router_attachment_name string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transit_router_id string
    The ID of the transit router.
    transit_router_vpn_attachment_name string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpn_owner_id string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones list(object)

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    vpnId String
    The ID of the IPsec-VPN attachment.
    autoPublishRouteEnabled Boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId String
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType String
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    orderType String
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    tags Map<String,String>
    The tag of the resource
    transitRouterAttachmentDescription String
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName String
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId String
    The ID of the transit router.
    transitRouterVpnAttachmentName String
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnOwnerId String
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones List<TransitRouterVpnAttachmentZone>

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    vpnId string
    The ID of the IPsec-VPN attachment.
    autoPublishRouteEnabled boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    orderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    tags {[key: string]: string}
    The tag of the resource
    transitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId string
    The ID of the transit router.
    transitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones TransitRouterVpnAttachmentZone[]

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    vpn_id str
    The ID of the IPsec-VPN attachment.
    auto_publish_route_enabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cen_id str
    The ID of the Cloud Enterprise Network (CEN) instance.
    charge_type str
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    order_type str
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    tags Mapping[str, str]
    The tag of the resource
    transit_router_attachment_description str
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transit_router_attachment_name str
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transit_router_id str
    The ID of the transit router.
    transit_router_vpn_attachment_name str
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpn_owner_id str
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones Sequence[TransitRouterVpnAttachmentZoneArgs]

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    vpnId String
    The ID of the IPsec-VPN attachment.
    autoPublishRouteEnabled Boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId String
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType String
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    orderType String
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    tags Map<String>
    The tag of the resource
    transitRouterAttachmentDescription String
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName String
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId String
    The ID of the transit router.
    transitRouterVpnAttachmentName String
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnOwnerId String
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId 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 Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    Outputs

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

    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The ID of the region where the transit router is deployed.
    Status string
    Status.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The ID of the region where the transit router is deployed.
    Status string
    Status.
    create_time string
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    region_id string
    The ID of the region where the transit router is deployed.
    status string
    Status.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The ID of the region where the transit router is deployed.
    status String
    Status.
    createTime string
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    The ID of the region where the transit router is deployed.
    status string
    Status.
    create_time str
    The creation time of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    The ID of the region where the transit router is deployed.
    status str
    Status.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The ID of the region where the transit router is deployed.
    status String
    Status.

    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,
            charge_type: Optional[str] = None,
            create_time: Optional[str] = None,
            order_type: Optional[str] = None,
            region_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            transit_router_attachment_description: Optional[str] = None,
            transit_router_attachment_name: Optional[str] = None,
            transit_router_id: Optional[str] = None,
            transit_router_vpn_attachment_name: 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)
    resources:  _:    type: alicloud:cen:TransitRouterVpnAttachment    get:      id: ${id}
    import {
      to = alicloud_cen_transitroutervpnattachment.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AutoPublishRouteEnabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    CenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    ChargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    CreateTime string
    The creation time of the resource.
    OrderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    RegionId string
    The ID of the region where the transit router is deployed.
    Status string
    Status.
    Tags Dictionary<string, string>
    The tag of the resource
    TransitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    TransitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    TransitRouterId string
    The ID of the transit router.
    TransitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    VpnId string
    The ID of the IPsec-VPN attachment.
    VpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId 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.TransitRouterVpnAttachmentZone>

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    AutoPublishRouteEnabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    CenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    ChargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    CreateTime string
    The creation time of the resource.
    OrderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    RegionId string
    The ID of the region where the transit router is deployed.
    Status string
    Status.
    Tags map[string]string
    The tag of the resource
    TransitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    TransitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    TransitRouterId string
    The ID of the transit router.
    TransitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    VpnId string
    The ID of the IPsec-VPN attachment.
    VpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    Zones []TransitRouterVpnAttachmentZoneArgs

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    auto_publish_route_enabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cen_id string
    The ID of the Cloud Enterprise Network (CEN) instance.
    charge_type string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    create_time string
    The creation time of the resource.
    order_type string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    region_id string
    The ID of the region where the transit router is deployed.
    status string
    Status.
    tags map(string)
    The tag of the resource
    transit_router_attachment_description string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transit_router_attachment_name string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transit_router_id string
    The ID of the transit router.
    transit_router_vpn_attachment_name string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpn_id string
    The ID of the IPsec-VPN attachment.
    vpn_owner_id string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones list(object)

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoPublishRouteEnabled Boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId String
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType String
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    createTime String
    The creation time of the resource.
    orderType String
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    regionId String
    The ID of the region where the transit router is deployed.
    status String
    Status.
    tags Map<String,String>
    The tag of the resource
    transitRouterAttachmentDescription String
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName String
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId String
    The ID of the transit router.
    transitRouterVpnAttachmentName String
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnId String
    The ID of the IPsec-VPN attachment.
    vpnOwnerId String
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones List<TransitRouterVpnAttachmentZone>

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoPublishRouteEnabled boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId string
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType string
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    createTime string
    The creation time of the resource.
    orderType string
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    regionId string
    The ID of the region where the transit router is deployed.
    status string
    Status.
    tags {[key: string]: string}
    The tag of the resource
    transitRouterAttachmentDescription string
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName string
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId string
    The ID of the transit router.
    transitRouterVpnAttachmentName string
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnId string
    The ID of the IPsec-VPN attachment.
    vpnOwnerId string
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones TransitRouterVpnAttachmentZone[]

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    auto_publish_route_enabled bool
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cen_id str
    The ID of the Cloud Enterprise Network (CEN) instance.
    charge_type str
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    create_time str
    The creation time of the resource.
    order_type str
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    region_id str
    The ID of the region where the transit router is deployed.
    status str
    Status.
    tags Mapping[str, str]
    The tag of the resource
    transit_router_attachment_description str
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transit_router_attachment_name str
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transit_router_id str
    The ID of the transit router.
    transit_router_vpn_attachment_name str
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpn_id str
    The ID of the IPsec-VPN attachment.
    vpn_owner_id str
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId if you want to connect the transit router to an IPsec-VPN connection that belongs to another Alibaba Cloud account.
    zones Sequence[TransitRouterVpnAttachmentZoneArgs]

    The Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoPublishRouteEnabled Boolean
    Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN attachment. Valid values:
    cenId String
    The ID of the Cloud Enterprise Network (CEN) instance.
    chargeType String
    The billing method. Set the value to POSTPAY, which is the default value and specifies the pay-as-you-go billing method.
    createTime String
    The creation time of the resource.
    orderType String
    The entity that pays the fees of the network instance. Valid values:

    • PayByCenOwner: the Alibaba Cloud account that owns the CEN instance.
    • PayByResourceOwner: the Alibaba Cloud account that owns the network instance.
    regionId String
    The ID of the region where the transit router is deployed.
    status String
    Status.
    tags Map<String>
    The tag of the resource
    transitRouterAttachmentDescription String
    The new description of the VPN attachment. The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.
    transitRouterAttachmentName String
    . Field 'transit_router_attachment_name' has been deprecated from provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    Deprecated: Field 'transit_router_attachment_name' has been deprecated since provider version 1.274.0. New field 'transit_router_vpn_attachment_name' instead.

    transitRouterId String
    The ID of the transit router.
    transitRouterVpnAttachmentName String
    The name of the VPN attachment. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
    vpnId String
    The ID of the IPsec-VPN attachment.
    vpnOwnerId String
    The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

    • If you do not set this parameter, the ID of the current Alibaba Cloud account is used.
    • You must set VpnOwnerId 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 Zone ID in the current region. System will create resources under the Zone that you specify. Left blank if associated IPSec connection is in dual-tunnel mode. See zone below.

    The following arguments will be discarded. Please use new fields as soon as possible:

    Supporting Types

    TransitRouterVpnAttachmentZone, TransitRouterVpnAttachmentZoneArgs

    ZoneId string
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    ZoneId string
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    zone_id string
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    zoneId String
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    zoneId string
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    zone_id str
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.
    zoneId String
    The zone ID of the read-only instance. You can call the ListTransitRouterAvailableResource operation to query the most recent zone list.

    Import

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

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Viewing docs for Alibaba Cloud v3.102.0
    published on Sunday, May 10, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.