@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
119 lines • 5.04 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.GroupV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a v2 firewall group 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_2",
* description: "drop TELNET traffic",
* action: "deny",
* protocol: "tcp",
* destinationPort: "23",
* enabled: true,
* });
* const rule2 = new openstack.firewall.RuleV2("rule_2", {
* name: "firewall_rule_1",
* description: "drop NTP traffic",
* action: "deny",
* protocol: "udp",
* destinationPort: "123",
* enabled: false,
* });
* const policy1 = new openstack.firewall.PolicyV2("policy_1", {
* name: "firewall_ingress_policy",
* rules: [rule1.id],
* });
* const policy2 = new openstack.firewall.PolicyV2("policy_2", {
* name: "firewall_egress_policy",
* rules: [rule2.id],
* });
* const group1 = new openstack.firewall.GroupV2("group_1", {
* name: "firewall_group",
* ingressFirewallPolicyId: policy1.id,
* egressFirewallPolicyId: policy2.id,
* });
* ```
*
* ## Import
*
* Firewall groups can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:firewall/groupV2:GroupV2 group_1 c9e39fb2-ce20-46c8-a964-25f3898c7a97
* ```
*/
class GroupV2 extends pulumi.CustomResource {
/**
* Get an existing GroupV2 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 GroupV2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GroupV2. 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'] === GroupV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["egressFirewallPolicyId"] = state ? state.egressFirewallPolicyId : undefined;
resourceInputs["ingressFirewallPolicyId"] = state ? state.ingressFirewallPolicyId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["ports"] = state ? state.ports : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["shared"] = state ? state.shared : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["egressFirewallPolicyId"] = args ? args.egressFirewallPolicyId : undefined;
resourceInputs["ingressFirewallPolicyId"] = args ? args.ingressFirewallPolicyId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["ports"] = args ? args.ports : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["shared"] = args ? args.shared : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GroupV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.GroupV2 = GroupV2;
/** @internal */
GroupV2.__pulumiType = 'openstack:firewall/groupV2:GroupV2';
//# sourceMappingURL=groupV2.js.map