@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
202 lines • 8.44 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.AppOverrideRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* AppOverrideRule resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* // --- 1. TAG Resource ---
* const appOverridePositionTag = new scm.Tag("app_override_position_tag", {
* name: "app-override-position-tag_1",
* folder: "All",
* color: "Orange",
* });
* // --- 2. ANCHOR RULE (Used for relative positioning by other rules) ---
* const anchorAppOverride = new scm.AppOverrideRule("anchor_app_override", {
* name: "anchor-app-override-rule",
* description: "Base rule for testing 'before' and 'after' positioning. Updating",
* folder: "All",
* position: "pre",
* application: "ssl",
* protocol: "tcp",
* port: "112",
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* tags: [appOverridePositionTag.name],
* });
* // --- 3. ABSOLUTE POSITIONING Examples ("top" and "bottom") ---
* const ruleTopAppOverride = new scm.AppOverrideRule("rule_top_app_override", {
* name: "top-absolute-app-override",
* description: "Placed at the very TOP of the App Override rulebase.",
* folder: "All",
* position: "pre",
* relativePosition: "bottom",
* application: "ssl",
* protocol: "tcp",
* port: "443",
* froms: ["untrust"],
* tos: ["trust"],
* sources: ["any"],
* destinations: ["any"],
* });
* const ruleBottomAppOverride = new scm.AppOverrideRule("rule_bottom_app_override", {
* name: "bottom-absolute-app-override",
* description: "Placed at the very BOTTOM of the App Override rulebase.",
* folder: "All",
* position: "pre",
* relativePosition: "bottom",
* application: "ssl",
* protocol: "tcp",
* port: "443",
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* });
* //--- 4. RELATIVE POSITIONING Examples ("before" and "after") ---
* const ruleBeforeAnchorOverride = new scm.AppOverrideRule("rule_before_anchor_override", {
* name: "before-anchor-app-override",
* description: "Positioned immediately BEFORE the anchor-app-override-rule.",
* folder: "All",
* position: "pre",
* relativePosition: "before",
* targetRule: anchorAppOverride.id,
* application: "ssl",
* protocol: "tcp",
* port: "443",
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* });
* const ruleAfterAnchorOverride = new scm.AppOverrideRule("rule_after_anchor_override", {
* name: "after-anchor-app-override",
* description: "Positioned immediately AFTER the anchor-app-override-rule.",
* folder: "All",
* position: "pre",
* relativePosition: "before",
* targetRule: anchorAppOverride.id,
* application: "ssl",
* protocol: "tcp",
* port: "443",
* froms: ["untrust"],
* tos: ["trust"],
* sources: ["any"],
* destinations: ["any"],
* });
* ```
*/
class AppOverrideRule extends pulumi.CustomResource {
/**
* Get an existing AppOverrideRule 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 AppOverrideRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AppOverrideRule. 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'] === AppOverrideRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["application"] = state?.application;
resourceInputs["description"] = state?.description;
resourceInputs["destinations"] = state?.destinations;
resourceInputs["device"] = state?.device;
resourceInputs["disabled"] = state?.disabled;
resourceInputs["folder"] = state?.folder;
resourceInputs["froms"] = state?.froms;
resourceInputs["groupTag"] = state?.groupTag;
resourceInputs["name"] = state?.name;
resourceInputs["negateDestination"] = state?.negateDestination;
resourceInputs["negateSource"] = state?.negateSource;
resourceInputs["port"] = state?.port;
resourceInputs["position"] = state?.position;
resourceInputs["protocol"] = state?.protocol;
resourceInputs["relativePosition"] = state?.relativePosition;
resourceInputs["snippet"] = state?.snippet;
resourceInputs["sources"] = state?.sources;
resourceInputs["tags"] = state?.tags;
resourceInputs["targetRule"] = state?.targetRule;
resourceInputs["tfid"] = state?.tfid;
resourceInputs["tos"] = state?.tos;
}
else {
const args = argsOrState;
if (args?.application === undefined && !opts.urn) {
throw new Error("Missing required property 'application'");
}
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?.port === undefined && !opts.urn) {
throw new Error("Missing required property 'port'");
}
if (args?.protocol === undefined && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
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["application"] = args?.application;
resourceInputs["description"] = args?.description;
resourceInputs["destinations"] = args?.destinations;
resourceInputs["device"] = args?.device;
resourceInputs["disabled"] = args?.disabled;
resourceInputs["folder"] = args?.folder;
resourceInputs["froms"] = args?.froms;
resourceInputs["groupTag"] = args?.groupTag;
resourceInputs["name"] = args?.name;
resourceInputs["negateDestination"] = args?.negateDestination;
resourceInputs["negateSource"] = args?.negateSource;
resourceInputs["port"] = args?.port;
resourceInputs["position"] = args?.position;
resourceInputs["protocol"] = args?.protocol;
resourceInputs["relativePosition"] = args?.relativePosition;
resourceInputs["snippet"] = args?.snippet;
resourceInputs["sources"] = args?.sources;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetRule"] = args?.targetRule;
resourceInputs["tos"] = args?.tos;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AppOverrideRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppOverrideRule = AppOverrideRule;
/** @internal */
AppOverrideRule.__pulumiType = 'scm:index/appOverrideRule:AppOverrideRule';
//# sourceMappingURL=appOverrideRule.js.map