@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
104 lines • 4.78 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.RuleV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a v2 firewall rule 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 rule2 = new openstack.firewall.RuleV2("rule_2", {
* name: "firewall_rule",
* description: "drop TELNET traffic",
* action: "deny",
* protocol: "tcp",
* destinationPort: "23",
* enabled: true,
* });
* ```
*
* ## Import
*
* Firewall Rules can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:firewall/ruleV2:RuleV2 rule_1 8dbc0c28-e49c-463f-b712-5c5d1bbac327
* ```
*/
class RuleV2 extends pulumi.CustomResource {
/**
* Get an existing RuleV2 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 RuleV2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RuleV2. 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'] === RuleV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["destinationIpAddress"] = state ? state.destinationIpAddress : undefined;
resourceInputs["destinationPort"] = state ? state.destinationPort : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["shared"] = state ? state.shared : undefined;
resourceInputs["sourceIpAddress"] = state ? state.sourceIpAddress : undefined;
resourceInputs["sourcePort"] = state ? state.sourcePort : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destinationIpAddress"] = args ? args.destinationIpAddress : undefined;
resourceInputs["destinationPort"] = args ? args.destinationPort : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["shared"] = args ? args.shared : undefined;
resourceInputs["sourceIpAddress"] = args ? args.sourceIpAddress : undefined;
resourceInputs["sourcePort"] = args ? args.sourcePort : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RuleV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.RuleV2 = RuleV2;
/** @internal */
RuleV2.__pulumiType = 'openstack:firewall/ruleV2:RuleV2';
//# sourceMappingURL=ruleV2.js.map