UNPKG

@pulumi/cloudngfwaws

Version:

A Pulumi package for creating and managing Cloud NGFW for AWS resources.

162 lines 7.66 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.SecurityRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Resource for security rule manipulation. * * ## Admin Permission Type * * * `Rulestack` (for `scope="Local"`) * * `Global Rulestack` (for `scope="Global"`) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as cloudngfwaws from "@pulumi/cloudngfwaws"; * * const r = new cloudngfwaws.Rulestack("r", { * name: "terraform-rulestack", * scope: "Local", * accountId: "123456789", * description: "Made by Pulumi", * profileConfig: { * antiSpyware: "BestPractice", * }, * }); * const example = new cloudngfwaws.SecurityRule("example", { * rulestack: r.name, * ruleList: "LocalRule", * priority: 3, * name: "tf-security-rule", * description: "Also configured by Terraform", * source: { * cidrs: ["any"], * }, * destination: { * cidrs: ["192.168.0.0/16"], * }, * negateDestination: true, * applications: ["any"], * category: {}, * action: "Allow", * logging: true, * auditComment: "initial config", * }); * ``` * * ## Import * * import name is <scope>:<rulestack>:<rule_list>:<priority> * * ```sh * $ pulumi import cloudngfwaws:index/securityRule:SecurityRule example Local:terraform-rulestack:LocalRule:3 * ``` */ class SecurityRule extends pulumi.CustomResource { /** * Get an existing SecurityRule 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 SecurityRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SecurityRule. 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'] === SecurityRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["applications"] = state ? state.applications : undefined; resourceInputs["auditComment"] = state ? state.auditComment : undefined; resourceInputs["category"] = state ? state.category : undefined; resourceInputs["decryptionRuleType"] = state ? state.decryptionRuleType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["destination"] = state ? state.destination : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["logging"] = state ? state.logging : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["negateDestination"] = state ? state.negateDestination : undefined; resourceInputs["negateSource"] = state ? state.negateSource : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["protPortLists"] = state ? state.protPortLists : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["ruleList"] = state ? state.ruleList : undefined; resourceInputs["rulestack"] = state ? state.rulestack : undefined; resourceInputs["scope"] = state ? state.scope : undefined; resourceInputs["source"] = state ? state.source : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["updateToken"] = state ? state.updateToken : undefined; } else { const args = argsOrState; if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.applications === undefined) && !opts.urn) { throw new Error("Missing required property 'applications'"); } if ((!args || args.category === undefined) && !opts.urn) { throw new Error("Missing required property 'category'"); } if ((!args || args.destination === undefined) && !opts.urn) { throw new Error("Missing required property 'destination'"); } if ((!args || args.priority === undefined) && !opts.urn) { throw new Error("Missing required property 'priority'"); } if ((!args || args.rulestack === undefined) && !opts.urn) { throw new Error("Missing required property 'rulestack'"); } if ((!args || args.source === undefined) && !opts.urn) { throw new Error("Missing required property 'source'"); } resourceInputs["action"] = args ? args.action : undefined; resourceInputs["applications"] = args ? args.applications : undefined; resourceInputs["auditComment"] = args ? args.auditComment : undefined; resourceInputs["category"] = args ? args.category : undefined; resourceInputs["decryptionRuleType"] = args ? args.decryptionRuleType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["destination"] = args ? args.destination : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["logging"] = args ? args.logging : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["negateDestination"] = args ? args.negateDestination : undefined; resourceInputs["negateSource"] = args ? args.negateSource : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["protPortLists"] = args ? args.protPortLists : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["ruleList"] = args ? args.ruleList : undefined; resourceInputs["rulestack"] = args ? args.rulestack : undefined; resourceInputs["scope"] = args ? args.scope : undefined; resourceInputs["source"] = args ? args.source : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["updateToken"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SecurityRule.__pulumiType, name, resourceInputs, opts); } } exports.SecurityRule = SecurityRule; /** @internal */ SecurityRule.__pulumiType = 'cloudngfwaws:index/securityRule:SecurityRule'; //# sourceMappingURL=securityRule.js.map