UNPKG

@pulumi/cloudngfwaws

Version:

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

162 lines 6.8 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, { ...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?.action; resourceInputs["applications"] = state?.applications; resourceInputs["auditComment"] = state?.auditComment; resourceInputs["category"] = state?.category; resourceInputs["decryptionRuleType"] = state?.decryptionRuleType; resourceInputs["description"] = state?.description; resourceInputs["destination"] = state?.destination; resourceInputs["enabled"] = state?.enabled; resourceInputs["logging"] = state?.logging; resourceInputs["name"] = state?.name; resourceInputs["negateDestination"] = state?.negateDestination; resourceInputs["negateSource"] = state?.negateSource; resourceInputs["priority"] = state?.priority; resourceInputs["protPortLists"] = state?.protPortLists; resourceInputs["protocol"] = state?.protocol; resourceInputs["ruleList"] = state?.ruleList; resourceInputs["rulestack"] = state?.rulestack; resourceInputs["scope"] = state?.scope; resourceInputs["source"] = state?.source; resourceInputs["tags"] = state?.tags; resourceInputs["updateToken"] = state?.updateToken; } else { const args = argsOrState; if (args?.action === undefined && !opts.urn) { throw new Error("Missing required property 'action'"); } if (args?.applications === undefined && !opts.urn) { throw new Error("Missing required property 'applications'"); } if (args?.category === undefined && !opts.urn) { throw new Error("Missing required property 'category'"); } if (args?.destination === undefined && !opts.urn) { throw new Error("Missing required property 'destination'"); } if (args?.priority === undefined && !opts.urn) { throw new Error("Missing required property 'priority'"); } if (args?.rulestack === undefined && !opts.urn) { throw new Error("Missing required property 'rulestack'"); } if (args?.source === undefined && !opts.urn) { throw new Error("Missing required property 'source'"); } resourceInputs["action"] = args?.action; resourceInputs["applications"] = args?.applications; resourceInputs["auditComment"] = args?.auditComment; resourceInputs["category"] = args?.category; resourceInputs["decryptionRuleType"] = args?.decryptionRuleType; resourceInputs["description"] = args?.description; resourceInputs["destination"] = args?.destination; resourceInputs["enabled"] = args?.enabled; resourceInputs["logging"] = args?.logging; resourceInputs["name"] = args?.name; resourceInputs["negateDestination"] = args?.negateDestination; resourceInputs["negateSource"] = args?.negateSource; resourceInputs["priority"] = args?.priority; resourceInputs["protPortLists"] = args?.protPortLists; resourceInputs["protocol"] = args?.protocol; resourceInputs["ruleList"] = args?.ruleList; resourceInputs["rulestack"] = args?.rulestack; resourceInputs["scope"] = args?.scope; resourceInputs["source"] = args?.source; resourceInputs["tags"] = args?.tags; 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