1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpn
  5. CustomerGateway
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.vpn.CustomerGateway

Explore with Pulumi AI

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") || "terraform-example";
const _default = new alicloud.vpn.CustomerGateway("default", {
    description: name,
    ipAddress: "4.3.2.10",
    asn: "1219002",
    customerGatewayName: name,
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = alicloud.vpn.CustomerGateway("default",
    description=name,
    ip_address="4.3.2.10",
    asn="1219002",
    customer_gateway_name=name)
Copy
package main

import (
	"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 := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_, err := vpn.NewCustomerGateway(ctx, "default", &vpn.CustomerGatewayArgs{
			Description:         pulumi.String(name),
			IpAddress:           pulumi.String("4.3.2.10"),
			Asn:                 pulumi.String("1219002"),
			CustomerGatewayName: pulumi.String(name),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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") ?? "terraform-example";
    var @default = new AliCloud.Vpn.CustomerGateway("default", new()
    {
        Description = name,
        IpAddress = "4.3.2.10",
        Asn = "1219002",
        CustomerGatewayName = name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpn.CustomerGateway;
import com.pulumi.alicloud.vpn.CustomerGatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        var default_ = new CustomerGateway("default", CustomerGatewayArgs.builder()
            .description(name)
            .ipAddress("4.3.2.10")
            .asn("1219002")
            .customerGatewayName(name)
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: alicloud:vpn:CustomerGateway
    properties:
      description: ${name}
      ipAddress: 4.3.2.10
      asn: '1219002'
      customerGatewayName: ${name}
Copy

Create CustomerGateway Resource

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

Constructor syntax

new CustomerGateway(name: string, args: CustomerGatewayArgs, opts?: CustomResourceOptions);
@overload
def CustomerGateway(resource_name: str,
                    args: CustomerGatewayArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def CustomerGateway(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    ip_address: Optional[str] = None,
                    asn: Optional[str] = None,
                    customer_gateway_name: Optional[str] = None,
                    description: Optional[str] = None,
                    name: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None)
func NewCustomerGateway(ctx *Context, name string, args CustomerGatewayArgs, opts ...ResourceOption) (*CustomerGateway, error)
public CustomerGateway(string name, CustomerGatewayArgs args, CustomResourceOptions? opts = null)
public CustomerGateway(String name, CustomerGatewayArgs args)
public CustomerGateway(String name, CustomerGatewayArgs args, CustomResourceOptions options)
type: alicloud:vpn:CustomerGateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CustomerGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CustomerGatewayArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CustomerGatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CustomerGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CustomerGatewayArgs
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 customerGatewayResource = new AliCloud.Vpn.CustomerGateway("customerGatewayResource", new()
{
    IpAddress = "string",
    Asn = "string",
    CustomerGatewayName = "string",
    Description = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := vpn.NewCustomerGateway(ctx, "customerGatewayResource", &vpn.CustomerGatewayArgs{
	IpAddress:           pulumi.String("string"),
	Asn:                 pulumi.String("string"),
	CustomerGatewayName: pulumi.String("string"),
	Description:         pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var customerGatewayResource = new CustomerGateway("customerGatewayResource", CustomerGatewayArgs.builder()
    .ipAddress("string")
    .asn("string")
    .customerGatewayName("string")
    .description("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
customer_gateway_resource = alicloud.vpn.CustomerGateway("customerGatewayResource",
    ip_address="string",
    asn="string",
    customer_gateway_name="string",
    description="string",
    tags={
        "string": "string",
    })
Copy
const customerGatewayResource = new alicloud.vpn.CustomerGateway("customerGatewayResource", {
    ipAddress: "string",
    asn: "string",
    customerGatewayName: "string",
    description: "string",
    tags: {
        string: "string",
    },
});
Copy
type: alicloud:vpn:CustomerGateway
properties:
    asn: string
    customerGatewayName: string
    description: string
    ipAddress: string
    tags:
        string: string
Copy

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

IpAddress
This property is required.
Changes to this property will trigger replacement.
string
The IP address of the customer gateway.
Asn Changes to this property will trigger replacement. string
Asn.
CustomerGatewayName string
The name of the customer gateway.
Description string
The description of the customer gateway.
Name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

Tags Dictionary<string, string>

tag.

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

IpAddress
This property is required.
Changes to this property will trigger replacement.
string
The IP address of the customer gateway.
Asn Changes to this property will trigger replacement. string
Asn.
CustomerGatewayName string
The name of the customer gateway.
Description string
The description of the customer gateway.
Name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

Tags map[string]string

tag.

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

ipAddress
This property is required.
Changes to this property will trigger replacement.
String
The IP address of the customer gateway.
asn Changes to this property will trigger replacement. String
Asn.
customerGatewayName String
The name of the customer gateway.
description String
The description of the customer gateway.
name String
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Map<String,String>

tag.

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

ipAddress
This property is required.
Changes to this property will trigger replacement.
string
The IP address of the customer gateway.
asn Changes to this property will trigger replacement. string
Asn.
customerGatewayName string
The name of the customer gateway.
description string
The description of the customer gateway.
name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags {[key: string]: string}

tag.

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

ip_address
This property is required.
Changes to this property will trigger replacement.
str
The IP address of the customer gateway.
asn Changes to this property will trigger replacement. str
Asn.
customer_gateway_name str
The name of the customer gateway.
description str
The description of the customer gateway.
name str
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Mapping[str, str]

tag.

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

ipAddress
This property is required.
Changes to this property will trigger replacement.
String
The IP address of the customer gateway.
asn Changes to this property will trigger replacement. String
Asn.
customerGatewayName String
The name of the customer gateway.
description String
The description of the customer gateway.
name String
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Map<String>

tag.

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 CustomerGateway resource produces the following output properties:

CreateTime int
The time when the customer gateway was created.
Id string
The provider-assigned unique ID for this managed resource.
CreateTime int
The time when the customer gateway was created.
Id string
The provider-assigned unique ID for this managed resource.
createTime Integer
The time when the customer gateway was created.
id String
The provider-assigned unique ID for this managed resource.
createTime number
The time when the customer gateway was created.
id string
The provider-assigned unique ID for this managed resource.
create_time int
The time when the customer gateway was created.
id str
The provider-assigned unique ID for this managed resource.
createTime Number
The time when the customer gateway was created.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing CustomerGateway Resource

Get an existing CustomerGateway 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?: CustomerGatewayState, opts?: CustomResourceOptions): CustomerGateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        asn: Optional[str] = None,
        create_time: Optional[int] = None,
        customer_gateway_name: Optional[str] = None,
        description: Optional[str] = None,
        ip_address: Optional[str] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> CustomerGateway
func GetCustomerGateway(ctx *Context, name string, id IDInput, state *CustomerGatewayState, opts ...ResourceOption) (*CustomerGateway, error)
public static CustomerGateway Get(string name, Input<string> id, CustomerGatewayState? state, CustomResourceOptions? opts = null)
public static CustomerGateway get(String name, Output<String> id, CustomerGatewayState state, CustomResourceOptions options)
resources:  _:    type: alicloud:vpn:CustomerGateway    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Asn Changes to this property will trigger replacement. string
Asn.
CreateTime int
The time when the customer gateway was created.
CustomerGatewayName string
The name of the customer gateway.
Description string
The description of the customer gateway.
IpAddress Changes to this property will trigger replacement. string
The IP address of the customer gateway.
Name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

Tags Dictionary<string, string>

tag.

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

Asn Changes to this property will trigger replacement. string
Asn.
CreateTime int
The time when the customer gateway was created.
CustomerGatewayName string
The name of the customer gateway.
Description string
The description of the customer gateway.
IpAddress Changes to this property will trigger replacement. string
The IP address of the customer gateway.
Name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

Tags map[string]string

tag.

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

asn Changes to this property will trigger replacement. String
Asn.
createTime Integer
The time when the customer gateway was created.
customerGatewayName String
The name of the customer gateway.
description String
The description of the customer gateway.
ipAddress Changes to this property will trigger replacement. String
The IP address of the customer gateway.
name String
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Map<String,String>

tag.

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

asn Changes to this property will trigger replacement. string
Asn.
createTime number
The time when the customer gateway was created.
customerGatewayName string
The name of the customer gateway.
description string
The description of the customer gateway.
ipAddress Changes to this property will trigger replacement. string
The IP address of the customer gateway.
name string
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags {[key: string]: string}

tag.

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

asn Changes to this property will trigger replacement. str
Asn.
create_time int
The time when the customer gateway was created.
customer_gateway_name str
The name of the customer gateway.
description str
The description of the customer gateway.
ip_address Changes to this property will trigger replacement. str
The IP address of the customer gateway.
name str
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Mapping[str, str]

tag.

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

asn Changes to this property will trigger replacement. String
Asn.
createTime Number
The time when the customer gateway was created.
customerGatewayName String
The name of the customer gateway.
description String
The description of the customer gateway.
ipAddress Changes to this property will trigger replacement. String
The IP address of the customer gateway.
name String
. Field 'name' has been deprecated from provider version 1.216.0. New field 'customer_gateway_name' instead.

Deprecated: Field 'name' has been deprecated since provider version 1.210.0. New field 'customer_gateway_name' instead.

tags Map<String>

tag.

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

Import

VPN customer gateway can be imported using the id, e.g.

$ pulumi import alicloud:vpn/customerGateway:CustomerGateway example <id>
Copy

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.