@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
156 lines • 6.13 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.CustomerGateway = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Creates and manages Scaleway Site-to-Site VPN Customer Gateways.
* A customer gateway represents your external VPN endpoint (e.g., a firewall, router, or VPN appliance).
*
* For more information, see [the main documentation](https://www.scaleway.com/en/docs/site-to-site-vpn/reference-content/understanding-s2svpn/).
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const customerGw = new scaleway.s2svpn.CustomerGateway("customer_gw", {
* name: "my-customer-gateway",
* ipv4Public: "203.0.113.1",
* asn: 65000,
* });
* ```
*
* ### With IPv6
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const customerGw = new scaleway.s2svpn.CustomerGateway("customer_gw", {
* name: "my-customer-gateway",
* ipv4Public: "203.0.113.1",
* ipv6Public: "2001:db8::1",
* asn: 65000,
* });
* ```
*
* ### Using Instance Public IP
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const vpnEndpointIp = new scaleway.instance.Ip("vpn_endpoint_ip", {});
* const vpnEndpoint = new scaleway.instance.Server("vpn_endpoint", {
* name: "vpn-endpoint",
* type: "DEV1-S",
* image: "ubuntu_jammy",
* ipIds: [vpnEndpointIp.id],
* });
* const customerGw = new scaleway.s2svpn.CustomerGateway("customer_gw", {
* name: "my-customer-gateway",
* ipv4Public: vpnEndpointIp.address,
* asn: 65000,
* });
* ```
*
* ## Import
*
* Customer Gateways can be imported using `{region}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:s2svpn/customerGateway:CustomerGateway main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class CustomerGateway extends pulumi.CustomResource {
/**
* Get an existing CustomerGateway 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 CustomerGateway(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:s2svpn/customerGateway:CustomerGateway';
/**
* Returns true if the given object is an instance of CustomerGateway. 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'] === CustomerGateway.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["asn"] = state?.asn;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["ipv4Public"] = state?.ipv4Public;
resourceInputs["ipv6Public"] = state?.ipv6Public;
resourceInputs["name"] = state?.name;
resourceInputs["organizationId"] = state?.organizationId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.asn === undefined && !opts.urn) {
throw new Error("Missing required property 'asn'");
}
resourceInputs["asn"] = args?.asn;
resourceInputs["ipv4Public"] = args?.ipv4Public;
resourceInputs["ipv6Public"] = args?.ipv6Public;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["organizationId"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CustomerGateway.__pulumiType, name, resourceInputs, opts);
}
}
exports.CustomerGateway = CustomerGateway;
//# sourceMappingURL=customerGateway.js.map