@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
189 lines • 8.35 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Connection = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Creates and manages Scaleway Site-to-Site VPN Connections.
* A connection links a Scaleway VPN Gateway to a Customer Gateway and establishes an IPSec tunnel with BGP routing.
*
* For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/).
*
* ## Example Usage
*
* ### Basic Connection
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const vpc = new scaleway.network.Vpc("vpc", {name: "my-vpc"});
* const pn = new scaleway.network.PrivateNetwork("pn", {
* name: "my-private-network",
* vpcId: vpc.id,
* ipv4Subnet: {
* subnet: "10.0.1.0/24",
* },
* });
* const gateway = new scaleway.s2svpn.Gateway("gateway", {
* name: "my-vpn-gateway",
* gatewayType: "VGW-S",
* privateNetworkId: pn.id,
* });
* const customerGw = new scaleway.s2svpn.CustomerGateway("customer_gw", {
* name: "my-customer-gateway",
* ipv4Public: "203.0.113.1",
* asn: 65000,
* });
* const policy = new scaleway.s2svpn.RoutingPolicy("policy", {
* name: "my-routing-policy",
* prefixFilterIns: ["10.0.2.0/24"],
* prefixFilterOuts: ["10.0.1.0/24"],
* });
* const main = new scaleway.s2svpn.Connection("main", {
* name: "my-vpn-connection",
* vpnGatewayId: gateway.id,
* customerGatewayId: customerGw.id,
* initiationPolicy: "customer_gateway",
* enableRoutePropagation: true,
* bgpConfigIpv4s: [{
* routingPolicyId: policy.id,
* privateIp: "169.254.0.1/30",
* peerPrivateIp: "169.254.0.2/30",
* }],
* ikev2Ciphers: [{
* encryption: "aes256",
* integrity: "sha256",
* dhGroup: "modp2048",
* }],
* espCiphers: [{
* encryption: "aes256",
* integrity: "sha256",
* dhGroup: "modp2048",
* }],
* });
* ```
*
* ## Import
*
* Connections can be imported using `{region}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:s2svpn/connection:Connection main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class Connection extends pulumi.CustomResource {
/**
* Get an existing Connection 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, id, state, opts) {
return new Connection(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:s2svpn/connection:Connection';
/**
* Returns true if the given object is an instance of Connection. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Connection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bgpConfigIpv4s"] = state?.bgpConfigIpv4s;
resourceInputs["bgpConfigIpv6s"] = state?.bgpConfigIpv6s;
resourceInputs["bgpSessionIpv4s"] = state?.bgpSessionIpv4s;
resourceInputs["bgpSessionIpv6s"] = state?.bgpSessionIpv6s;
resourceInputs["bgpStatusIpv4"] = state?.bgpStatusIpv4;
resourceInputs["bgpStatusIpv6"] = state?.bgpStatusIpv6;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["customerGatewayId"] = state?.customerGatewayId;
resourceInputs["enableRoutePropagation"] = state?.enableRoutePropagation;
resourceInputs["espCiphers"] = state?.espCiphers;
resourceInputs["ikev2Ciphers"] = state?.ikev2Ciphers;
resourceInputs["initiationPolicy"] = state?.initiationPolicy;
resourceInputs["isIpv6"] = state?.isIpv6;
resourceInputs["name"] = state?.name;
resourceInputs["organizationId"] = state?.organizationId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["routePropagationEnabled"] = state?.routePropagationEnabled;
resourceInputs["secretId"] = state?.secretId;
resourceInputs["secretVersion"] = state?.secretVersion;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tunnelStatus"] = state?.tunnelStatus;
resourceInputs["updatedAt"] = state?.updatedAt;
resourceInputs["vpnGatewayId"] = state?.vpnGatewayId;
}
else {
const args = argsOrState;
resourceInputs["bgpConfigIpv4s"] = args?.bgpConfigIpv4s;
resourceInputs["bgpConfigIpv6s"] = args?.bgpConfigIpv6s;
resourceInputs["customerGatewayId"] = args?.customerGatewayId;
resourceInputs["enableRoutePropagation"] = args?.enableRoutePropagation;
resourceInputs["espCiphers"] = args?.espCiphers;
resourceInputs["ikev2Ciphers"] = args?.ikev2Ciphers;
resourceInputs["initiationPolicy"] = args?.initiationPolicy;
resourceInputs["isIpv6"] = args?.isIpv6;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpnGatewayId"] = args?.vpnGatewayId;
resourceInputs["bgpSessionIpv4s"] = undefined /*out*/;
resourceInputs["bgpSessionIpv6s"] = undefined /*out*/;
resourceInputs["bgpStatusIpv4"] = undefined /*out*/;
resourceInputs["bgpStatusIpv6"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["routePropagationEnabled"] = undefined /*out*/;
resourceInputs["secretId"] = undefined /*out*/;
resourceInputs["secretVersion"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tunnelStatus"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Connection.__pulumiType, name, resourceInputs, opts);
}
}
exports.Connection = Connection;
//# sourceMappingURL=connection.js.map