@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
222 lines • 8.75 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.NatRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* NatRule resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* const exampleTag = new scm.Tag("example_tag", {
* folder: "All",
* name: "example-tag",
* color: "Red",
* });
* //Source Translation (SNAT) - Dynamic IP and Port
* const exampleNatRule = new scm.NatRule("example_nat_rule", {
* name: "snat-to-internet-1",
* froms: ["any"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* service: "service-https",
* description: "Dynamic SNAT for internal traffic accessing the internet. Updating",
* disabled: false,
* natType: "ipv4",
* folder: "All",
* tags: [exampleTag.name],
* sourceTranslation: {
* dynamicIpAndPort: {
* translatedAddresses: [
* "1.1.1.1",
* "1.1.1.5",
* ],
* },
* },
* destinationTranslation: {
* translatedAddress: "192.168.1.10",
* translatedPort: 8080,
* },
* activeActiveDeviceBinding: "1",
* });
* //Source Translation (SNAT) - Static IP - Bidirectional - no
* const exampleNatStaticRule = new scm.NatRule("example_nat_static_rule", {
* name: "snat-to-bid-1",
* froms: ["any"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* service: "service-https",
* description: "Dynamic SNAT for internal traffic accessing the internet. Updating",
* disabled: false,
* natType: "ipv4",
* folder: "All",
* tags: [exampleTag.name],
* sourceTranslation: {
* staticIp: {
* translatedAddress: "1.1.1.5",
* biDirectional: "no",
* },
* },
* destinationTranslation: {
* translatedAddress: "192.168.1.10",
* translatedPort: 8080,
* },
* activeActiveDeviceBinding: "1",
* });
* //Source Translation (SNAT) - Static IP - Bidirectional - yes
* const exampleNatStaticRule2 = new scm.NatRule("example_nat_static_rule_2", {
* name: "snat-to-bid-yes-1",
* froms: ["any"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* service: "service-https",
* description: "Dynamic SNAT for internal traffic accessing the internet. Updating",
* disabled: false,
* natType: "ipv4",
* folder: "All",
* tags: [exampleTag.name],
* sourceTranslation: {
* staticIp: {
* translatedAddress: "1.1.1.5",
* biDirectional: "yes",
* },
* },
* activeActiveDeviceBinding: "1",
* });
* //Source Translation (SNAT) - Dynamic IP
* const exampleNatDynamicRule = new scm.NatRule("example_nat_dynamic_rule", {
* name: "snat-to-dyanamic-1",
* froms: ["any"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* service: "service-https",
* description: "Dynamic SNAT for internal traffic accessing the internet. Updating",
* disabled: false,
* natType: "ipv4",
* folder: "All",
* tags: [exampleTag.name],
* sourceTranslation: {
* dynamicIp: {
* translatedAddresses: ["1.1.1.0/24"],
* fallback: {
* translatedAddresses: ["1.1.1.0"],
* interfaceAddress: {
* "interface": "ethernet1/1",
* ip: "1.1.1.5",
* },
* },
* },
* },
* destinationTranslation: {
* translatedAddress: "192.168.1.10",
* translatedPort: 8080,
* },
* activeActiveDeviceBinding: "1",
* });
* ```
*/
class NatRule extends pulumi.CustomResource {
/**
* Get an existing NatRule 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 NatRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NatRule. 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'] === NatRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activeActiveDeviceBinding"] = state?.activeActiveDeviceBinding;
resourceInputs["description"] = state?.description;
resourceInputs["destinationTranslation"] = state?.destinationTranslation;
resourceInputs["destinations"] = state?.destinations;
resourceInputs["device"] = state?.device;
resourceInputs["disabled"] = state?.disabled;
resourceInputs["dynamicDestinationTranslation"] = state?.dynamicDestinationTranslation;
resourceInputs["folder"] = state?.folder;
resourceInputs["froms"] = state?.froms;
resourceInputs["name"] = state?.name;
resourceInputs["natType"] = state?.natType;
resourceInputs["position"] = state?.position;
resourceInputs["service"] = state?.service;
resourceInputs["snippet"] = state?.snippet;
resourceInputs["sourceTranslation"] = state?.sourceTranslation;
resourceInputs["sources"] = state?.sources;
resourceInputs["tags"] = state?.tags;
resourceInputs["tfid"] = state?.tfid;
resourceInputs["toInterface"] = state?.toInterface;
resourceInputs["tos"] = state?.tos;
}
else {
const args = argsOrState;
if (args?.destinations === undefined && !opts.urn) {
throw new Error("Missing required property 'destinations'");
}
if (args?.froms === undefined && !opts.urn) {
throw new Error("Missing required property 'froms'");
}
if (args?.service === undefined && !opts.urn) {
throw new Error("Missing required property 'service'");
}
if (args?.sources === undefined && !opts.urn) {
throw new Error("Missing required property 'sources'");
}
if (args?.tos === undefined && !opts.urn) {
throw new Error("Missing required property 'tos'");
}
resourceInputs["activeActiveDeviceBinding"] = args?.activeActiveDeviceBinding;
resourceInputs["description"] = args?.description;
resourceInputs["destinationTranslation"] = args?.destinationTranslation;
resourceInputs["destinations"] = args?.destinations;
resourceInputs["device"] = args?.device;
resourceInputs["disabled"] = args?.disabled;
resourceInputs["dynamicDestinationTranslation"] = args?.dynamicDestinationTranslation;
resourceInputs["folder"] = args?.folder;
resourceInputs["froms"] = args?.froms;
resourceInputs["name"] = args?.name;
resourceInputs["natType"] = args?.natType;
resourceInputs["position"] = args?.position;
resourceInputs["service"] = args?.service;
resourceInputs["snippet"] = args?.snippet;
resourceInputs["sourceTranslation"] = args?.sourceTranslation;
resourceInputs["sources"] = args?.sources;
resourceInputs["tags"] = args?.tags;
resourceInputs["toInterface"] = args?.toInterface;
resourceInputs["tos"] = args?.tos;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NatRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.NatRule = NatRule;
/** @internal */
NatRule.__pulumiType = 'scm:index/natRule:NatRule';
//# sourceMappingURL=natRule.js.map