UNPKG

@pulumi/scm

Version:

A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1

220 lines 9.64 kB
"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.AuthenticationRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * AuthenticationRule resource * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scm from "@pulumi/scm"; * * const appAccessTag = new scm.Tag("app_access_tag", { * folder: "All", * name: "app-access-test_25", * color: "Blue", * }); * // ----------------------------------------------------------------------------- * // 2. ANCHOR RULE (Used for relative positioning by other rules) * // ----------------------------------------------------------------------------- * const anchorRule = new scm.AuthenticationRule("anchor_rule", { * name: "test_anchor_rule_251", * description: "Base rule. Used to test 'before' and 'after' positioning", * position: "pre", * folder: "All", * destinations: ["any"], * froms: ["any"], * tos: ["any"], * sources: ["any"], * services: [ * "service-http", * "service-https", * ], * sourceUsers: ["any"], * timeout: 1200, * negateSource: false, * negateDestination: false, * tags: [appAccessTag.name], * categories: ["any"], * destinationHips: ["any"], * logAuthenticationTimeout: false, * disabled: false, * }); * // # ----------------------------------------------------------------------------- * // # 3. ABSOLUTE POSITIONING Examples ("top" and "bottom") * // # ----------------------------------------------------------------------------- * const ruleTopOfList = new scm.AuthenticationRule("rule_top_of_list", { * name: "test_top_rule_25", * description: "Placed at the very top of the 'pre' rulebase.", * folder: "All", * position: "pre", * relativePosition: "top", * destinations: ["any"], * froms: ["untrust"], * tos: ["trust"], * sources: ["any"], * services: ["any"], * sourceUsers: ["any"], * }); * const ruleBottomOfList = new scm.AuthenticationRule("rule_bottom_of_list", { * name: "test_bottom_rule_25", * description: "Placed at the very bottom of the 'pre' rulebase.", * folder: "All", * position: "pre", * relativePosition: "bottom", * destinations: ["any"], * froms: ["any"], * tos: ["any"], * sources: ["any"], * services: ["any"], * sourceUsers: ["any"], * }); * // ----------------------------------------------------------------------------- * // 4. RELATIVE POSITIONING Examples ("before" and "after") * // ----------------------------------------------------------------------------- * const ruleBeforeAnchor = new scm.AuthenticationRule("rule_before_anchor", { * name: "test_before_rule_25_updating", * description: "Positioned immediately BEFORE the anchor_rule.", * folder: "All", * position: "pre", * relativePosition: "before", * targetRule: anchorRule.id, * destinations: ["any"], * froms: ["any"], * tos: ["any"], * sources: ["any"], * services: ["any"], * sourceUsers: ["any"], * }); * const ruleAfterAnchor = new scm.AuthenticationRule("rule_after_anchor", { * name: "test_after_rule_25", * description: "Positioned immediately AFTER the anchor_rule.", * folder: "All", * position: "pre", * relativePosition: "after", * targetRule: anchorRule.id, * destinations: ["any"], * froms: ["any"], * tos: ["any"], * sources: ["any"], * services: ["any"], * sourceUsers: ["any"], * }); * ``` */ class AuthenticationRule extends pulumi.CustomResource { /** * Get an existing AuthenticationRule 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 AuthenticationRule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AuthenticationRule. 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'] === AuthenticationRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authenticationEnforcement"] = state?.authenticationEnforcement; 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["groupTag"] = state?.groupTag; resourceInputs["hipProfiles"] = state?.hipProfiles; resourceInputs["logAuthenticationTimeout"] = state?.logAuthenticationTimeout; resourceInputs["logSetting"] = state?.logSetting; resourceInputs["name"] = state?.name; resourceInputs["negateDestination"] = state?.negateDestination; resourceInputs["negateSource"] = state?.negateSource; resourceInputs["position"] = state?.position; 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["timeout"] = state?.timeout; 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?.services === undefined && !opts.urn) { throw new Error("Missing required property 'services'"); } 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["authenticationEnforcement"] = args?.authenticationEnforcement; 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["groupTag"] = args?.groupTag; resourceInputs["hipProfiles"] = args?.hipProfiles; resourceInputs["logAuthenticationTimeout"] = args?.logAuthenticationTimeout; resourceInputs["logSetting"] = args?.logSetting; resourceInputs["name"] = args?.name; resourceInputs["negateDestination"] = args?.negateDestination; resourceInputs["negateSource"] = args?.negateSource; resourceInputs["position"] = args?.position; 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["timeout"] = args?.timeout; resourceInputs["tos"] = args?.tos; resourceInputs["tfid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AuthenticationRule.__pulumiType, name, resourceInputs, opts); } } exports.AuthenticationRule = AuthenticationRule; /** @internal */ AuthenticationRule.__pulumiType = 'scm:index/authenticationRule:AuthenticationRule'; //# sourceMappingURL=authenticationRule.js.map