@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
103 lines • 4.64 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.ServiceGroupMember = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a CFW service group member resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const groupId = config.requireObject("groupId");
* const protocol = config.requireObject("protocol");
* const sourcePort = config.requireObject("sourcePort");
* const destPort = config.requireObject("destPort");
* const test = new huaweicloud.cfw.ServiceGroupMember("test", {
* groupId: groupId,
* protocol: protocol,
* sourcePort: sourcePort,
* destPort: destPort,
* });
* ```
*
* ## Import
*
* The service group member can be imported using service group ID and member ID, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cfw/serviceGroupMember:ServiceGroupMember test <group_id>/<member_id>
* ```
*/
class ServiceGroupMember extends pulumi.CustomResource {
/**
* Get an existing ServiceGroupMember 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 ServiceGroupMember(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceGroupMember. 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'] === ServiceGroupMember.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["destPort"] = state ? state.destPort : undefined;
resourceInputs["groupId"] = state ? state.groupId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sourcePort"] = state ? state.sourcePort : undefined;
}
else {
const args = argsOrState;
if ((!args || args.destPort === undefined) && !opts.urn) {
throw new Error("Missing required property 'destPort'");
}
if ((!args || args.groupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'groupId'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
if ((!args || args.sourcePort === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourcePort'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destPort"] = args ? args.destPort : undefined;
resourceInputs["groupId"] = args ? args.groupId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourcePort"] = args ? args.sourcePort : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServiceGroupMember.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceGroupMember = ServiceGroupMember;
/** @internal */
ServiceGroupMember.__pulumiType = 'huaweicloud:Cfw/serviceGroupMember:ServiceGroupMember';
//# sourceMappingURL=serviceGroupMember.js.map