UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

172 lines 7.79 kB
"use strict"; // *** 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.VpcPublicGatewayPatRule = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * Creates and manages Scaleway Public Gateway PAT (Port Address Translation). * For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/public-gateway/#pat-rules-e75d10). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const sg01 = new scaleway.instance.SecurityGroup("sg01", { * inboundDefaultPolicy: "drop", * outboundDefaultPolicy: "accept", * inboundRules: [{ * action: "accept", * port: 22, * protocol: "TCP", * }], * }); * const srv01 = new scaleway.instance.Server("srv01", { * name: "my-server", * type: "PLAY2-NANO", * image: "ubuntu_jammy", * securityGroupId: sg01.id, * }); * const pn01 = new scaleway.network.PrivateNetwork("pn01", {name: "my-pn"}); * const pnic01 = new scaleway.instance.PrivateNic("pnic01", { * serverId: srv01.id, * privateNetworkId: pn01.id, * }); * const dhcp01 = new scaleway.network.PublicGatewayDhcp("dhcp01", {subnet: "192.168.0.0/24"}); * const ip01 = new scaleway.network.PublicGatewayIp("ip01", {}); * const pg01 = new scaleway.network.PublicGateway("pg01", { * name: "my-pg", * type: "VPC-GW-S", * ipId: ip01.id, * }); * const gn01 = new scaleway.network.GatewayNetwork("gn01", { * gatewayId: pg01.id, * privateNetworkId: pn01.id, * dhcpId: dhcp01.id, * cleanupDhcp: true, * enableMasquerade: true, * }); * const rsv01 = new scaleway.network.PublicGatewayDhcpReservation("rsv01", { * gatewayNetworkId: gn01.id, * macAddress: pnic01.macAddress, * ipAddress: "192.168.0.7", * }); * // PAT rule for SSH traffic * const pat01 = new scaleway.network.PublicGatewayPatRule("pat01", { * gatewayId: pg01.id, * privateIp: rsv01.ipAddress, * privatePort: 22, * publicPort: 2202, * protocol: "tcp", * }); * ``` * * ## Import * * Public Gateway PAT rule configurations can be imported using `{zone}/{id}`, e.g. * * ```sh * $ pulumi import scaleway:index/vpcPublicGatewayPatRule:VpcPublicGatewayPatRule main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` * * @deprecated scaleway.index/vpcpublicgatewaypatrule.VpcPublicGatewayPatRule has been deprecated in favor of scaleway.network/publicgatewaypatrule.PublicGatewayPatRule */ class VpcPublicGatewayPatRule extends pulumi.CustomResource { /** * Get an existing VpcPublicGatewayPatRule 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) { pulumi.log.warn("VpcPublicGatewayPatRule is deprecated: scaleway.index/vpcpublicgatewaypatrule.VpcPublicGatewayPatRule has been deprecated in favor of scaleway.network/publicgatewaypatrule.PublicGatewayPatRule"); return new VpcPublicGatewayPatRule(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:index/vpcPublicGatewayPatRule:VpcPublicGatewayPatRule'; /** * Returns true if the given object is an instance of VpcPublicGatewayPatRule. 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'] === VpcPublicGatewayPatRule.__pulumiType; } /** @deprecated scaleway.index/vpcpublicgatewaypatrule.VpcPublicGatewayPatRule has been deprecated in favor of scaleway.network/publicgatewaypatrule.PublicGatewayPatRule */ constructor(name, argsOrState, opts) { pulumi.log.warn("VpcPublicGatewayPatRule is deprecated: scaleway.index/vpcpublicgatewaypatrule.VpcPublicGatewayPatRule has been deprecated in favor of scaleway.network/publicgatewaypatrule.PublicGatewayPatRule"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["gatewayId"] = state?.gatewayId; resourceInputs["organizationId"] = state?.organizationId; resourceInputs["privateIp"] = state?.privateIp; resourceInputs["privatePort"] = state?.privatePort; resourceInputs["protocol"] = state?.protocol; resourceInputs["publicPort"] = state?.publicPort; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; if (args?.gatewayId === undefined && !opts.urn) { throw new Error("Missing required property 'gatewayId'"); } if (args?.privateIp === undefined && !opts.urn) { throw new Error("Missing required property 'privateIp'"); } if (args?.privatePort === undefined && !opts.urn) { throw new Error("Missing required property 'privatePort'"); } if (args?.publicPort === undefined && !opts.urn) { throw new Error("Missing required property 'publicPort'"); } resourceInputs["gatewayId"] = args?.gatewayId; resourceInputs["privateIp"] = args?.privateIp; resourceInputs["privatePort"] = args?.privatePort; resourceInputs["protocol"] = args?.protocol; resourceInputs["publicPort"] = args?.publicPort; resourceInputs["zone"] = args?.zone; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["organizationId"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcPublicGatewayPatRule.__pulumiType, name, resourceInputs, opts); } } exports.VpcPublicGatewayPatRule = VpcPublicGatewayPatRule; //# sourceMappingURL=vpcPublicGatewayPatRule.js.map