@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
118 lines • 5.4 kB
JavaScript
;
// *** 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 VPC Public Gateway PAT (Port Address Translation).
* For more information, see [the documentation](https://developers.scaleway.com/en/products/vpc-gw/api/v1#pat-rules-e75d10).
*
* ## Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const pg01 = new scaleway.VpcPublicGateway("pg01", {type: "VPC-GW-S"});
* const dhcp01 = new scaleway.VpcPublicGatewayDhcp("dhcp01", {subnet: "192.168.1.0/24"});
* const pn01 = new scaleway.VpcPrivateNetwork("pn01", {});
* const gn01 = new scaleway.VpcGatewayNetwork("gn01", {
* gatewayId: pg01.id,
* privateNetworkId: pn01.id,
* dhcpId: dhcp01.id,
* cleanupDhcp: true,
* });
* const main = new scaleway.VpcPublicGatewayPatRule("main", {
* gatewayId: pg01.id,
* privateIp: dhcp01.address,
* privatePort: 42,
* publicPort: 42,
* protocol: "both",
* }, {
* dependsOn: [
* gn01,
* pn01,
* ],
* });
* ```
*
* ## Import
*
* Public gateway PAT rules config can be imported using the `{zone}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/vpcPublicGatewayPatRule:VpcPublicGatewayPatRule main fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
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) {
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;
}
constructor(name, argsOrState, opts) {
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