ScalingConfigurationArgs

data class ScalingConfigurationArgs(val active: Output<Boolean>? = null, val creditSpecification: Output<String>? = null, val dataDisks: Output<List<ScalingConfigurationDataDiskArgs>>? = null, val enable: Output<Boolean>? = null, val forceDelete: Output<Boolean>? = null, val hostName: Output<String>? = null, val imageId: Output<String>? = null, val imageName: Output<String>? = null, val instanceIds: Output<List<String>>? = null, val instanceName: Output<String>? = null, val instancePatternInfos: Output<List<ScalingConfigurationInstancePatternInfoArgs>>? = null, val instanceType: Output<String>? = null, val instanceTypes: Output<List<String>>? = null, val internetChargeType: Output<String>? = null, val internetMaxBandwidthIn: Output<Int>? = null, val internetMaxBandwidthOut: Output<Int>? = null, val ioOptimized: Output<String>? = null, val isOutdated: Output<Boolean>? = null, val keyName: Output<String>? = null, val kmsEncryptedPassword: Output<String>? = null, val kmsEncryptionContext: Output<Map<String, Any>>? = null, val override: Output<Boolean>? = null, val password: Output<String>? = null, val passwordInherit: Output<Boolean>? = null, val resourceGroupId: Output<String>? = null, val roleName: Output<String>? = null, val scalingConfigurationName: Output<String>? = null, val scalingGroupId: Output<String>? = null, val securityGroupId: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val spotPriceLimits: Output<List<ScalingConfigurationSpotPriceLimitArgs>>? = null, val spotStrategy: Output<String>? = null, val substitute: Output<String>? = null, val systemDiskAutoSnapshotPolicyId: Output<String>? = null, val systemDiskCategory: Output<String>? = null, val systemDiskDescription: Output<String>? = null, val systemDiskEncrypted: Output<Boolean>? = null, val systemDiskName: Output<String>? = null, val systemDiskPerformanceLevel: Output<String>? = null, val systemDiskSize: Output<Int>? = null, val tags: Output<Map<String, Any>>? = null, val userData: Output<String>? = null) : ConvertibleToJava<ScalingConfigurationArgs>

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

Constructors

Link copied to clipboard
fun ScalingConfigurationArgs(active: Output<Boolean>? = null, creditSpecification: Output<String>? = null, dataDisks: Output<List<ScalingConfigurationDataDiskArgs>>? = null, enable: Output<Boolean>? = null, forceDelete: Output<Boolean>? = null, hostName: Output<String>? = null, imageId: Output<String>? = null, imageName: Output<String>? = null, instanceIds: Output<List<String>>? = null, instanceName: Output<String>? = null, instancePatternInfos: Output<List<ScalingConfigurationInstancePatternInfoArgs>>? = null, instanceType: Output<String>? = null, instanceTypes: Output<List<String>>? = null, internetChargeType: Output<String>? = null, internetMaxBandwidthIn: Output<Int>? = null, internetMaxBandwidthOut: Output<Int>? = null, ioOptimized: Output<String>? = null, isOutdated: Output<Boolean>? = null, keyName: Output<String>? = null, kmsEncryptedPassword: Output<String>? = null, kmsEncryptionContext: Output<Map<String, Any>>? = null, override: Output<Boolean>? = null, password: Output<String>? = null, passwordInherit: Output<Boolean>? = null, resourceGroupId: Output<String>? = null, roleName: Output<String>? = null, scalingConfigurationName: Output<String>? = null, scalingGroupId: Output<String>? = null, securityGroupId: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, spotPriceLimits: Output<List<ScalingConfigurationSpotPriceLimitArgs>>? = null, spotStrategy: Output<String>? = null, substitute: Output<String>? = null, systemDiskAutoSnapshotPolicyId: Output<String>? = null, systemDiskCategory: Output<String>? = null, systemDiskDescription: Output<String>? = null, systemDiskEncrypted: Output<Boolean>? = null, systemDiskName: Output<String>? = null, systemDiskPerformanceLevel: Output<String>? = null, systemDiskSize: Output<Int>? = null, tags: Output<Map<String, Any>>? = null, userData: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ScalingConfigurationArgs

Properties

Link copied to clipboard
val active: Output<Boolean>? = null

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

Link copied to clipboard
val creditSpecification: Output<String>? = null

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>? = null

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

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

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

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

Hostname of an ECS instance.

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

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

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

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

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

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

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

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>? = null

Resource type of an ECS instance.

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

Resource types of an ECS instance.

Link copied to clipboard
val internetChargeType: Output<String>? = null

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

Link copied to clipboard
val internetMaxBandwidthIn: Output<Int>? = null

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

Link copied to clipboard
val internetMaxBandwidthOut: Output<Int>? = null

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>? = null

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>? = null

Whether to use outdated instance type. Default to false.

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

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
val kmsEncryptedPassword: Output<String>? = null

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

Link copied to clipboard
val kmsEncryptionContext: Output<Map<String, Any>>? = null

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>? = null

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

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

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>? = null

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 resourceGroupId: Output<String>? = null

ID of resource group.

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

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
val scalingConfigurationName: Output<String>? = null

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>? = null

ID of the scaling group of a scaling configuration.

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

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

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

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>? = null

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

Link copied to clipboard
val substitute: Output<String>? = null

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
val systemDiskCategory: Output<String>? = null

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
val systemDiskDescription: Output<String>? = null

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
val systemDiskEncrypted: Output<Boolean>? = null

Whether to encrypt the system disk.

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

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
val systemDiskPerformanceLevel: Output<String>? = null

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

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

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>>? = null

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

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

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