1. Packages
  2. Ucloud Provider
  3. API Docs
  4. VpnConnection
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.VpnConnection

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    Provides a IPSec VPN Gateway Connection resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const fooVpc = new ucloud.Vpc("fooVpc", {
        tag: "tf-acc",
        cidrBlocks: ["192.168.0.0/16"],
    });
    const fooSubnet = new ucloud.Subnet("fooSubnet", {
        tag: "tf-acc",
        cidrBlock: "192.168.1.0/24",
        vpcId: fooVpc.vpcId,
    });
    const fooEip = new ucloud.Eip("fooEip", {
        bandwidth: 1,
        internetType: "bgp",
        chargeMode: "bandwidth",
        tag: "tf-acc",
    });
    const fooVpnGateway = new ucloud.VpnGateway("fooVpnGateway", {
        vpcId: fooVpc.vpcId,
        grade: "standard",
        eipId: fooEip.eipId,
        tag: "tf-acc",
    });
    const fooVpnCustomerGateway = new ucloud.VpnCustomerGateway("fooVpnCustomerGateway", {
        ipAddress: "10.0.0.1",
        tag: "tf-acc",
    });
    const fooVpnConnection = new ucloud.VpnConnection("fooVpnConnection", {
        vpnGatewayId: fooVpnGateway.vpnGatewayId,
        customerGatewayId: fooVpnCustomerGateway.vpnCustomerGatewayId,
        vpcId: fooVpc.vpcId,
        tag: "tf-acc",
        remark: "test",
        ikeConfig: {
            preSharedKey: "test_2019",
        },
        ipsecConfig: {
            localSubnetIds: [fooSubnet.subnetId],
            remoteSubnets: ["10.0.0.0/24"],
        },
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo_vpc = ucloud.Vpc("fooVpc",
        tag="tf-acc",
        cidr_blocks=["192.168.0.0/16"])
    foo_subnet = ucloud.Subnet("fooSubnet",
        tag="tf-acc",
        cidr_block="192.168.1.0/24",
        vpc_id=foo_vpc.vpc_id)
    foo_eip = ucloud.Eip("fooEip",
        bandwidth=1,
        internet_type="bgp",
        charge_mode="bandwidth",
        tag="tf-acc")
    foo_vpn_gateway = ucloud.VpnGateway("fooVpnGateway",
        vpc_id=foo_vpc.vpc_id,
        grade="standard",
        eip_id=foo_eip.eip_id,
        tag="tf-acc")
    foo_vpn_customer_gateway = ucloud.VpnCustomerGateway("fooVpnCustomerGateway",
        ip_address="10.0.0.1",
        tag="tf-acc")
    foo_vpn_connection = ucloud.VpnConnection("fooVpnConnection",
        vpn_gateway_id=foo_vpn_gateway.vpn_gateway_id,
        customer_gateway_id=foo_vpn_customer_gateway.vpn_customer_gateway_id,
        vpc_id=foo_vpc.vpc_id,
        tag="tf-acc",
        remark="test",
        ike_config={
            "pre_shared_key": "test_2019",
        },
        ipsec_config={
            "local_subnet_ids": [foo_subnet.subnet_id],
            "remote_subnets": ["10.0.0.0/24"],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooVpc, err := ucloud.NewVpc(ctx, "fooVpc", &ucloud.VpcArgs{
    			Tag: pulumi.String("tf-acc"),
    			CidrBlocks: pulumi.StringArray{
    				pulumi.String("192.168.0.0/16"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooSubnet, err := ucloud.NewSubnet(ctx, "fooSubnet", &ucloud.SubnetArgs{
    			Tag:       pulumi.String("tf-acc"),
    			CidrBlock: pulumi.String("192.168.1.0/24"),
    			VpcId:     fooVpc.VpcId,
    		})
    		if err != nil {
    			return err
    		}
    		fooEip, err := ucloud.NewEip(ctx, "fooEip", &ucloud.EipArgs{
    			Bandwidth:    pulumi.Float64(1),
    			InternetType: pulumi.String("bgp"),
    			ChargeMode:   pulumi.String("bandwidth"),
    			Tag:          pulumi.String("tf-acc"),
    		})
    		if err != nil {
    			return err
    		}
    		fooVpnGateway, err := ucloud.NewVpnGateway(ctx, "fooVpnGateway", &ucloud.VpnGatewayArgs{
    			VpcId: fooVpc.VpcId,
    			Grade: pulumi.String("standard"),
    			EipId: fooEip.EipId,
    			Tag:   pulumi.String("tf-acc"),
    		})
    		if err != nil {
    			return err
    		}
    		fooVpnCustomerGateway, err := ucloud.NewVpnCustomerGateway(ctx, "fooVpnCustomerGateway", &ucloud.VpnCustomerGatewayArgs{
    			IpAddress: pulumi.String("10.0.0.1"),
    			Tag:       pulumi.String("tf-acc"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ucloud.NewVpnConnection(ctx, "fooVpnConnection", &ucloud.VpnConnectionArgs{
    			VpnGatewayId:      fooVpnGateway.VpnGatewayId,
    			CustomerGatewayId: fooVpnCustomerGateway.VpnCustomerGatewayId,
    			VpcId:             fooVpc.VpcId,
    			Tag:               pulumi.String("tf-acc"),
    			Remark:            pulumi.String("test"),
    			IkeConfig: &ucloud.VpnConnectionIkeConfigArgs{
    				PreSharedKey: pulumi.String("test_2019"),
    			},
    			IpsecConfig: &ucloud.VpnConnectionIpsecConfigArgs{
    				LocalSubnetIds: pulumi.StringArray{
    					fooSubnet.SubnetId,
    				},
    				RemoteSubnets: pulumi.StringArray{
    					pulumi.String("10.0.0.0/24"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooVpc = new Ucloud.Vpc("fooVpc", new()
        {
            Tag = "tf-acc",
            CidrBlocks = new[]
            {
                "192.168.0.0/16",
            },
        });
    
        var fooSubnet = new Ucloud.Subnet("fooSubnet", new()
        {
            Tag = "tf-acc",
            CidrBlock = "192.168.1.0/24",
            VpcId = fooVpc.VpcId,
        });
    
        var fooEip = new Ucloud.Eip("fooEip", new()
        {
            Bandwidth = 1,
            InternetType = "bgp",
            ChargeMode = "bandwidth",
            Tag = "tf-acc",
        });
    
        var fooVpnGateway = new Ucloud.VpnGateway("fooVpnGateway", new()
        {
            VpcId = fooVpc.VpcId,
            Grade = "standard",
            EipId = fooEip.EipId,
            Tag = "tf-acc",
        });
    
        var fooVpnCustomerGateway = new Ucloud.VpnCustomerGateway("fooVpnCustomerGateway", new()
        {
            IpAddress = "10.0.0.1",
            Tag = "tf-acc",
        });
    
        var fooVpnConnection = new Ucloud.VpnConnection("fooVpnConnection", new()
        {
            VpnGatewayId = fooVpnGateway.VpnGatewayId,
            CustomerGatewayId = fooVpnCustomerGateway.VpnCustomerGatewayId,
            VpcId = fooVpc.VpcId,
            Tag = "tf-acc",
            Remark = "test",
            IkeConfig = new Ucloud.Inputs.VpnConnectionIkeConfigArgs
            {
                PreSharedKey = "test_2019",
            },
            IpsecConfig = new Ucloud.Inputs.VpnConnectionIpsecConfigArgs
            {
                LocalSubnetIds = new[]
                {
                    fooSubnet.SubnetId,
                },
                RemoteSubnets = new[]
                {
                    "10.0.0.0/24",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.Vpc;
    import com.pulumi.ucloud.VpcArgs;
    import com.pulumi.ucloud.Subnet;
    import com.pulumi.ucloud.SubnetArgs;
    import com.pulumi.ucloud.Eip;
    import com.pulumi.ucloud.EipArgs;
    import com.pulumi.ucloud.VpnGateway;
    import com.pulumi.ucloud.VpnGatewayArgs;
    import com.pulumi.ucloud.VpnCustomerGateway;
    import com.pulumi.ucloud.VpnCustomerGatewayArgs;
    import com.pulumi.ucloud.VpnConnection;
    import com.pulumi.ucloud.VpnConnectionArgs;
    import com.pulumi.ucloud.inputs.VpnConnectionIkeConfigArgs;
    import com.pulumi.ucloud.inputs.VpnConnectionIpsecConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
                .tag("tf-acc")
                .cidrBlocks("192.168.0.0/16")
                .build());
    
            var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
                .tag("tf-acc")
                .cidrBlock("192.168.1.0/24")
                .vpcId(fooVpc.vpcId())
                .build());
    
            var fooEip = new Eip("fooEip", EipArgs.builder()
                .bandwidth(1)
                .internetType("bgp")
                .chargeMode("bandwidth")
                .tag("tf-acc")
                .build());
    
            var fooVpnGateway = new VpnGateway("fooVpnGateway", VpnGatewayArgs.builder()
                .vpcId(fooVpc.vpcId())
                .grade("standard")
                .eipId(fooEip.eipId())
                .tag("tf-acc")
                .build());
    
            var fooVpnCustomerGateway = new VpnCustomerGateway("fooVpnCustomerGateway", VpnCustomerGatewayArgs.builder()
                .ipAddress("10.0.0.1")
                .tag("tf-acc")
                .build());
    
            var fooVpnConnection = new VpnConnection("fooVpnConnection", VpnConnectionArgs.builder()
                .vpnGatewayId(fooVpnGateway.vpnGatewayId())
                .customerGatewayId(fooVpnCustomerGateway.vpnCustomerGatewayId())
                .vpcId(fooVpc.vpcId())
                .tag("tf-acc")
                .remark("test")
                .ikeConfig(VpnConnectionIkeConfigArgs.builder()
                    .preSharedKey("test_2019")
                    .build())
                .ipsecConfig(VpnConnectionIpsecConfigArgs.builder()
                    .localSubnetIds(fooSubnet.subnetId())
                    .remoteSubnets("10.0.0.0/24")
                    .build())
                .build());
    
        }
    }
    
    resources:
      fooVpc:
        type: ucloud:Vpc
        properties:
          tag: tf-acc
          cidrBlocks:
            - 192.168.0.0/16
      fooSubnet:
        type: ucloud:Subnet
        properties:
          tag: tf-acc
          cidrBlock: 192.168.1.0/24
          vpcId: ${fooVpc.vpcId}
      fooEip:
        type: ucloud:Eip
        properties:
          bandwidth: 1
          internetType: bgp
          chargeMode: bandwidth
          tag: tf-acc
      fooVpnGateway:
        type: ucloud:VpnGateway
        properties:
          vpcId: ${fooVpc.vpcId}
          grade: standard
          eipId: ${fooEip.eipId}
          tag: tf-acc
      fooVpnCustomerGateway:
        type: ucloud:VpnCustomerGateway
        properties:
          ipAddress: 10.0.0.1
          tag: tf-acc
      fooVpnConnection:
        type: ucloud:VpnConnection
        properties:
          vpnGatewayId: ${fooVpnGateway.vpnGatewayId}
          customerGatewayId: ${fooVpnCustomerGateway.vpnCustomerGatewayId}
          vpcId: ${fooVpc.vpcId}
          tag: tf-acc
          remark: test
          ikeConfig:
            preSharedKey: test_2019
          ipsecConfig:
            localSubnetIds:
              - ${fooSubnet.subnetId}
            remoteSubnets:
              - 10.0.0.0/24
    

    Create VpnConnection Resource

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

    Constructor syntax

    new VpnConnection(name: string, args: VpnConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def VpnConnection(resource_name: str,
                      args: VpnConnectionArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpnConnection(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      customer_gateway_id: Optional[str] = None,
                      ike_config: Optional[VpnConnectionIkeConfigArgs] = None,
                      ipsec_config: Optional[VpnConnectionIpsecConfigArgs] = None,
                      vpc_id: Optional[str] = None,
                      vpn_gateway_id: Optional[str] = None,
                      name: Optional[str] = None,
                      remark: Optional[str] = None,
                      tag: Optional[str] = None,
                      vpn_connection_id: Optional[str] = None)
    func NewVpnConnection(ctx *Context, name string, args VpnConnectionArgs, opts ...ResourceOption) (*VpnConnection, error)
    public VpnConnection(string name, VpnConnectionArgs args, CustomResourceOptions? opts = null)
    public VpnConnection(String name, VpnConnectionArgs args)
    public VpnConnection(String name, VpnConnectionArgs args, CustomResourceOptions options)
    
    type: ucloud:VpnConnection
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpnConnectionArgs
    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 VpnConnectionArgs
    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 VpnConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpnConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpnConnectionArgs
    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 vpnConnectionResource = new Ucloud.VpnConnection("vpnConnectionResource", new()
    {
        CustomerGatewayId = "string",
        IkeConfig = new Ucloud.Inputs.VpnConnectionIkeConfigArgs
        {
            PreSharedKey = "string",
            AuthenticationAlgorithm = "string",
            DhGroup = "string",
            EncryptionAlgorithm = "string",
            ExchangeMode = "string",
            IkeVersion = "string",
            LocalId = "string",
            RemoteId = "string",
            SaLifeTime = 0,
        },
        IpsecConfig = new Ucloud.Inputs.VpnConnectionIpsecConfigArgs
        {
            LocalSubnetIds = new[]
            {
                "string",
            },
            RemoteSubnets = new[]
            {
                "string",
            },
            AuthenticationAlgorithm = "string",
            EncryptionAlgorithm = "string",
            PfsDhGroup = "string",
            Protocol = "string",
            SaLifeTime = 0,
            SaLifeTimeBytes = 0,
        },
        VpcId = "string",
        VpnGatewayId = "string",
        Name = "string",
        Remark = "string",
        Tag = "string",
        VpnConnectionId = "string",
    });
    
    example, err := ucloud.NewVpnConnection(ctx, "vpnConnectionResource", &ucloud.VpnConnectionArgs{
    CustomerGatewayId: pulumi.String("string"),
    IkeConfig: &.VpnConnectionIkeConfigArgs{
    PreSharedKey: pulumi.String("string"),
    AuthenticationAlgorithm: pulumi.String("string"),
    DhGroup: pulumi.String("string"),
    EncryptionAlgorithm: pulumi.String("string"),
    ExchangeMode: pulumi.String("string"),
    IkeVersion: pulumi.String("string"),
    LocalId: pulumi.String("string"),
    RemoteId: pulumi.String("string"),
    SaLifeTime: pulumi.Float64(0),
    },
    IpsecConfig: &.VpnConnectionIpsecConfigArgs{
    LocalSubnetIds: pulumi.StringArray{
    pulumi.String("string"),
    },
    RemoteSubnets: pulumi.StringArray{
    pulumi.String("string"),
    },
    AuthenticationAlgorithm: pulumi.String("string"),
    EncryptionAlgorithm: pulumi.String("string"),
    PfsDhGroup: pulumi.String("string"),
    Protocol: pulumi.String("string"),
    SaLifeTime: pulumi.Float64(0),
    SaLifeTimeBytes: pulumi.Float64(0),
    },
    VpcId: pulumi.String("string"),
    VpnGatewayId: pulumi.String("string"),
    Name: pulumi.String("string"),
    Remark: pulumi.String("string"),
    Tag: pulumi.String("string"),
    VpnConnectionId: pulumi.String("string"),
    })
    
    var vpnConnectionResource = new VpnConnection("vpnConnectionResource", VpnConnectionArgs.builder()
        .customerGatewayId("string")
        .ikeConfig(VpnConnectionIkeConfigArgs.builder()
            .preSharedKey("string")
            .authenticationAlgorithm("string")
            .dhGroup("string")
            .encryptionAlgorithm("string")
            .exchangeMode("string")
            .ikeVersion("string")
            .localId("string")
            .remoteId("string")
            .saLifeTime(0)
            .build())
        .ipsecConfig(VpnConnectionIpsecConfigArgs.builder()
            .localSubnetIds("string")
            .remoteSubnets("string")
            .authenticationAlgorithm("string")
            .encryptionAlgorithm("string")
            .pfsDhGroup("string")
            .protocol("string")
            .saLifeTime(0)
            .saLifeTimeBytes(0)
            .build())
        .vpcId("string")
        .vpnGatewayId("string")
        .name("string")
        .remark("string")
        .tag("string")
        .vpnConnectionId("string")
        .build());
    
    vpn_connection_resource = ucloud.VpnConnection("vpnConnectionResource",
        customer_gateway_id="string",
        ike_config={
            "pre_shared_key": "string",
            "authentication_algorithm": "string",
            "dh_group": "string",
            "encryption_algorithm": "string",
            "exchange_mode": "string",
            "ike_version": "string",
            "local_id": "string",
            "remote_id": "string",
            "sa_life_time": 0,
        },
        ipsec_config={
            "local_subnet_ids": ["string"],
            "remote_subnets": ["string"],
            "authentication_algorithm": "string",
            "encryption_algorithm": "string",
            "pfs_dh_group": "string",
            "protocol": "string",
            "sa_life_time": 0,
            "sa_life_time_bytes": 0,
        },
        vpc_id="string",
        vpn_gateway_id="string",
        name="string",
        remark="string",
        tag="string",
        vpn_connection_id="string")
    
    const vpnConnectionResource = new ucloud.VpnConnection("vpnConnectionResource", {
        customerGatewayId: "string",
        ikeConfig: {
            preSharedKey: "string",
            authenticationAlgorithm: "string",
            dhGroup: "string",
            encryptionAlgorithm: "string",
            exchangeMode: "string",
            ikeVersion: "string",
            localId: "string",
            remoteId: "string",
            saLifeTime: 0,
        },
        ipsecConfig: {
            localSubnetIds: ["string"],
            remoteSubnets: ["string"],
            authenticationAlgorithm: "string",
            encryptionAlgorithm: "string",
            pfsDhGroup: "string",
            protocol: "string",
            saLifeTime: 0,
            saLifeTimeBytes: 0,
        },
        vpcId: "string",
        vpnGatewayId: "string",
        name: "string",
        remark: "string",
        tag: "string",
        vpnConnectionId: "string",
    });
    
    type: ucloud:VpnConnection
    properties:
        customerGatewayId: string
        ikeConfig:
            authenticationAlgorithm: string
            dhGroup: string
            encryptionAlgorithm: string
            exchangeMode: string
            ikeVersion: string
            localId: string
            preSharedKey: string
            remoteId: string
            saLifeTime: 0
        ipsecConfig:
            authenticationAlgorithm: string
            encryptionAlgorithm: string
            localSubnetIds:
                - string
            pfsDhGroup: string
            protocol: string
            remoteSubnets:
                - string
            saLifeTime: 0
            saLifeTimeBytes: 0
        name: string
        remark: string
        tag: string
        vpcId: string
        vpnConnectionId: string
        vpnGatewayId: string
    

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

    CustomerGatewayId string
    The grade of the VPN Gateway
    IkeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    IpsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    VpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    VpnGatewayId string
    The ID of the VPN Customer Gateway.
    Name string
    Remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    Tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    CustomerGatewayId string
    The grade of the VPN Gateway
    IkeConfig VpnConnectionIkeConfigArgs
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    IpsecConfig VpnConnectionIpsecConfigArgs
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    VpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    VpnGatewayId string
    The ID of the VPN Customer Gateway.
    Name string
    Remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    Tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    customerGatewayId String
    The grade of the VPN Gateway
    ikeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    vpcId String
    The ID of VPC linked to the VPN Gateway Connection.
    vpnGatewayId String
    The ID of the VPN Customer Gateway.
    name String
    remark String
    The remarks of the VPN Gateway Connection. (Default: "").
    tag String
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpnConnectionId String
    The ID of the resource VPN Gateway Connection.
    customerGatewayId string
    The grade of the VPN Gateway
    ikeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    vpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    vpnGatewayId string
    The ID of the VPN Customer Gateway.
    name string
    remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    customer_gateway_id str
    The grade of the VPN Gateway
    ike_config VpnConnectionIkeConfigArgs
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsec_config VpnConnectionIpsecConfigArgs
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    vpc_id str
    The ID of VPC linked to the VPN Gateway Connection.
    vpn_gateway_id str
    The ID of the VPN Customer Gateway.
    name str
    remark str
    The remarks of the VPN Gateway Connection. (Default: "").
    tag str
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpn_connection_id str
    The ID of the resource VPN Gateway Connection.
    customerGatewayId String
    The grade of the VPN Gateway
    ikeConfig Property Map
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig Property Map
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    vpcId String
    The ID of VPC linked to the VPN Gateway Connection.
    vpnGatewayId String
    The ID of the VPN Customer Gateway.
    name String
    remark String
    The remarks of the VPN Gateway Connection. (Default: "").
    tag String
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpnConnectionId String
    The ID of the resource VPN Gateway Connection.

    Outputs

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

    CreateTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.
    createTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    id string
    The provider-assigned unique ID for this managed resource.
    create_time str
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    id str
    The provider-assigned unique ID for this managed resource.
    createTime String
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VpnConnection Resource

    Get an existing VpnConnection 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?: VpnConnectionState, opts?: CustomResourceOptions): VpnConnection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            customer_gateway_id: Optional[str] = None,
            ike_config: Optional[VpnConnectionIkeConfigArgs] = None,
            ipsec_config: Optional[VpnConnectionIpsecConfigArgs] = None,
            name: Optional[str] = None,
            remark: Optional[str] = None,
            tag: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vpn_connection_id: Optional[str] = None,
            vpn_gateway_id: Optional[str] = None) -> VpnConnection
    func GetVpnConnection(ctx *Context, name string, id IDInput, state *VpnConnectionState, opts ...ResourceOption) (*VpnConnection, error)
    public static VpnConnection Get(string name, Input<string> id, VpnConnectionState? state, CustomResourceOptions? opts = null)
    public static VpnConnection get(String name, Output<String> id, VpnConnectionState state, CustomResourceOptions options)
    resources:  _:    type: ucloud:VpnConnection    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreateTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    CustomerGatewayId string
    The grade of the VPN Gateway
    IkeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    IpsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    Name string
    Remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    Tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    VpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    VpnGatewayId string
    The ID of the VPN Customer Gateway.
    CreateTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    CustomerGatewayId string
    The grade of the VPN Gateway
    IkeConfig VpnConnectionIkeConfigArgs
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    IpsecConfig VpnConnectionIpsecConfigArgs
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    Name string
    Remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    Tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    VpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    VpnGatewayId string
    The ID of the VPN Customer Gateway.
    createTime String
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    customerGatewayId String
    The grade of the VPN Gateway
    ikeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    name String
    remark String
    The remarks of the VPN Gateway Connection. (Default: "").
    tag String
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpcId String
    The ID of VPC linked to the VPN Gateway Connection.
    vpnConnectionId String
    The ID of the resource VPN Gateway Connection.
    vpnGatewayId String
    The ID of the VPN Customer Gateway.
    createTime string
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    customerGatewayId string
    The grade of the VPN Gateway
    ikeConfig VpnConnectionIkeConfig
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig VpnConnectionIpsecConfig
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    name string
    remark string
    The remarks of the VPN Gateway Connection. (Default: "").
    tag string
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpcId string
    The ID of VPC linked to the VPN Gateway Connection.
    vpnConnectionId string
    The ID of the resource VPN Gateway Connection.
    vpnGatewayId string
    The ID of the VPN Customer Gateway.
    create_time str
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    customer_gateway_id str
    The grade of the VPN Gateway
    ike_config VpnConnectionIkeConfigArgs
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsec_config VpnConnectionIpsecConfigArgs
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    name str
    remark str
    The remarks of the VPN Gateway Connection. (Default: "").
    tag str
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpc_id str
    The ID of VPC linked to the VPN Gateway Connection.
    vpn_connection_id str
    The ID of the resource VPN Gateway Connection.
    vpn_gateway_id str
    The ID of the VPN Customer Gateway.
    createTime String
    The creation time for VPN Gateway Connection, formatted in RFC3339 time string.
    customerGatewayId String
    The grade of the VPN Gateway
    ikeConfig Property Map
    The configurations of IKE negotiation. Each ike_config supports fields documented below.
    ipsecConfig Property Map
    The configurations of IPSec negotiation. Each ipsec_config supports fields documented below.


    name String
    remark String
    The remarks of the VPN Gateway Connection. (Default: "").
    tag String
    A tag assigned to VPN Gateway Connection, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vpcId String
    The ID of VPC linked to the VPN Gateway Connection.
    vpnConnectionId String
    The ID of the resource VPN Gateway Connection.
    vpnGatewayId String
    The ID of the VPN Customer Gateway.

    Supporting Types

    VpnConnectionIkeConfig, VpnConnectionIkeConfigArgs

    PreSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    AuthenticationAlgorithm string
    DhGroup string
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    EncryptionAlgorithm string
    ExchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    IkeVersion string
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    LocalId string
    The identification of the VPN gateway.
    RemoteId string
    The identification of the Customer gateway.
    SaLifeTime double
    PreSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    AuthenticationAlgorithm string
    DhGroup string
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    EncryptionAlgorithm string
    ExchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    IkeVersion string
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    LocalId string
    The identification of the VPN gateway.
    RemoteId string
    The identification of the Customer gateway.
    SaLifeTime float64
    preSharedKey String
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    authenticationAlgorithm String
    dhGroup String
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    encryptionAlgorithm String
    exchangeMode String
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    ikeVersion String
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    localId String
    The identification of the VPN gateway.
    remoteId String
    The identification of the Customer gateway.
    saLifeTime Double
    preSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    authenticationAlgorithm string
    dhGroup string
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    encryptionAlgorithm string
    exchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    ikeVersion string
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    localId string
    The identification of the VPN gateway.
    remoteId string
    The identification of the Customer gateway.
    saLifeTime number
    pre_shared_key str
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    authentication_algorithm str
    dh_group str
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    encryption_algorithm str
    exchange_mode str
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    ike_version str
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    local_id str
    The identification of the VPN gateway.
    remote_id str
    The identification of the Customer gateway.
    sa_life_time float
    preSharedKey String
    The key used for authentication between the VPN gateway and the Customer gateway which contains 1-128 characters and only support English, numbers and special characters: !@#$%^&*()_+-=[]:,./'~.
    authenticationAlgorithm String
    dhGroup String
    The Diffie-Hellman group used by IKE negotiation. Possible values: 1, 2, 5, 14, 15, 16. (Default:15)
    encryptionAlgorithm String
    exchangeMode String
    The negotiation exchange mode of IKE V1 of VPN gateway. Possible values: main (main mode), aggressive (aggressive mode). (Default: main)
    ikeVersion String
    The version of the IKE protocol which only be supported IKE V1 protocol at present. Possible values: ikev1. (Default: ikev1)
    localId String
    The identification of the VPN gateway.
    remoteId String
    The identification of the Customer gateway.
    saLifeTime Number

    VpnConnectionIpsecConfig, VpnConnectionIpsecConfigArgs

    LocalSubnetIds List<string>
    The id list of Local subnet.
    RemoteSubnets List<string>
    The ip address list of remote subnet.
    AuthenticationAlgorithm string
    EncryptionAlgorithm string
    PfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    Protocol string
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    SaLifeTime double
    SaLifeTimeBytes double
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)
    LocalSubnetIds []string
    The id list of Local subnet.
    RemoteSubnets []string
    The ip address list of remote subnet.
    AuthenticationAlgorithm string
    EncryptionAlgorithm string
    PfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    Protocol string
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    SaLifeTime float64
    SaLifeTimeBytes float64
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)
    localSubnetIds List<String>
    The id list of Local subnet.
    remoteSubnets List<String>
    The ip address list of remote subnet.
    authenticationAlgorithm String
    encryptionAlgorithm String
    pfsDhGroup String
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    protocol String
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    saLifeTime Double
    saLifeTimeBytes Double
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)
    localSubnetIds string[]
    The id list of Local subnet.
    remoteSubnets string[]
    The ip address list of remote subnet.
    authenticationAlgorithm string
    encryptionAlgorithm string
    pfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    protocol string
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    saLifeTime number
    saLifeTimeBytes number
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)
    local_subnet_ids Sequence[str]
    The id list of Local subnet.
    remote_subnets Sequence[str]
    The ip address list of remote subnet.
    authentication_algorithm str
    encryption_algorithm str
    pfs_dh_group str
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    protocol str
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    sa_life_time float
    sa_life_time_bytes float
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)
    localSubnetIds List<String>
    The id list of Local subnet.
    remoteSubnets List<String>
    The ip address list of remote subnet.
    authenticationAlgorithm String
    encryptionAlgorithm String
    pfsDhGroup String
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open. Possible values: disable, 1, 2, 5, 14, 15, 16. (Default:disable)
    protocol String
    The security protocol of IPSec negotiation. Possible values: esp, ah. (Default:esp)
    saLifeTime Number
    saLifeTimeBytes Number
    The Security Association lifecycle in bytes as the result of IPSec negotiation. Unit: second. Range: 1200-604800. (Default: 3600)

    Import

    VPN Connection can be imported using the id, e.g.

    $ pulumi import ucloud:index/vpnConnection:VpnConnection example vpntunnel-abc123456
    

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

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud