@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
93 lines • 3.9 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.Basic = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Cloud Native Anti-DDos Basic resource within HuaweiCloud.
*
* > The Cloud Native Anti-DDos Basic resource will be set to the default traffic cleaning threshold when destroyed,
* instead of deleting it.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const eipId = config.requireObject("eipId");
* const antiddos1 = new huaweicloud.antiddos.Basic("antiddos1", {
* eipId: eipId,
* trafficThreshold: 150,
* });
* ```
*
* ## Import
*
* Cloud Native Anti-DDos Basic resources can be imported using `eip_id`. e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:AntiDDos/basic:Basic antiddos_1 c5256d47-8f9e-4ae7-9943-6e77e3d8bd2d
* ```
*/
class Basic extends pulumi.CustomResource {
/**
* Get an existing Basic 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 Basic(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Basic. 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'] === Basic.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["eipId"] = state ? state.eipId : undefined;
resourceInputs["publicIp"] = state ? state.publicIp : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["topicUrn"] = state ? state.topicUrn : undefined;
resourceInputs["trafficThreshold"] = state ? state.trafficThreshold : undefined;
}
else {
const args = argsOrState;
if ((!args || args.eipId === undefined) && !opts.urn) {
throw new Error("Missing required property 'eipId'");
}
if ((!args || args.trafficThreshold === undefined) && !opts.urn) {
throw new Error("Missing required property 'trafficThreshold'");
}
resourceInputs["eipId"] = args ? args.eipId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["topicUrn"] = args ? args.topicUrn : undefined;
resourceInputs["trafficThreshold"] = args ? args.trafficThreshold : undefined;
resourceInputs["publicIp"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Basic.__pulumiType, name, resourceInputs, opts);
}
}
exports.Basic = Basic;
/** @internal */
Basic.__pulumiType = 'huaweicloud:AntiDDos/basic:Basic';
//# sourceMappingURL=basic.js.map