@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
164 lines • 8.88 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.ScalingGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage scaling group
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooScalingGroup: volcengine.autoscaling.ScalingGroup[] = [];
* for (const range = {value: 0}; range.value < 3; range.value++) {
* fooScalingGroup.push(new volcengine.autoscaling.ScalingGroup(`fooScalingGroup-${range.value}`, {
* scalingGroupName: `acc-test-scaling-group-${range.value}`,
* subnetIds: [fooSubnet.id],
* multiAzPolicy: "BALANCE",
* desireInstanceNumber: 0,
* minInstanceNumber: 0,
* maxInstanceNumber: 10,
* instanceTerminatePolicy: "OldestInstance",
* defaultCooldown: 30,
* tags: [
* {
* key: "k2",
* value: "v2",
* },
* {
* key: "k1",
* value: "v1",
* },
* ],
* }));
* }
* ```
*
* ## Import
*
* ScalingGroup can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:autoscaling/scalingGroup:ScalingGroup default scg-mizl7m1kqccg5smt1bdpijuj
* ```
*/
class ScalingGroup extends pulumi.CustomResource {
/**
* Get an existing ScalingGroup 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 ScalingGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ScalingGroup. 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'] === ScalingGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activeScalingConfigurationId"] = state ? state.activeScalingConfigurationId : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["dbInstanceIds"] = state ? state.dbInstanceIds : undefined;
resourceInputs["defaultCooldown"] = state ? state.defaultCooldown : undefined;
resourceInputs["desireInstanceNumber"] = state ? state.desireInstanceNumber : undefined;
resourceInputs["healthCheckType"] = state ? state.healthCheckType : undefined;
resourceInputs["instanceTerminatePolicy"] = state ? state.instanceTerminatePolicy : undefined;
resourceInputs["launchTemplateId"] = state ? state.launchTemplateId : undefined;
resourceInputs["launchTemplateOverrides"] = state ? state.launchTemplateOverrides : undefined;
resourceInputs["launchTemplateVersion"] = state ? state.launchTemplateVersion : undefined;
resourceInputs["lifecycleState"] = state ? state.lifecycleState : undefined;
resourceInputs["loadBalancerHealthCheckGracePeriod"] = state ? state.loadBalancerHealthCheckGracePeriod : undefined;
resourceInputs["maxInstanceNumber"] = state ? state.maxInstanceNumber : undefined;
resourceInputs["minInstanceNumber"] = state ? state.minInstanceNumber : undefined;
resourceInputs["multiAzPolicy"] = state ? state.multiAzPolicy : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["scalingGroupId"] = state ? state.scalingGroupId : undefined;
resourceInputs["scalingGroupName"] = state ? state.scalingGroupName : undefined;
resourceInputs["scalingMode"] = state ? state.scalingMode : undefined;
resourceInputs["serverGroupAttributes"] = state ? state.serverGroupAttributes : undefined;
resourceInputs["stoppedInstanceCount"] = state ? state.stoppedInstanceCount : undefined;
resourceInputs["subnetIds"] = state ? state.subnetIds : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["totalInstanceCount"] = state ? state.totalInstanceCount : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.maxInstanceNumber === undefined) && !opts.urn) {
throw new Error("Missing required property 'maxInstanceNumber'");
}
if ((!args || args.minInstanceNumber === undefined) && !opts.urn) {
throw new Error("Missing required property 'minInstanceNumber'");
}
if ((!args || args.scalingGroupName === undefined) && !opts.urn) {
throw new Error("Missing required property 'scalingGroupName'");
}
if ((!args || args.subnetIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
resourceInputs["dbInstanceIds"] = args ? args.dbInstanceIds : undefined;
resourceInputs["defaultCooldown"] = args ? args.defaultCooldown : undefined;
resourceInputs["desireInstanceNumber"] = args ? args.desireInstanceNumber : undefined;
resourceInputs["instanceTerminatePolicy"] = args ? args.instanceTerminatePolicy : undefined;
resourceInputs["launchTemplateId"] = args ? args.launchTemplateId : undefined;
resourceInputs["launchTemplateOverrides"] = args ? args.launchTemplateOverrides : undefined;
resourceInputs["launchTemplateVersion"] = args ? args.launchTemplateVersion : undefined;
resourceInputs["maxInstanceNumber"] = args ? args.maxInstanceNumber : undefined;
resourceInputs["minInstanceNumber"] = args ? args.minInstanceNumber : undefined;
resourceInputs["multiAzPolicy"] = args ? args.multiAzPolicy : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["scalingGroupName"] = args ? args.scalingGroupName : undefined;
resourceInputs["scalingMode"] = args ? args.scalingMode : undefined;
resourceInputs["serverGroupAttributes"] = args ? args.serverGroupAttributes : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["activeScalingConfigurationId"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["healthCheckType"] = undefined /*out*/;
resourceInputs["lifecycleState"] = undefined /*out*/;
resourceInputs["loadBalancerHealthCheckGracePeriod"] = undefined /*out*/;
resourceInputs["scalingGroupId"] = undefined /*out*/;
resourceInputs["stoppedInstanceCount"] = undefined /*out*/;
resourceInputs["totalInstanceCount"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ScalingGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.ScalingGroup = ScalingGroup;
/** @internal */
ScalingGroup.__pulumiType = 'volcengine:autoscaling/scalingGroup:ScalingGroup';
//# sourceMappingURL=scalingGroup.js.map