@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
271 lines • 10.6 kB
JavaScript
"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.DecryptionRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* DecryptionRule resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* // --- 1. TAG Resource ---
* const decryptionPositionTag = new scm.Tag("decryption_position_tag", {
* name: "decryption-position-tag",
* folder: "All",
* color: "Purple",
* });
* // --- 2. ANCHOR DECRYPTION RULE (Used for relative positioning) ---
* const anchorDecryptionRule = new scm.DecryptionRule("anchor_decryption_rule", {
* name: "anchor-decryption-rule",
* description: "Base rule for testing 'before' and 'after' positioning.",
* folder: "All",
* position: "pre",
* action: "decrypt",
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["any"],
* services: ["service-https"],
* categories: ["high-risk"],
* sourceUsers: ["any"],
* type: {
* sslForwardProxy: {},
* },
* destinationHips: ["any"],
* tags: [decryptionPositionTag.name],
* logSuccess: true,
* logFail: true,
* disabled: false,
* negateSource: false,
* negateDestination: false,
* });
* // --- 3. ABSOLUTE POSITIONING Examples ("top" and "bottom") ---
* const ruleTopDecryptionRule = new scm.DecryptionRule("rule_top_decryption_rule", {
* name: "top-absolute-decryption-rule",
* description: "Placed at the very TOP of the Decryption rulebase.",
* folder: "All",
* position: "pre",
* action: "no-decrypt",
* relativePosition: "top",
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* services: ["service-https"],
* categories: ["high-risk"],
* sourceUsers: ["any"],
* type: {
* sslForwardProxy: {},
* },
* });
* const ruleBottomDecryptionRule = new scm.DecryptionRule("rule_bottom_decryption_rule", {
* name: "bottom-absolute-decryption-rule",
* description: "Placed at the very BOTTOM of the Decryption rulebase.",
* folder: "All",
* position: "pre",
* action: "decrypt",
* relativePosition: "bottom",
* froms: ["any"],
* tos: ["any"],
* sources: ["any"],
* destinations: ["any"],
* services: ["service-https"],
* categories: ["high-risk"],
* sourceUsers: ["any"],
* type: {
* sslForwardProxy: {},
* },
* });
* // --- 4. RELATIVE POSITIONING Examples ("before" and "after") ---
* const ruleBeforeAnchorDecryption = new scm.DecryptionRule("rule_before_anchor_decryption", {
* name: "before-anchor-decryption-rule",
* description: "Positioned immediately BEFORE the anchor-decryption-rule. Updating",
* folder: "All",
* position: "pre",
* action: "decrypt",
* relativePosition: "before",
* targetRule: anchorDecryptionRule.id,
* froms: ["trust"],
* tos: ["untrust"],
* sources: ["10.1.1.0/24"],
* destinations: ["any"],
* services: ["service-https"],
* categories: ["high-risk"],
* sourceUsers: ["any"],
* type: {
* sslForwardProxy: {},
* },
* });
* const ruleAfterAnchorDecryption = new scm.DecryptionRule("rule_after_anchor_decryption", {
* name: "after-anchor-decryption-rule_123",
* description: "Positioned immediately AFTER the anchor-decryption-rule.",
* folder: "All",
* position: "pre",
* action: "decrypt",
* relativePosition: "after",
* targetRule: anchorDecryptionRule.id,
* froms: ["any"],
* tos: ["untrust"],
* sources: ["any"],
* destinations: ["192.168.1.10"],
* services: ["service-https"],
* categories: ["any"],
* sourceUsers: ["any"],
* type: {
* sslForwardProxy: {},
* },
* });
* ```
*
* ## Import
*
* The following command can be used to import a resource not managed by Terraform:
*
* bash
*
* ```sh
* $ pulumi import scm:index/decryptionRule:DecryptionRule example folder:::id
* ```
*
* or
*
* bash
*
* ```sh
* $ pulumi import scm:index/decryptionRule:DecryptionRule example :snippet::id
* ```
*
* or
*
* bash
*
* ```sh
* $ pulumi import scm:index/decryptionRule:DecryptionRule example ::device:id
* ```
*/
class DecryptionRule extends pulumi.CustomResource {
/**
* Get an existing DecryptionRule 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 DecryptionRule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DecryptionRule. 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'] === DecryptionRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state?.action;
resourceInputs["categories"] = state?.categories;
resourceInputs["description"] = state?.description;
resourceInputs["destinationHips"] = state?.destinationHips;
resourceInputs["destinations"] = state?.destinations;
resourceInputs["device"] = state?.device;
resourceInputs["disabled"] = state?.disabled;
resourceInputs["folder"] = state?.folder;
resourceInputs["froms"] = state?.froms;
resourceInputs["logFail"] = state?.logFail;
resourceInputs["logSetting"] = state?.logSetting;
resourceInputs["logSuccess"] = state?.logSuccess;
resourceInputs["name"] = state?.name;
resourceInputs["negateDestination"] = state?.negateDestination;
resourceInputs["negateSource"] = state?.negateSource;
resourceInputs["position"] = state?.position;
resourceInputs["profile"] = state?.profile;
resourceInputs["relativePosition"] = state?.relativePosition;
resourceInputs["services"] = state?.services;
resourceInputs["snippet"] = state?.snippet;
resourceInputs["sourceHips"] = state?.sourceHips;
resourceInputs["sourceUsers"] = state?.sourceUsers;
resourceInputs["sources"] = state?.sources;
resourceInputs["tags"] = state?.tags;
resourceInputs["targetRule"] = state?.targetRule;
resourceInputs["tfid"] = state?.tfid;
resourceInputs["tos"] = state?.tos;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.action === undefined && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if (args?.categories === undefined && !opts.urn) {
throw new Error("Missing required property 'categories'");
}
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?.services === undefined && !opts.urn) {
throw new Error("Missing required property 'services'");
}
if (args?.sourceUsers === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceUsers'");
}
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["action"] = args?.action;
resourceInputs["categories"] = args?.categories;
resourceInputs["description"] = args?.description;
resourceInputs["destinationHips"] = args?.destinationHips;
resourceInputs["destinations"] = args?.destinations;
resourceInputs["device"] = args?.device;
resourceInputs["disabled"] = args?.disabled;
resourceInputs["folder"] = args?.folder;
resourceInputs["froms"] = args?.froms;
resourceInputs["logFail"] = args?.logFail;
resourceInputs["logSetting"] = args?.logSetting;
resourceInputs["logSuccess"] = args?.logSuccess;
resourceInputs["name"] = args?.name;
resourceInputs["negateDestination"] = args?.negateDestination;
resourceInputs["negateSource"] = args?.negateSource;
resourceInputs["position"] = args?.position;
resourceInputs["profile"] = args?.profile;
resourceInputs["relativePosition"] = args?.relativePosition;
resourceInputs["services"] = args?.services;
resourceInputs["snippet"] = args?.snippet;
resourceInputs["sourceHips"] = args?.sourceHips;
resourceInputs["sourceUsers"] = args?.sourceUsers;
resourceInputs["sources"] = args?.sources;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetRule"] = args?.targetRule;
resourceInputs["tos"] = args?.tos;
resourceInputs["type"] = args?.type;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DecryptionRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.DecryptionRule = DecryptionRule;
/** @internal */
DecryptionRule.__pulumiType = 'scm:index/decryptionRule:DecryptionRule';
//# sourceMappingURL=decryptionRule.js.map