1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpn
  5. CustomerGateway
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.vpn.CustomerGateway

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    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}
    

    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, Any]] = 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 string
    The unique name of the resource.
    args CustomerGatewayArgs
    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 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 string
    The unique name of the resource.
    args CustomerGatewayArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomerGatewayArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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", "any" },
        },
    });
    
    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.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var customerGatewayResource = new CustomerGateway("customerGatewayResource", CustomerGatewayArgs.builder()
        .ipAddress("string")
        .asn("string")
        .customerGatewayName("string")
        .description("string")
        .tags(Map.of("string", "any"))
        .build());
    
    customer_gateway_resource = alicloud.vpn.CustomerGateway("customerGatewayResource",
        ip_address="string",
        asn="string",
        customer_gateway_name="string",
        description="string",
        tags={
            "string": "any",
        })
    
    const customerGatewayResource = new alicloud.vpn.CustomerGateway("customerGatewayResource", {
        ipAddress: "string",
        asn: "string",
        customerGatewayName: "string",
        description: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:vpn:CustomerGateway
    properties:
        asn: string
        customerGatewayName: string
        description: string
        ipAddress: string
        tags:
            string: any
    

    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

    The CustomerGateway resource accepts the following input properties:

    IpAddress string
    The IP address of the customer gateway.
    Asn 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, object>

    tag.

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

    IpAddress string
    The IP address of the customer gateway.
    Asn 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]interface{}

    tag.

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

    ipAddress String
    The IP address of the customer gateway.
    asn 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,Object>

    tag.

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

    ipAddress string
    The IP address of the customer gateway.
    asn 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]: any}

    tag.

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

    ip_address str
    The IP address of the customer gateway.
    asn 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, Any]

    tag.

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

    ipAddress String
    The IP address of the customer gateway.
    asn 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<Any>

    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, Any]] = 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Asn 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 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, object>

    tag.

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

    Asn 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 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]interface{}

    tag.

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

    asn 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 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,Object>

    tag.

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

    asn 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 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]: any}

    tag.

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

    asn 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 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, Any]

    tag.

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

    asn 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 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<Any>

    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>
    

    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
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi