UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

151 lines 7.12 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.VpcPublicGatewayPatRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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. * * bash * * ```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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.createdAt : undefined; resourceInputs["gatewayId"] = state ? state.gatewayId : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["privateIp"] = state ? state.privateIp : undefined; resourceInputs["privatePort"] = state ? state.privatePort : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["publicPort"] = state ? state.publicPort : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.gatewayId === undefined) && !opts.urn) { throw new Error("Missing required property 'gatewayId'"); } if ((!args || args.privateIp === undefined) && !opts.urn) { throw new Error("Missing required property 'privateIp'"); } if ((!args || args.privatePort === undefined) && !opts.urn) { throw new Error("Missing required property 'privatePort'"); } if ((!args || args.publicPort === undefined) && !opts.urn) { throw new Error("Missing required property 'publicPort'"); } resourceInputs["gatewayId"] = args ? args.gatewayId : undefined; resourceInputs["privateIp"] = args ? args.privateIp : undefined; resourceInputs["privatePort"] = args ? args.privatePort : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["publicPort"] = args ? args.publicPort : undefined; resourceInputs["zone"] = args ? args.zone : undefined; 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; /** @internal */ VpcPublicGatewayPatRule.__pulumiType = 'scaleway:index/vpcPublicGatewayPatRule:VpcPublicGatewayPatRule'; //# sourceMappingURL=vpcPublicGatewayPatRule.js.map