UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

400 lines (399 loc) • 15.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a VPN gateway running in GCP. This virtual device is managed * by Google, but used only by you. This type of VPN Gateway allows for the creation * of VPN solutions with higher availability than classic Target VPN Gateways. * * To get more information about HaVpnGateway, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/vpnGateways) * * How-to Guides * * [Choosing a VPN](https://cloud.google.com/vpn/docs/how-to/choosing-a-vpn) * * [Cloud VPN Overview](https://cloud.google.com/vpn/docs/concepts/overview) * * ## Example Usage * * ### Ha Vpn Gateway Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network1 = new gcp.compute.Network("network1", { * name: "network1", * autoCreateSubnetworks: false, * }); * const haGateway1 = new gcp.compute.HaVpnGateway("ha_gateway1", { * region: "us-central1", * name: "ha-vpn-1", * network: network1.id, * }); * ``` * ### Ha Vpn Gateway Ipv6 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network1 = new gcp.compute.Network("network1", { * name: "network1", * autoCreateSubnetworks: false, * }); * const haGateway1 = new gcp.compute.HaVpnGateway("ha_gateway1", { * region: "us-central1", * name: "ha-vpn-1", * network: network1.id, * stackType: "IPV4_IPV6", * labels: { * mykey: "myvalue", * }, * }); * ``` * ### Compute Ha Vpn Gateway Encrypted Interconnect * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "test-network", * autoCreateSubnetworks: false, * }); * const address1 = new gcp.compute.Address("address1", { * name: "test-address1", * addressType: "INTERNAL", * purpose: "IPSEC_INTERCONNECT", * address: "192.168.1.0", * prefixLength: 29, * network: network.selfLink, * }); * const router = new gcp.compute.Router("router", { * name: "test-router", * network: network.name, * encryptedInterconnectRouter: true, * bgp: { * asn: 16550, * }, * }); * const attachment1 = new gcp.compute.InterconnectAttachment("attachment1", { * name: "test-interconnect-attachment1", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1", * type: "PARTNER", * router: router.id, * encryption: "IPSEC", * ipsecInternalAddresses: [address1.selfLink], * }); * const address2 = new gcp.compute.Address("address2", { * name: "test-address2", * addressType: "INTERNAL", * purpose: "IPSEC_INTERCONNECT", * address: "192.168.2.0", * prefixLength: 29, * network: network.selfLink, * }); * const attachment2 = new gcp.compute.InterconnectAttachment("attachment2", { * name: "test-interconnect-attachment2", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_2", * type: "PARTNER", * router: router.id, * encryption: "IPSEC", * ipsecInternalAddresses: [address2.selfLink], * }); * const vpn_gateway = new gcp.compute.HaVpnGateway("vpn-gateway", { * name: "test-ha-vpngw", * network: network.id, * vpnInterfaces: [ * { * id: 0, * interconnectAttachment: attachment1.selfLink, * }, * { * id: 1, * interconnectAttachment: attachment2.selfLink, * }, * ], * }); * ``` * * ## Import * * HaVpnGateway can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/vpnGateways/{{name}}` * * * `{{project}}/{{region}}/{{name}}` * * * `{{region}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, HaVpnGateway can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default projects/{{project}}/regions/{{region}}/vpnGateways/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{name}} * ``` */ export declare class HaVpnGateway extends pulumi.CustomResource { /** * Get an existing HaVpnGateway resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HaVpnGatewayState, opts?: pulumi.CustomResourceOptions): HaVpnGateway; /** * Returns true if the given object is an instance of HaVpnGateway. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is HaVpnGateway; /** * An optional description of this resource. */ readonly description: pulumi.Output<string | undefined>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. * Default value is `IPV4`. * Possible values are: `IPV4`, `IPV6`. */ readonly gatewayIpVersion: pulumi.Output<string | undefined>; /** * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash * of the labels set used for optimistic locking. The fingerprint is initially generated by * Compute Engine and changes after every request to modify or update labels. * You must always provide an up-to-date fingerprint hash in order to update or change labels, * otherwise the request will fail with error 412 conditionNotMet. */ readonly labelFingerprint: pulumi.Output<string>; /** * Labels for this resource. These can only be added or modified by the setLabels method. * Each label key/value pair must comply with RFC1035. Label values may be empty. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ readonly name: pulumi.Output<string>; /** * The network this VPN gateway is accepting traffic for. */ readonly network: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * The region this gateway should sit in. */ readonly region: pulumi.Output<string>; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output<string>; /** * The stack type for this VPN gateway to identify the IP protocols that are enabled. * If not specified, IPV4_ONLY will be used. * Default value is `IPV4_ONLY`. * Possible values are: `IPV4_ONLY`, `IPV4_IPV6`, `IPV6_ONLY`. */ readonly stackType: pulumi.Output<string | undefined>; /** * A list of interfaces on this VPN gateway. * Structure is documented below. */ readonly vpnInterfaces: pulumi.Output<outputs.compute.HaVpnGatewayVpnInterface[]>; /** * Create a HaVpnGateway resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HaVpnGatewayArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HaVpnGateway resources. */ export interface HaVpnGatewayState { /** * An optional description of this resource. */ description?: pulumi.Input<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. * Default value is `IPV4`. * Possible values are: `IPV4`, `IPV6`. */ gatewayIpVersion?: pulumi.Input<string>; /** * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash * of the labels set used for optimistic locking. The fingerprint is initially generated by * Compute Engine and changes after every request to modify or update labels. * You must always provide an up-to-date fingerprint hash in order to update or change labels, * otherwise the request will fail with error 412 conditionNotMet. */ labelFingerprint?: pulumi.Input<string>; /** * Labels for this resource. These can only be added or modified by the setLabels method. * Each label key/value pair must comply with RFC1035. Label values may be empty. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input<string>; /** * The network this VPN gateway is accepting traffic for. */ network?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The region this gateway should sit in. */ region?: pulumi.Input<string>; /** * The URI of the created resource. */ selfLink?: pulumi.Input<string>; /** * The stack type for this VPN gateway to identify the IP protocols that are enabled. * If not specified, IPV4_ONLY will be used. * Default value is `IPV4_ONLY`. * Possible values are: `IPV4_ONLY`, `IPV4_IPV6`, `IPV6_ONLY`. */ stackType?: pulumi.Input<string>; /** * A list of interfaces on this VPN gateway. * Structure is documented below. */ vpnInterfaces?: pulumi.Input<pulumi.Input<inputs.compute.HaVpnGatewayVpnInterface>[]>; } /** * The set of arguments for constructing a HaVpnGateway resource. */ export interface HaVpnGatewayArgs { /** * An optional description of this resource. */ description?: pulumi.Input<string>; /** * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. * Default value is `IPV4`. * Possible values are: `IPV4`, `IPV6`. */ gatewayIpVersion?: pulumi.Input<string>; /** * Labels for this resource. These can only be added or modified by the setLabels method. * Each label key/value pair must comply with RFC1035. Label values may be empty. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input<string>; /** * The network this VPN gateway is accepting traffic for. */ network: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The region this gateway should sit in. */ region?: pulumi.Input<string>; /** * The stack type for this VPN gateway to identify the IP protocols that are enabled. * If not specified, IPV4_ONLY will be used. * Default value is `IPV4_ONLY`. * Possible values are: `IPV4_ONLY`, `IPV4_IPV6`, `IPV6_ONLY`. */ stackType?: pulumi.Input<string>; /** * A list of interfaces on this VPN gateway. * Structure is documented below. */ vpnInterfaces?: pulumi.Input<pulumi.Input<inputs.compute.HaVpnGatewayVpnInterface>[]>; }