ScalingConfiguration

class ScalingConfiguration : KotlinCustomResource

Provides a ESS scaling configuration resource.

NOTE: Several instance types have outdated in some regions and availability zones, such as ecs.t1.*, ecs.s2.*, ecs.n1.* and so on. If you want to keep them, you should set is_outdated to true. For more about the upgraded instance type, refer to alicloud.ecs.getInstanceTypes datasource. NOTE: Available since v1.39.0.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.SecurityGroupRule;
import com.pulumi.alicloud.ecs.SecurityGroupRuleArgs;
import com.pulumi.alicloud.ess.ScalingGroup;
import com.pulumi.alicloud.ess.ScalingGroupArgs;
import com.pulumi.alicloud.ess.ScalingConfiguration;
import com.pulumi.alicloud.ess.ScalingConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableDiskCategory("cloud_efficiency")
.availableResourceCreation("VSwitch")
.build());
final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.cpuCoreCount(2)
.memorySize(4)
.build());
final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_18.*64")
.mostRecent(true)
.owners("system")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName(name)
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultSecurityGroupRule = new SecurityGroupRule("defaultSecurityGroupRule", SecurityGroupRuleArgs.builder()
.type("ingress")
.ipProtocol("tcp")
.nicType("intranet")
.policy("accept")
.portRange("22/22")
.priority(1)
.securityGroupId(defaultSecurityGroup.id())
.cidrIp("172.16.0.0/24")
.build());
var defaultScalingGroup = new ScalingGroup("defaultScalingGroup", ScalingGroupArgs.builder()
.minSize(1)
.maxSize(1)
.scalingGroupName(name)
.removalPolicies(
"OldestInstance",
"NewestInstance")
.vswitchIds(defaultSwitch.id())
.build());
var defaultScalingConfiguration = new ScalingConfiguration("defaultScalingConfiguration", ScalingConfigurationArgs.builder()
.scalingGroupId(defaultScalingGroup.id())
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.securityGroupId(defaultSecurityGroup.id())
.forceDelete(true)
.active(true)
.build());
}
}

Module Support

You can use to the existing autoscaling module to create a configuration, scaling group and lifecycle hook one-click.

Import

ESS scaling configuration can be imported using the id, e.g.

$ pulumi import alicloud:ess/scalingConfiguration:ScalingConfiguration example asg-abc123456

Properties

Link copied to clipboard
val active: Output<Boolean>

Whether active current scaling configuration in the specified scaling group. Default to false.

Link copied to clipboard

Performance mode of the t5 burstable instance. Valid values: 'Standard', 'Unlimited'.

Link copied to clipboard

DataDisk mappings to attach to ecs instance. See data_disk below for details.

Link copied to clipboard
val enable: Output<Boolean>?

Whether enable the specified scaling group(make it active) to which the current scaling configuration belongs.

Link copied to clipboard
val forceDelete: Output<Boolean>?

The last scaling configuration will be deleted forcibly with deleting its scaling group. Default to false.

Link copied to clipboard
val hostName: Output<String>?

Hostname of an ECS instance.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageId: Output<String>?

ID of an image file, indicating the image resource selected when an instance is enabled.

Link copied to clipboard
val imageName: Output<String>?

Name of an image file, indicating the image resource selected when an instance is enabled.

Link copied to clipboard
val instanceIds: Output<List<String>>?

It has been deprecated from version 1.6.0. New resource alicloud.ess.Attachment replaces it.

Link copied to clipboard
val instanceName: Output<String>?

Name of an ECS instance. Default to "ESS-Instance". It is valid from version 1.7.1.

Link copied to clipboard

intelligent configuration mode. In this mode, you only need to specify the number of vCPUs, memory size, instance family, and maximum price. The system selects an instance type that is provided at the lowest price based on your configurations to create ECS instances. This mode is available only for scaling groups that reside in virtual private clouds (VPCs). This mode helps reduce the failures of scale-out activities caused by insufficient inventory of instance types. See instance_pattern_info below for details.

Link copied to clipboard
val instanceType: Output<String>?

Resource type of an ECS instance.

Link copied to clipboard
val instanceTypes: Output<List<String>>?

Resource types of an ECS instance.

Link copied to clipboard

Network billing type, Values: PayByBandwidth or PayByTraffic. Default to PayByBandwidth.

Link copied to clipboard

Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). The value range is 1,200.

Link copied to clipboard

Maximum outgoing bandwidth from the public network, measured in Mbps (Mega bit per second). The value range for PayByBandwidth is 0,100.

Link copied to clipboard
val ioOptimized: Output<String>?

It has been deprecated on instance resource. All the launched alicloud instances will be I/O optimized.

Link copied to clipboard
val isOutdated: Output<Boolean>?

Whether to use outdated instance type. Default to false.

Link copied to clipboard
val keyName: Output<String>?

The name of key pair that can login ECS instance successfully without password. If it is specified, the password would be invalid.

Link copied to clipboard

An KMS encrypts password used to a db account. If the password is filled in, this field will be ignored.

Link copied to clipboard

An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

Link copied to clipboard
val override: Output<Boolean>?

Indicates whether to overwrite the existing data. Default to false.

Link copied to clipboard
val password: Output<String>?

The password of the ECS instance. The password must be 8 to 30 characters in length. It must contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include () ~!@#$%^&*-_+=\|{}[]:;'<>,.?/, The password of Windows-based instances cannot start with a forward slash (/).

Link copied to clipboard
val passwordInherit: Output<Boolean>?

Specifies whether to use the password that is predefined in the image. If the PasswordInherit parameter is set to true, the password and kms_encrypted_password will be ignored. You must ensure that the selected image has a password configured.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>?

ID of resource group.

Link copied to clipboard
val roleName: Output<String>?

Instance RAM role name. The name is provided and maintained by RAM. You can use alicloud.ram.Role to create a new one.

Link copied to clipboard

Name shown for the scheduled task. which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is ScalingConfigurationId.

Link copied to clipboard
val scalingGroupId: Output<String>

ID of the scaling group of a scaling configuration.

Link copied to clipboard
val securityGroupId: Output<String>?

ID of the security group used to create new instance. It is conflict with security_group_ids.

Link copied to clipboard

List IDs of the security group used to create new instances. It is conflict with security_group_id.

Link copied to clipboard

Sets the maximum price hourly for instance types. See spot_price_limit below for details.

Link copied to clipboard
val spotStrategy: Output<String>?

The spot strategy for a Pay-As-You-Go instance. Valid values: NoSpot, SpotAsPriceGo, SpotWithPriceLimit.

Link copied to clipboard
val substitute: Output<String>

The another scaling configuration which will be active automatically and replace current configuration when setting active to 'false'. It is invalid when active is 'true'.

Link copied to clipboard

The id of auto snapshot policy for system disk.

Link copied to clipboard

Category of the system disk. The parameter value options are ephemeral_ssd, cloud_efficiency, cloud_ssd, cloud_essd and cloud. cloud only is used to some no I/O optimized instance. Default to cloud_efficiency.

Link copied to clipboard

The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Link copied to clipboard

Whether to encrypt the system disk.

Link copied to clipboard
val systemDiskName: Output<String>?

The name of the system disk. It must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). Default value: null.

Link copied to clipboard

The performance level of the ESSD used as the system disk.

Link copied to clipboard
val systemDiskSize: Output<Int>?

Size of system disk, in GiB. Optional values: cloud: 20-500, cloud_efficiency: 20-500, cloud_ssd: 20-500, ephemeral_ssd: 20-500 The default value is max{40, ImageSize}. If this parameter is set, the system disk size must be greater than or equal to max{40, ImageSize}.

Link copied to clipboard
val tags: Output<Map<String, Any>>?

A mapping of tags to assign to the resource. It will be applied for ECS instances finally.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userData: Output<String>?

User-defined data to customize the startup behaviors of the ECS instance and to pass data into the ECS instance.