UNPKG

@pulumi/gcp

Version:

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

359 lines • 14.8 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a VPN gateway managed outside of GCP. * * To get more information about ExternalVpnGateway, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/externalVpnGateways) * * ## Example Usage * * ### External Vpn Gateway * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "network-1", * routingMode: "GLOBAL", * autoCreateSubnetworks: false, * }); * const haGateway = new gcp.compute.HaVpnGateway("ha_gateway", { * region: "us-central1", * name: "ha-vpn", * network: network.id, * }); * const externalGateway = new gcp.compute.ExternalVpnGateway("external_gateway", { * name: "external-gateway", * redundancyType: "SINGLE_IP_INTERNALLY_REDUNDANT", * description: "An externally managed VPN gateway", * interfaces: [{ * id: 0, * ipAddress: "8.8.8.8", * }], * }); * const networkSubnet1 = new gcp.compute.Subnetwork("network_subnet1", { * name: "ha-vpn-subnet-1", * ipCidrRange: "10.0.1.0/24", * region: "us-central1", * network: network.id, * }); * const networkSubnet2 = new gcp.compute.Subnetwork("network_subnet2", { * name: "ha-vpn-subnet-2", * ipCidrRange: "10.0.2.0/24", * region: "us-west1", * network: network.id, * }); * const router1 = new gcp.compute.Router("router1", { * name: "ha-vpn-router1", * network: network.name, * bgp: { * asn: 64514, * }, * }); * const tunnel1 = new gcp.compute.VPNTunnel("tunnel1", { * name: "ha-vpn-tunnel1", * region: "us-central1", * vpnGateway: haGateway.id, * peerExternalGateway: externalGateway.id, * peerExternalGatewayInterface: 0, * sharedSecret: "a secret message", * router: router1.id, * vpnGatewayInterface: 0, * }); * const tunnel2 = new gcp.compute.VPNTunnel("tunnel2", { * name: "ha-vpn-tunnel2", * region: "us-central1", * vpnGateway: haGateway.id, * peerExternalGateway: externalGateway.id, * peerExternalGatewayInterface: 0, * sharedSecret: "a secret message", * router: pulumi.interpolate` ${router1.id}`, * vpnGatewayInterface: 1, * }); * const router1Interface1 = new gcp.compute.RouterInterface("router1_interface1", { * name: "router1-interface1", * router: router1.name, * region: "us-central1", * ipRange: "169.254.0.1/30", * vpnTunnel: tunnel1.name, * }); * const router1Peer1 = new gcp.compute.RouterPeer("router1_peer1", { * name: "router1-peer1", * router: router1.name, * region: "us-central1", * peerIpAddress: "169.254.0.2", * peerAsn: 64515, * advertisedRoutePriority: 100, * "interface": router1Interface1.name, * }); * const router1Interface2 = new gcp.compute.RouterInterface("router1_interface2", { * name: "router1-interface2", * router: router1.name, * region: "us-central1", * ipRange: "169.254.1.1/30", * vpnTunnel: tunnel2.name, * }); * const router1Peer2 = new gcp.compute.RouterPeer("router1_peer2", { * name: "router1-peer2", * router: router1.name, * region: "us-central1", * peerIpAddress: "169.254.1.2", * peerAsn: 64515, * advertisedRoutePriority: 100, * "interface": router1Interface2.name, * }); * ``` * * ## Import * * ExternalVpnGateway can be imported using any of these accepted formats: * * * `projects/{{project}}/global/externalVpnGateways/{{name}}` * * `{{project}}/{{name}}` * * `{{name}}` * * When using the `pulumi import` command, ExternalVpnGateway can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default projects/{{project}}/global/externalVpnGateways/{{name}} * $ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default {{project}}/{{name}} * $ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default {{name}} * ``` */ export declare class ExternalVpnGateway extends pulumi.CustomResource { /** * Get an existing ExternalVpnGateway 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?: ExternalVpnGatewayState, opts?: pulumi.CustomResourceOptions): ExternalVpnGateway; /** * Returns true if the given object is an instance of ExternalVpnGateway. 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 ExternalVpnGateway; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * 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; }>; /** * A list of interfaces on this external VPN gateway. * Structure is documented below. */ readonly interfaces: pulumi.Output<outputs.compute.ExternalVpnGatewayInterface[] | undefined>; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ readonly labelFingerprint: pulumi.Output<string>; /** * Labels for the external VPN gateway resource. * **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>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ readonly params: pulumi.Output<outputs.compute.ExternalVpnGatewayParams | undefined>; /** * 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; }>; /** * Indicates the redundancy type of this external VPN gateway * Possible values are: `FOUR_IPS_REDUNDANCY`, `SINGLE_IP_INTERNALLY_REDUNDANT`, `TWO_IPS_REDUNDANCY`. */ readonly redundancyType: pulumi.Output<string | undefined>; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output<string>; /** * Create a ExternalVpnGateway 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?: ExternalVpnGatewayArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ExternalVpnGateway resources. */ export interface ExternalVpnGatewayState { /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * An optional description of this resource. */ description?: pulumi.Input<string | undefined>; /** * 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>; } | undefined>; /** * A list of interfaces on this external VPN gateway. * Structure is documented below. */ interfaces?: pulumi.Input<pulumi.Input<inputs.compute.ExternalVpnGatewayInterface>[] | undefined>; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ labelFingerprint?: pulumi.Input<string | undefined>; /** * Labels for the external VPN gateway resource. * **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>; } | 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. */ name?: pulumi.Input<string | undefined>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ params?: pulumi.Input<inputs.compute.ExternalVpnGatewayParams | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; } | undefined>; /** * Indicates the redundancy type of this external VPN gateway * Possible values are: `FOUR_IPS_REDUNDANCY`, `SINGLE_IP_INTERNALLY_REDUNDANT`, `TWO_IPS_REDUNDANCY`. */ redundancyType?: pulumi.Input<string | undefined>; /** * The URI of the created resource. */ selfLink?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a ExternalVpnGateway resource. */ export interface ExternalVpnGatewayArgs { /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * An optional description of this resource. */ description?: pulumi.Input<string | undefined>; /** * A list of interfaces on this external VPN gateway. * Structure is documented below. */ interfaces?: pulumi.Input<pulumi.Input<inputs.compute.ExternalVpnGatewayInterface>[] | undefined>; /** * Labels for the external VPN gateway resource. * **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>; } | 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. */ name?: pulumi.Input<string | undefined>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ params?: pulumi.Input<inputs.compute.ExternalVpnGatewayParams | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * Indicates the redundancy type of this external VPN gateway * Possible values are: `FOUR_IPS_REDUNDANCY`, `SINGLE_IP_INTERNALLY_REDUNDANT`, `TWO_IPS_REDUNDANCY`. */ redundancyType?: pulumi.Input<string | undefined>; } //# sourceMappingURL=externalVpnGateway.d.ts.map