@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
94 lines • 4.54 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecurityGroupRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a IEC security group rule resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const secgroupRuleTest = new huaweicloud.iec.SecurityGroupRule("secgroupRuleTest", {
* direction: "ingress",
* portRangeMin: 22,
* portRangeMax: 22,
* ethertype: "IPv4",
* protocol: "tcp",
* securityGroupId: _var.iec_security_group_id,
* remoteIpPrefix: "0.0.0.0/0",
* });
* ```
*/
class SecurityGroupRule extends pulumi.CustomResource {
/**
* Get an existing SecurityGroupRule 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 SecurityGroupRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SecurityGroupRule. 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'] === SecurityGroupRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["direction"] = state ? state.direction : undefined;
resourceInputs["ethertype"] = state ? state.ethertype : undefined;
resourceInputs["portRangeMax"] = state ? state.portRangeMax : undefined;
resourceInputs["portRangeMin"] = state ? state.portRangeMin : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["remoteGroupId"] = state ? state.remoteGroupId : undefined;
resourceInputs["remoteIpPrefix"] = state ? state.remoteIpPrefix : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.direction === undefined) && !opts.urn) {
throw new Error("Missing required property 'direction'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
if ((!args || args.securityGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'securityGroupId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["direction"] = args ? args.direction : undefined;
resourceInputs["ethertype"] = args ? args.ethertype : undefined;
resourceInputs["portRangeMax"] = args ? args.portRangeMax : undefined;
resourceInputs["portRangeMin"] = args ? args.portRangeMin : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["remoteGroupId"] = args ? args.remoteGroupId : undefined;
resourceInputs["remoteIpPrefix"] = args ? args.remoteIpPrefix : undefined;
resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecurityGroupRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecurityGroupRule = SecurityGroupRule;
/** @internal */
SecurityGroupRule.__pulumiType = 'huaweicloud:Iec/securityGroupRule:SecurityGroupRule';
//# sourceMappingURL=securityGroupRule.js.map