@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
107 lines • 3.88 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.PolicyV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a v2 firewall policy resource within OpenStack.
*
* > **Note:** Firewall v2 has no support for OVN currently.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const rule1 = new openstack.firewall.RuleV2("rule_1", {
* name: "firewall_rule_1",
* description: "drop TELNET traffic",
* action: "deny",
* protocol: "tcp",
* destinationPort: "23",
* enabled: true,
* });
* const rule2 = new openstack.firewall.RuleV2("rule_2", {
* name: "firewall_rule_2",
* description: "drop NTP traffic",
* action: "deny",
* protocol: "udp",
* destinationPort: "123",
* enabled: false,
* });
* const policy1 = new openstack.firewall.PolicyV2("policy_1", {
* name: "firewall_policy",
* rules: [
* rule1.id,
* rule2.id,
* ],
* });
* ```
*
* ## Import
*
* Firewall Policies can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:firewall/policyV2:PolicyV2 policy_1 07f422e6-c596-474b-8b94-fe2c12506ce0
* ```
*/
class PolicyV2 extends pulumi.CustomResource {
/**
* Get an existing PolicyV2 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 PolicyV2(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of PolicyV2. 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'] === PolicyV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["audited"] = state?.audited;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["rules"] = state?.rules;
resourceInputs["shared"] = state?.shared;
resourceInputs["tenantId"] = state?.tenantId;
}
else {
const args = argsOrState;
resourceInputs["audited"] = args?.audited;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["region"] = args?.region;
resourceInputs["rules"] = args?.rules;
resourceInputs["shared"] = args?.shared;
resourceInputs["tenantId"] = args?.tenantId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PolicyV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.PolicyV2 = PolicyV2;
/** @internal */
PolicyV2.__pulumiType = 'openstack:firewall/policyV2:PolicyV2';
//# sourceMappingURL=policyV2.js.map