@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
106 lines • 5.01 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.LifecycleHook = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an AS Lifecycle Hook resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const hookName = config.requireObject("hookName");
* const asGroupId = config.requireObject("asGroupId");
* const smnTopicUrn = config.requireObject("smnTopicUrn");
* const test = new huaweicloud.as.LifecycleHook("test", {
* scalingGroupId: asGroupId,
* type: "ADD",
* defaultResult: "ABANDON",
* notificationTopicUrn: smnTopicUrn,
* notificationMessage: "This is a test message",
* });
* ```
*
* ## Import
*
* Lifecycle hooks can be imported using the AS group ID and hook ID separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:As/lifecycleHook:LifecycleHook test <AS group ID>/<Lifecycle hook ID>
* ```
*/
class LifecycleHook extends pulumi.CustomResource {
/**
* Get an existing LifecycleHook 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 LifecycleHook(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LifecycleHook. 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'] === LifecycleHook.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["defaultResult"] = state ? state.defaultResult : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notificationMessage"] = state ? state.notificationMessage : undefined;
resourceInputs["notificationTopicName"] = state ? state.notificationTopicName : undefined;
resourceInputs["notificationTopicUrn"] = state ? state.notificationTopicUrn : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["scalingGroupId"] = state ? state.scalingGroupId : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.notificationTopicUrn === undefined) && !opts.urn) {
throw new Error("Missing required property 'notificationTopicUrn'");
}
if ((!args || args.scalingGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'scalingGroupId'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["defaultResult"] = args ? args.defaultResult : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["notificationMessage"] = args ? args.notificationMessage : undefined;
resourceInputs["notificationTopicUrn"] = args ? args.notificationTopicUrn : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["scalingGroupId"] = args ? args.scalingGroupId : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["notificationTopicName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LifecycleHook.__pulumiType, name, resourceInputs, opts);
}
}
exports.LifecycleHook = LifecycleHook;
/** @internal */
LifecycleHook.__pulumiType = 'huaweicloud:As/lifecycleHook:LifecycleHook';
//# sourceMappingURL=lifecycleHook.js.map