@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
648 lines (647 loc) • 25.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages an AS group resource within HuaweiCloud.
*
* ## Example Usage
* ### Basic Autoscaling Group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const configurationId = config.requireObject("configurationId");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const myAsGroup = new huaweicloud.as.Group("myAsGroup", {
* scalingGroupName: "my_as_group",
* scalingConfigurationId: configurationId,
* desireInstanceNumber: 2,
* minInstanceNumber: 0,
* maxInstanceNumber: 10,
* vpcId: vpcId,
* deletePublicip: true,
* deleteInstances: "yes",
* networks: [{
* id: subnetId,
* }],
* tags: {
* foo: "bar",
* key: "value",
* },
* });
* ```
* ### Autoscaling Group Only Remove Members When Scaling Down
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const configurationId = config.requireObject("configurationId");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const myAsGroupOnlyRemoveMembers = new huaweicloud.as.Group("myAsGroupOnlyRemoveMembers", {
* scalingGroupName: "my_as_group_only_remove_members",
* scalingConfigurationId: configurationId,
* desireInstanceNumber: 2,
* minInstanceNumber: 0,
* maxInstanceNumber: 10,
* vpcId: vpcId,
* deletePublicip: true,
* deleteInstances: "no",
* networks: [{
* id: subnetId,
* }],
* });
* ```
* ### Autoscaling Group With Elastic Load Balancer Listener
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const configurationId = config.requireObject("configurationId");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const ipv4SubnetId = config.requireObject("ipv4SubnetId");
* const testLoadbalancer = new huaweicloud.elb.Loadbalancer("testLoadbalancer", {vipSubnetId: ipv4SubnetId});
* const testListener = new huaweicloud.elb.Listener("testListener", {
* protocol: "HTTP",
* protocolPort: 8080,
* loadbalancerId: testLoadbalancer.id,
* });
* const testPool = new huaweicloud.elb.Pool("testPool", {
* protocol: "HTTP",
* lbMethod: "ROUND_ROBIN",
* listenerId: testListener.id,
* });
* const myAsGroupWithEnhancedLb = new huaweicloud.as.Group("myAsGroupWithEnhancedLb", {
* scalingGroupName: "my_as_group_with_enhanced_lb",
* scalingConfigurationId: configurationId,
* desireInstanceNumber: 2,
* minInstanceNumber: 0,
* maxInstanceNumber: 10,
* vpcId: vpcId,
* networks: [{
* id: subnetId,
* }],
* lbaasListeners: [{
* poolId: testPool.id,
* protocolPort: testListener.protocolPort,
* }],
* });
* ```
*
* ## Import
*
* AS groups can be imported by their `id`. For example, bash
*
* ```sh
* $ pulumi import huaweicloud:As/group:Group test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`delete_instances`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the group. Also, you can ignore changes as below. hcl resource "huaweicloud_as_group" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* delete_instances,
*
* ]
*
* } }
*/
export declare class Group extends pulumi.CustomResource {
/**
* Get an existing Group 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: string, id: pulumi.Input<pulumi.ID>, state?: GroupState, opts?: pulumi.CustomResourceOptions): Group;
/**
* Returns true if the given object is an instance of Group. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Group;
/**
* The scaling activity type of the AS group.
*/
readonly activityType: pulumi.Output<string>;
/**
* Specifies the IAM agency name. If you change the agency,
* the new agency will be available for ECSs scaled out after the change.
*/
readonly agencyName: pulumi.Output<string>;
/**
* Specifies the availability zones in which to create the instances in the
* autoscaling group. If this field is not specified, the system will automatically specify one.
*/
readonly availabilityZones: pulumi.Output<string[]>;
/**
* schema: Deprecated; use availability_zones instead
*/
readonly availableZones: pulumi.Output<string[] | undefined>;
/**
* Specifies the cooling duration (in seconds). The value ranges from `0` to `86,400`.
* Defaults to `300`.
*/
readonly coolDownTime: pulumi.Output<number | undefined>;
/**
* The creation time of the AS group.
*/
readonly createTime: pulumi.Output<string>;
/**
* The number of current instances in the AS group.
*/
readonly currentInstanceNumber: pulumi.Output<number>;
/**
* Specifies whether to delete the instances in the AS group when deleting
* the AS group. The options are **yes** and **no**.
*/
readonly deleteInstances: pulumi.Output<string | undefined>;
/**
* Specifies whether to release the EIPs bound to ECSs when the ECSs are removed
* from the AS group. Defaults to **false**.
*/
readonly deletePublicip: pulumi.Output<boolean | undefined>;
/**
* Specifies whether to delete the data disks attached to ECSs when the ECSs are removed.
* Defaults to **false**.
*/
readonly deleteVolume: pulumi.Output<boolean>;
/**
* Specifies the description of the AS group.
* The value can contain `0` to `256` characters.
*/
readonly description: pulumi.Output<string>;
/**
* Specifies the expected number of instances. The default value is the
* minimum number of instances. The value ranges from the minimum number of instances to the maximum number of instances.
*/
readonly desireInstanceNumber: pulumi.Output<number>;
/**
* The details about the AS group. If a scaling action fails, this parameter is used to record errors.
*/
readonly detail: pulumi.Output<string>;
/**
* Specifies whether to enable the AS Group. Defaults to **true**.
*/
readonly enable: pulumi.Output<boolean | undefined>;
/**
* Specifies the enterprise project ID of the AS group.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies whether to forcibly delete the AS group, remove the ECS instances and
* release them. Defaults to **false**.
*/
readonly forceDelete: pulumi.Output<boolean | undefined>;
/**
* Specifies the health check grace period for instances.
* The unit is second and the value ranges from `0` to `86,400`. Defaults to `600`.
*/
readonly healthPeriodicAuditGracePeriod: pulumi.Output<number>;
/**
* Specifies the health check method for instances in the AS group.
* The health check methods include **ELB_AUDIT** and **NOVA_AUDIT**. If load balancing is configured, the default value of
* this parameter is **ELB_AUDIT**. Otherwise, the default value is **NOVA_AUDIT**.
*/
readonly healthPeriodicAuditMethod: pulumi.Output<string | undefined>;
/**
* Specifies the health check period for instances. The unit is minute
* and value includes **0**, **1**, **5** (default), **15**, **60**, and **180**.
* If the value is set to **0**, health check is performed every 10 seconds.
*/
readonly healthPeriodicAuditTime: pulumi.Output<number | undefined>;
/**
* Specifies the instance removal policy. The policy has four
* options: **OLD_CONFIG_OLD_INSTANCE** (default), **OLD_CONFIG_NEW_INSTANCE**, **OLD_INSTANCE**, and **NEW_INSTANCE**.
*/
readonly instanceTerminatePolicy: pulumi.Output<string | undefined>;
/**
* The instances IDs of the AS group.
*/
readonly instances: pulumi.Output<string[]>;
/**
* The scaling flag of the AS group.
*/
readonly isScaling: pulumi.Output<boolean>;
/**
* The system supports the binding of up to six ELB listeners, the IDs of which are separated using a comma.
*
* @deprecated use lbaas_listeners instead
*/
readonly lbListenerId: pulumi.Output<string | undefined>;
/**
* Specifies an array of one or more enhanced load balancer. The system supports
* the binding of up to six load balancers. The lbaasListeners structure is documented below.
*/
readonly lbaasListeners: pulumi.Output<outputs.As.GroupLbaasListener[]>;
/**
* Specifies the maximum number of instances. The value ranges from `0` to `300`.
* Defaults to `0`.
*/
readonly maxInstanceNumber: pulumi.Output<number | undefined>;
/**
* Specifies the minimum number of instances. Defaults to `0`.
*/
readonly minInstanceNumber: pulumi.Output<number | undefined>;
/**
* Specifies the priority policy used to select target AZs when adjusting
* the number of instances in an AS group. The value can be **EQUILIBRIUM_DISTRIBUTE** or **PICK_FIRST**.
*/
readonly multiAzScalingPolicy: pulumi.Output<string>;
/**
* Specifies an array of one or more network IDs. The system supports up to five networks.
* The networks structure is documented below.
*/
readonly networks: pulumi.Output<outputs.As.GroupNetwork[]>;
/**
* schema: Deprecated; The notification mode has been canceled
*/
readonly notifications: pulumi.Output<string[] | undefined>;
/**
* Specifies the region in which to create the AS group.
* If omitted, the provider-level region will be used. Changing this creates a new group.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the configuration ID which defines configurations
* of instances in the AS group.
*/
readonly scalingConfigurationId: pulumi.Output<string>;
/**
* The name of the AS configuration to which the AS group belongs.
*/
readonly scalingConfigurationName: pulumi.Output<string>;
/**
* Specifies the name of the scaling group. The name can contain
* letters, digits, underscores(_), and hyphens(-),and cannot exceed 64 characters.
*/
readonly scalingGroupName: pulumi.Output<string>;
/**
* Specifies an array of one or more security group IDs to associate with the group.
* The securityGroups structure is documented below.
*/
readonly securityGroups: pulumi.Output<outputs.As.GroupSecurityGroup[]>;
/**
* The status of the AS group.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies the key/value pairs to associate with the AS group.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Specifies the VPC ID. Changing this creates a new group.
*/
readonly vpcId: pulumi.Output<string>;
/**
* Create a Group resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GroupArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Group resources.
*/
export interface GroupState {
/**
* The scaling activity type of the AS group.
*/
activityType?: pulumi.Input<string>;
/**
* Specifies the IAM agency name. If you change the agency,
* the new agency will be available for ECSs scaled out after the change.
*/
agencyName?: pulumi.Input<string>;
/**
* Specifies the availability zones in which to create the instances in the
* autoscaling group. If this field is not specified, the system will automatically specify one.
*/
availabilityZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* schema: Deprecated; use availability_zones instead
*/
availableZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the cooling duration (in seconds). The value ranges from `0` to `86,400`.
* Defaults to `300`.
*/
coolDownTime?: pulumi.Input<number>;
/**
* The creation time of the AS group.
*/
createTime?: pulumi.Input<string>;
/**
* The number of current instances in the AS group.
*/
currentInstanceNumber?: pulumi.Input<number>;
/**
* Specifies whether to delete the instances in the AS group when deleting
* the AS group. The options are **yes** and **no**.
*/
deleteInstances?: pulumi.Input<string>;
/**
* Specifies whether to release the EIPs bound to ECSs when the ECSs are removed
* from the AS group. Defaults to **false**.
*/
deletePublicip?: pulumi.Input<boolean>;
/**
* Specifies whether to delete the data disks attached to ECSs when the ECSs are removed.
* Defaults to **false**.
*/
deleteVolume?: pulumi.Input<boolean>;
/**
* Specifies the description of the AS group.
* The value can contain `0` to `256` characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies the expected number of instances. The default value is the
* minimum number of instances. The value ranges from the minimum number of instances to the maximum number of instances.
*/
desireInstanceNumber?: pulumi.Input<number>;
/**
* The details about the AS group. If a scaling action fails, this parameter is used to record errors.
*/
detail?: pulumi.Input<string>;
/**
* Specifies whether to enable the AS Group. Defaults to **true**.
*/
enable?: pulumi.Input<boolean>;
/**
* Specifies the enterprise project ID of the AS group.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies whether to forcibly delete the AS group, remove the ECS instances and
* release them. Defaults to **false**.
*/
forceDelete?: pulumi.Input<boolean>;
/**
* Specifies the health check grace period for instances.
* The unit is second and the value ranges from `0` to `86,400`. Defaults to `600`.
*/
healthPeriodicAuditGracePeriod?: pulumi.Input<number>;
/**
* Specifies the health check method for instances in the AS group.
* The health check methods include **ELB_AUDIT** and **NOVA_AUDIT**. If load balancing is configured, the default value of
* this parameter is **ELB_AUDIT**. Otherwise, the default value is **NOVA_AUDIT**.
*/
healthPeriodicAuditMethod?: pulumi.Input<string>;
/**
* Specifies the health check period for instances. The unit is minute
* and value includes **0**, **1**, **5** (default), **15**, **60**, and **180**.
* If the value is set to **0**, health check is performed every 10 seconds.
*/
healthPeriodicAuditTime?: pulumi.Input<number>;
/**
* Specifies the instance removal policy. The policy has four
* options: **OLD_CONFIG_OLD_INSTANCE** (default), **OLD_CONFIG_NEW_INSTANCE**, **OLD_INSTANCE**, and **NEW_INSTANCE**.
*/
instanceTerminatePolicy?: pulumi.Input<string>;
/**
* The instances IDs of the AS group.
*/
instances?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The scaling flag of the AS group.
*/
isScaling?: pulumi.Input<boolean>;
/**
* The system supports the binding of up to six ELB listeners, the IDs of which are separated using a comma.
*
* @deprecated use lbaas_listeners instead
*/
lbListenerId?: pulumi.Input<string>;
/**
* Specifies an array of one or more enhanced load balancer. The system supports
* the binding of up to six load balancers. The lbaasListeners structure is documented below.
*/
lbaasListeners?: pulumi.Input<pulumi.Input<inputs.As.GroupLbaasListener>[]>;
/**
* Specifies the maximum number of instances. The value ranges from `0` to `300`.
* Defaults to `0`.
*/
maxInstanceNumber?: pulumi.Input<number>;
/**
* Specifies the minimum number of instances. Defaults to `0`.
*/
minInstanceNumber?: pulumi.Input<number>;
/**
* Specifies the priority policy used to select target AZs when adjusting
* the number of instances in an AS group. The value can be **EQUILIBRIUM_DISTRIBUTE** or **PICK_FIRST**.
*/
multiAzScalingPolicy?: pulumi.Input<string>;
/**
* Specifies an array of one or more network IDs. The system supports up to five networks.
* The networks structure is documented below.
*/
networks?: pulumi.Input<pulumi.Input<inputs.As.GroupNetwork>[]>;
/**
* schema: Deprecated; The notification mode has been canceled
*/
notifications?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the region in which to create the AS group.
* If omitted, the provider-level region will be used. Changing this creates a new group.
*/
region?: pulumi.Input<string>;
/**
* Specifies the configuration ID which defines configurations
* of instances in the AS group.
*/
scalingConfigurationId?: pulumi.Input<string>;
/**
* The name of the AS configuration to which the AS group belongs.
*/
scalingConfigurationName?: pulumi.Input<string>;
/**
* Specifies the name of the scaling group. The name can contain
* letters, digits, underscores(_), and hyphens(-),and cannot exceed 64 characters.
*/
scalingGroupName?: pulumi.Input<string>;
/**
* Specifies an array of one or more security group IDs to associate with the group.
* The securityGroups structure is documented below.
*/
securityGroups?: pulumi.Input<pulumi.Input<inputs.As.GroupSecurityGroup>[]>;
/**
* The status of the AS group.
*/
status?: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the AS group.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the VPC ID. Changing this creates a new group.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Group resource.
*/
export interface GroupArgs {
/**
* Specifies the IAM agency name. If you change the agency,
* the new agency will be available for ECSs scaled out after the change.
*/
agencyName?: pulumi.Input<string>;
/**
* Specifies the availability zones in which to create the instances in the
* autoscaling group. If this field is not specified, the system will automatically specify one.
*/
availabilityZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* schema: Deprecated; use availability_zones instead
*/
availableZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the cooling duration (in seconds). The value ranges from `0` to `86,400`.
* Defaults to `300`.
*/
coolDownTime?: pulumi.Input<number>;
/**
* Specifies whether to delete the instances in the AS group when deleting
* the AS group. The options are **yes** and **no**.
*/
deleteInstances?: pulumi.Input<string>;
/**
* Specifies whether to release the EIPs bound to ECSs when the ECSs are removed
* from the AS group. Defaults to **false**.
*/
deletePublicip?: pulumi.Input<boolean>;
/**
* Specifies whether to delete the data disks attached to ECSs when the ECSs are removed.
* Defaults to **false**.
*/
deleteVolume?: pulumi.Input<boolean>;
/**
* Specifies the description of the AS group.
* The value can contain `0` to `256` characters.
*/
description?: pulumi.Input<string>;
/**
* Specifies the expected number of instances. The default value is the
* minimum number of instances. The value ranges from the minimum number of instances to the maximum number of instances.
*/
desireInstanceNumber?: pulumi.Input<number>;
/**
* Specifies whether to enable the AS Group. Defaults to **true**.
*/
enable?: pulumi.Input<boolean>;
/**
* Specifies the enterprise project ID of the AS group.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies whether to forcibly delete the AS group, remove the ECS instances and
* release them. Defaults to **false**.
*/
forceDelete?: pulumi.Input<boolean>;
/**
* Specifies the health check grace period for instances.
* The unit is second and the value ranges from `0` to `86,400`. Defaults to `600`.
*/
healthPeriodicAuditGracePeriod?: pulumi.Input<number>;
/**
* Specifies the health check method for instances in the AS group.
* The health check methods include **ELB_AUDIT** and **NOVA_AUDIT**. If load balancing is configured, the default value of
* this parameter is **ELB_AUDIT**. Otherwise, the default value is **NOVA_AUDIT**.
*/
healthPeriodicAuditMethod?: pulumi.Input<string>;
/**
* Specifies the health check period for instances. The unit is minute
* and value includes **0**, **1**, **5** (default), **15**, **60**, and **180**.
* If the value is set to **0**, health check is performed every 10 seconds.
*/
healthPeriodicAuditTime?: pulumi.Input<number>;
/**
* Specifies the instance removal policy. The policy has four
* options: **OLD_CONFIG_OLD_INSTANCE** (default), **OLD_CONFIG_NEW_INSTANCE**, **OLD_INSTANCE**, and **NEW_INSTANCE**.
*/
instanceTerminatePolicy?: pulumi.Input<string>;
/**
* The system supports the binding of up to six ELB listeners, the IDs of which are separated using a comma.
*
* @deprecated use lbaas_listeners instead
*/
lbListenerId?: pulumi.Input<string>;
/**
* Specifies an array of one or more enhanced load balancer. The system supports
* the binding of up to six load balancers. The lbaasListeners structure is documented below.
*/
lbaasListeners?: pulumi.Input<pulumi.Input<inputs.As.GroupLbaasListener>[]>;
/**
* Specifies the maximum number of instances. The value ranges from `0` to `300`.
* Defaults to `0`.
*/
maxInstanceNumber?: pulumi.Input<number>;
/**
* Specifies the minimum number of instances. Defaults to `0`.
*/
minInstanceNumber?: pulumi.Input<number>;
/**
* Specifies the priority policy used to select target AZs when adjusting
* the number of instances in an AS group. The value can be **EQUILIBRIUM_DISTRIBUTE** or **PICK_FIRST**.
*/
multiAzScalingPolicy?: pulumi.Input<string>;
/**
* Specifies an array of one or more network IDs. The system supports up to five networks.
* The networks structure is documented below.
*/
networks: pulumi.Input<pulumi.Input<inputs.As.GroupNetwork>[]>;
/**
* schema: Deprecated; The notification mode has been canceled
*/
notifications?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the region in which to create the AS group.
* If omitted, the provider-level region will be used. Changing this creates a new group.
*/
region?: pulumi.Input<string>;
/**
* Specifies the configuration ID which defines configurations
* of instances in the AS group.
*/
scalingConfigurationId?: pulumi.Input<string>;
/**
* Specifies the name of the scaling group. The name can contain
* letters, digits, underscores(_), and hyphens(-),and cannot exceed 64 characters.
*/
scalingGroupName: pulumi.Input<string>;
/**
* Specifies an array of one or more security group IDs to associate with the group.
* The securityGroups structure is documented below.
*/
securityGroups?: pulumi.Input<pulumi.Input<inputs.As.GroupSecurityGroup>[]>;
/**
* Specifies the key/value pairs to associate with the AS group.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the VPC ID. Changing this creates a new group.
*/
vpcId: pulumi.Input<string>;
}