InstanceArgs

data class InstanceArgs(val allocatePublicIp: Output<Boolean>? = null, val autoReleaseTime: Output<String>? = null, val autoRenewPeriod: Output<Int>? = null, val availabilityZone: Output<String>? = null, val creditSpecification: Output<String>? = null, val dataDisks: Output<List<InstanceDataDiskArgs>>? = null, val dedicatedHostId: Output<String>? = null, val deletionProtection: Output<Boolean>? = null, val deploymentSetId: Output<String>? = null, val description: Output<String>? = null, val dryRun: Output<Boolean>? = null, val enableJumboFrame: Output<Boolean>? = null, val forceDelete: Output<Boolean>? = null, val hostName: Output<String>? = null, val hpcClusterId: Output<String>? = null, val httpEndpoint: Output<String>? = null, val httpPutResponseHopLimit: Output<Int>? = null, val httpTokens: Output<String>? = null, val imageId: Output<String>? = null, val imageOptions: Output<InstanceImageOptionsArgs>? = null, val includeDataDisks: Output<Boolean>? = null, val instanceChargeType: Output<String>? = null, val instanceName: Output<String>? = null, val instanceType: Output<String>? = null, val internetChargeType: Output<String>? = null, val internetMaxBandwidthIn: Output<Int>? = null, val internetMaxBandwidthOut: Output<Int>? = null, val ipv6AddressCount: Output<Int>? = null, val ipv6Addresses: Output<List<String>>? = null, val isOutdated: Output<Boolean>? = null, val keyName: Output<String>? = null, val kmsEncryptedPassword: Output<String>? = null, val kmsEncryptionContext: Output<Map<String, String>>? = null, val launchTemplateId: Output<String>? = null, val launchTemplateName: Output<String>? = null, val launchTemplateVersion: Output<String>? = null, val maintenanceAction: Output<String>? = null, val maintenanceNotify: Output<Boolean>? = null, val maintenanceTime: Output<InstanceMaintenanceTimeArgs>? = null, val networkCardIndex: Output<Int>? = null, val networkInterfaceTrafficMode: Output<String>? = null, val networkInterfaces: Output<InstanceNetworkInterfacesArgs>? = null, val operatorType: Output<String>? = null, val password: Output<String>? = null, val passwordInherit: Output<Boolean>? = null, val period: Output<Int>? = null, val periodUnit: Output<String>? = null, val privateIp: Output<String>? = null, val queuePairNumber: Output<Int>? = null, val renewalStatus: Output<String>? = null, val resourceGroupId: Output<String>? = null, val roleName: Output<String>? = null, val secondaryPrivateIpAddressCount: Output<Int>? = null, val secondaryPrivateIps: Output<List<String>>? = null, val securityEnhancementStrategy: Output<String>? = null, val securityGroups: Output<List<String>>? = null, val spotDuration: Output<Int>? = null, val spotPriceLimit: Output<Double>? = null, val spotStrategy: Output<String>? = null, val status: Output<String>? = null, val stoppedMode: Output<String>? = null, val systemDiskAutoSnapshotPolicyId: Output<String>? = null, val systemDiskBurstingEnabled: Output<Boolean>? = null, val systemDiskCategory: Output<String>? = null, val systemDiskDescription: Output<String>? = null, val systemDiskEncryptAlgorithm: Output<String>? = null, val systemDiskEncrypted: Output<Boolean>? = null, val systemDiskKmsKeyId: Output<String>? = null, val systemDiskName: Output<String>? = null, val systemDiskPerformanceLevel: Output<String>? = null, val systemDiskProvisionedIops: Output<Int>? = null, val systemDiskSize: Output<Int>? = null, val systemDiskStorageClusterId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val userData: Output<String>? = null, val volumeTags: Output<Map<String, String>>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null) : ConvertibleToJava<InstanceArgs>

Provides a ECS instance resource.

NOTE: Available since v1.0.0 NOTE: From version v1.213.0, you can specify launch_template_id and launch_template_version to use a launch template. This eliminates the need to configure a large number of parameters every time you create instances.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const instanceType = config.get("instanceType") || "ecs.n4.large";
const imageId = config.get("imageId") || "ubuntu_18_04_64_20G_alibase_20190624.vhd";
// Create a new ECS instance for VPC
const vpc = new alicloud.vpc.Network("vpc", {
vpcName: name,
cidrBlock: "172.16.0.0/16",
});
// Create a new ECS instance for a VPC
const group = new alicloud.ecs.SecurityGroup("group", {
securityGroupName: name,
description: "foo",
vpcId: vpc.id,
});
const key = new alicloud.kms.Key("key", {
description: "Hello KMS",
pendingWindowInDays: 7,
status: "Enabled",
});
const _default = alicloud.getZones({
availableDiskCategory: "cloud_efficiency",
availableResourceCreation: "VSwitch",
availableInstanceType: instanceType,
});
const vswitch = new alicloud.vpc.Switch("vswitch", {
vpcId: vpc.id,
cidrBlock: "172.16.0.0/24",
zoneId: _default.then(_default => _default.zones?.[0]?.id),
vswitchName: name,
});
const instance = new alicloud.ecs.Instance("instance", {
availabilityZone: _default.then(_default => _default.zones?.[0]?.id),
securityGroups: [group].map(__item => __item.id),
instanceType: instanceType,
systemDiskCategory: "cloud_efficiency",
systemDiskName: name,
systemDiskDescription: "test_foo_system_disk_description",
imageId: imageId,
instanceName: name,
vswitchId: vswitch.id,
internetMaxBandwidthOut: 10,
dataDisks: [{
name: "disk2",
size: 20,
category: "cloud_efficiency",
description: "disk2",
encrypted: true,
kmsKeyId: key.id,
}],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
instance_type = config.get("instanceType")
if instance_type is None:
instance_type = "ecs.n4.large"
image_id = config.get("imageId")
if image_id is None:
image_id = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
# Create a new ECS instance for VPC
vpc = alicloud.vpc.Network("vpc",
vpc_name=name,
cidr_block="172.16.0.0/16")
# Create a new ECS instance for a VPC
group = alicloud.ecs.SecurityGroup("group",
security_group_name=name,
description="foo",
vpc_id=vpc.id)
key = alicloud.kms.Key("key",
description="Hello KMS",
pending_window_in_days=7,
status="Enabled")
default = alicloud.get_zones(available_disk_category="cloud_efficiency",
available_resource_creation="VSwitch",
available_instance_type=instance_type)
vswitch = alicloud.vpc.Switch("vswitch",
vpc_id=vpc.id,
cidr_block="172.16.0.0/24",
zone_id=default.zones[0].id,
vswitch_name=name)
instance = alicloud.ecs.Instance("instance",
availability_zone=default.zones[0].id,
security_groups=[__item&#46;id for __item in [group]],
instance_type=instance_type,
system_disk_category="cloud_efficiency",
system_disk_name=name,
system_disk_description="test_foo_system_disk_description",
image_id=image_id,
instance_name=name,
vswitch_id=vswitch.id,
internet_max_bandwidth_out=10,
data_disks=[{
"name": "disk2",
"size": 20,
"category": "cloud_efficiency",
"description": "disk2",
"encrypted": True,
"kms_key_id": key.id,
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var instanceType = config.Get("instanceType") ?? "ecs.n4.large";
var imageId = config.Get("imageId") ?? "ubuntu_18_04_64_20G_alibase_20190624.vhd";
// Create a new ECS instance for VPC
var vpc = new AliCloud.Vpc.Network("vpc", new()
{
VpcName = name,
CidrBlock = "172.16.0.0/16",
});
// Create a new ECS instance for a VPC
var @group = new AliCloud.Ecs.SecurityGroup("group", new()
{
SecurityGroupName = name,
Description = "foo",
VpcId = vpc.Id,
});
var key = new AliCloud.Kms.Key("key", new()
{
Description = "Hello KMS",
PendingWindowInDays = 7,
Status = "Enabled",
});
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableDiskCategory = "cloud_efficiency",
AvailableResourceCreation = "VSwitch",
AvailableInstanceType = instanceType,
});
var vswitch = new AliCloud.Vpc.Switch("vswitch", new()
{
VpcId = vpc.Id,
CidrBlock = "172.16.0.0/24",
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
VswitchName = name,
});
var instance = new AliCloud.Ecs.Instance("instance", new()
{
AvailabilityZone = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
SecurityGroups = new[]
{
@group,
}.Select(__item => __item.Id).ToList(),
InstanceType = instanceType,
SystemDiskCategory = "cloud_efficiency",
SystemDiskName = name,
SystemDiskDescription = "test_foo_system_disk_description",
ImageId = imageId,
InstanceName = name,
VswitchId = vswitch.Id,
InternetMaxBandwidthOut = 10,
DataDisks = new[]
{
new AliCloud.Ecs.Inputs.InstanceDataDiskArgs
{
Name = "disk2",
Size = 20,
Category = "cloud_efficiency",
Description = "disk2",
Encrypted = true,
KmsKeyId = key.Id,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example";
if param := cfg.Get("name"); param != ""{
name = param
}
instanceType := "ecs.n4.large";
if param := cfg.Get("instanceType"); param != ""{
instanceType = param
}
imageId := "ubuntu_18_04_64_20G_alibase_20190624.vhd";
if param := cfg.Get("imageId"); param != ""{
imageId = param
}
// Create a new ECS instance for VPC
vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
// Create a new ECS instance for a VPC
group, err := ecs.NewSecurityGroup(ctx, "group", &ecs.SecurityGroupArgs{
SecurityGroupName: pulumi.String(name),
Description: pulumi.String("foo"),
VpcId: vpc.ID(),
})
if err != nil {
return err
}
key, err := kms.NewKey(ctx, "key", &kms.KeyArgs{
Description: pulumi.String("Hello KMS"),
PendingWindowInDays: pulumi.Int(7),
Status: pulumi.String("Enabled"),
})
if err != nil {
return err
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableDiskCategory: pulumi.StringRef("cloud_efficiency"),
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
AvailableInstanceType: pulumi.StringRef(instanceType),
}, nil);
if err != nil {
return err
}
vswitch, err := vpc.NewSwitch(ctx, "vswitch", &vpc.SwitchArgs{
VpcId: vpc.ID(),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(_default.Zones[0].Id),
VswitchName: pulumi.String(name),
})
if err != nil {
return err
}
var splat0 pulumi.StringArray
for _, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
splat0 = append(splat0, val0.ID())
}
_, err = ecs.NewInstance(ctx, "instance", &ecs.InstanceArgs{
AvailabilityZone: pulumi.String(_default.Zones[0].Id),
SecurityGroups: splat0,
InstanceType: pulumi.String(instanceType),
SystemDiskCategory: pulumi.String("cloud_efficiency"),
SystemDiskName: pulumi.String(name),
SystemDiskDescription: pulumi.String("test_foo_system_disk_description"),
ImageId: pulumi.String(imageId),
InstanceName: pulumi.String(name),
VswitchId: vswitch.ID(),
InternetMaxBandwidthOut: pulumi.Int(10),
DataDisks: ecs.InstanceDataDiskArray{
&ecs.InstanceDataDiskArgs{
Name: pulumi.String("disk2"),
Size: pulumi.Int(20),
Category: pulumi.String("cloud_efficiency"),
Description: pulumi.String("disk2"),
Encrypted: pulumi.Bool(true),
KmsKeyId: key.ID(),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.kms.Key;
import com.pulumi.alicloud.kms.KeyArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.ecs.inputs.InstanceDataDiskArgs;
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 instanceType = config.get("instanceType").orElse("ecs.n4.large");
final var imageId = config.get("imageId").orElse("ubuntu_18_04_64_20G_alibase_20190624.vhd");
// Create a new ECS instance for VPC
var vpc = new Network("vpc", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/16")
.build());
// Create a new ECS instance for a VPC
var group = new SecurityGroup("group", SecurityGroupArgs.builder()
.securityGroupName(name)
.description("foo")
.vpcId(vpc.id())
.build());
var key = new Key("key", KeyArgs.builder()
.description("Hello KMS")
.pendingWindowInDays(7)
.status("Enabled")
.build());
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableDiskCategory("cloud_efficiency")
.availableResourceCreation("VSwitch")
.availableInstanceType(instanceType)
.build());
var vswitch = new Switch("vswitch", SwitchArgs.builder()
.vpcId(vpc.id())
.cidrBlock("172.16.0.0/24")
.zoneId(default_.zones()[0].id())
.vswitchName(name)
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.availabilityZone(default_.zones()[0].id())
.securityGroups(group.stream().map(element -> element.id()).collect(toList()))
.instanceType(instanceType)
.systemDiskCategory("cloud_efficiency")
.systemDiskName(name)
.systemDiskDescription("test_foo_system_disk_description")
.imageId(imageId)
.instanceName(name)
.vswitchId(vswitch.id())
.internetMaxBandwidthOut(10)
.dataDisks(InstanceDataDiskArgs.builder()
.name("disk2")
.size(20)
.category("cloud_efficiency")
.description("disk2")
.encrypted(true)
.kmsKeyId(key.id())
.build())
.build());
}
}

Module Support

You can use the existing ecs-instance module to create several ECS instances one-click.

Import

Instance can be imported using the id, e.g.

$ pulumi import alicloud:ecs/instance:Instance example i-abc12345678

Constructors

Link copied to clipboard
constructor(allocatePublicIp: Output<Boolean>? = null, autoReleaseTime: Output<String>? = null, autoRenewPeriod: Output<Int>? = null, availabilityZone: Output<String>? = null, creditSpecification: Output<String>? = null, dataDisks: Output<List<InstanceDataDiskArgs>>? = null, dedicatedHostId: Output<String>? = null, deletionProtection: Output<Boolean>? = null, deploymentSetId: Output<String>? = null, description: Output<String>? = null, dryRun: Output<Boolean>? = null, enableJumboFrame: Output<Boolean>? = null, forceDelete: Output<Boolean>? = null, hostName: Output<String>? = null, hpcClusterId: Output<String>? = null, httpEndpoint: Output<String>? = null, httpPutResponseHopLimit: Output<Int>? = null, httpTokens: Output<String>? = null, imageId: Output<String>? = null, imageOptions: Output<InstanceImageOptionsArgs>? = null, includeDataDisks: Output<Boolean>? = null, instanceChargeType: Output<String>? = null, instanceName: Output<String>? = null, instanceType: Output<String>? = null, internetChargeType: Output<String>? = null, internetMaxBandwidthIn: Output<Int>? = null, internetMaxBandwidthOut: Output<Int>? = null, ipv6AddressCount: Output<Int>? = null, ipv6Addresses: Output<List<String>>? = null, isOutdated: Output<Boolean>? = null, keyName: Output<String>? = null, kmsEncryptedPassword: Output<String>? = null, kmsEncryptionContext: Output<Map<String, String>>? = null, launchTemplateId: Output<String>? = null, launchTemplateName: Output<String>? = null, launchTemplateVersion: Output<String>? = null, maintenanceAction: Output<String>? = null, maintenanceNotify: Output<Boolean>? = null, maintenanceTime: Output<InstanceMaintenanceTimeArgs>? = null, networkCardIndex: Output<Int>? = null, networkInterfaceTrafficMode: Output<String>? = null, networkInterfaces: Output<InstanceNetworkInterfacesArgs>? = null, operatorType: Output<String>? = null, password: Output<String>? = null, passwordInherit: Output<Boolean>? = null, period: Output<Int>? = null, periodUnit: Output<String>? = null, privateIp: Output<String>? = null, queuePairNumber: Output<Int>? = null, renewalStatus: Output<String>? = null, resourceGroupId: Output<String>? = null, roleName: Output<String>? = null, secondaryPrivateIpAddressCount: Output<Int>? = null, secondaryPrivateIps: Output<List<String>>? = null, securityEnhancementStrategy: Output<String>? = null, securityGroups: Output<List<String>>? = null, spotDuration: Output<Int>? = null, spotPriceLimit: Output<Double>? = null, spotStrategy: Output<String>? = null, status: Output<String>? = null, stoppedMode: Output<String>? = null, systemDiskAutoSnapshotPolicyId: Output<String>? = null, systemDiskBurstingEnabled: Output<Boolean>? = null, systemDiskCategory: Output<String>? = null, systemDiskDescription: Output<String>? = null, systemDiskEncryptAlgorithm: Output<String>? = null, systemDiskEncrypted: Output<Boolean>? = null, systemDiskKmsKeyId: Output<String>? = null, systemDiskName: Output<String>? = null, systemDiskPerformanceLevel: Output<String>? = null, systemDiskProvisionedIops: Output<Int>? = null, systemDiskSize: Output<Int>? = null, systemDiskStorageClusterId: Output<String>? = null, tags: Output<Map<String, String>>? = null, userData: Output<String>? = null, volumeTags: Output<Map<String, String>>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null)

Properties

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

It has been deprecated from version "1.7.0". Setting "internet_max_bandwidth_out" larger than 0 can allocate a public ip address for an instance.

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

The automatic release time of the PostPaid instance. The time follows the ISO 8601 standard and is in UTC time. Format: yyyy-MM-ddTHH:mm:ssZ. It must be at least half an hour later than the current time and less than 3 years since the current time. Setting it to null can cancel automatic release feature, and the ECS instance will not be released automatically.

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

Auto renewal period of an instance, in the unit of month. It is valid when instance_charge_type is PrePaid. Default to 1. Valid value:

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

The Zone to start the instance in. It is ignored and will be computed when set vswitch_id.

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

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

Link copied to clipboard
val dataDisks: Output<List<InstanceDataDiskArgs>>? = null

The list of data disks created with instance. See data_disks below.

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

The ID of the dedicated host on which to create the instance. If you set the DedicatedHostId parameter, the spot_strategy and spot_price_limit parameters cannot be set. This is because preemptible instances cannot be created on dedicated hosts.

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

Whether enable the deletion protection or not. It does not work when the instance is spot. Default value: false.

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

The ID of the deployment set to which to deploy the instance. NOTE: From version 1.176.0, instance's deploymentSetId can be removed when 'deployment_set_id' = "".

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

Description of the instance, This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

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

Specifies whether to send a dry-run request. Default to false.

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

Specifies whether to enable the Jumbo Frames feature for the instance. Valid values: true, false.

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

If it is true, the "PrePaid" instance will be change to "PostPaid" and then deleted forcibly. However, because of changing instance charge type has CPU core count quota limitation, so strongly recommand that "Don't modify instance charge type frequentlly in one month".

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

Host name of the ECS, which is a string of at least two characters. “hostname” cannot start or end with “.” or “-“. In addition, two or more consecutive “.” or “-“ symbols are not allowed. On Windows, the host name can contain a maximum of 15 characters, which can be a combination of uppercase/lowercase letters, numerals, and “-“. The host name cannot contain dots (“.”) or contain only numeric characters. When it is changed, the instance will reboot to make the change take effect. On other OSs such as Linux, the host name can contain a maximum of 64 characters, which can be segments separated by dots (“.”), where each segment can contain uppercase/lowercase letters, numerals, or “_“. When it is changed, the instance will reboot to make the change take effect.

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

The ID of the Elastic High Performance Computing (E-HPC) cluster to which to assign the instance.

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

Specifies whether to enable the access channel for instance metadata. Valid values: enabled, disabled. Default value: enabled.

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

NOTE:: This parameter is not available for use yet. The HTTP PUT response hop limit for accessing instance metadata. Valid values: 1 to 64. Default value: 1.

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

Specifies whether to forcefully use the security-enhanced mode (IMDSv2) to access instance metadata. Default value: optional. Valid values:

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

The Image to use for the instance. ECS instance's image can be replaced via changing image_id. When it is changed, the instance will reboot to make the change take effect. If you do not use launch_template_id or launch_template_name to specify a launch template, you must specify image_id.

Link copied to clipboard

The options of images. See image_options below.

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

Whether to change instance disks charge type when changing instance charge type.

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

Valid values are PrePaid, PostPaid. NOTE: From version 1.243.0, the default value PostPaid will be removed. NOTE: Since 1.9.6, it can be changed each other between PostPaid and PrePaid. However, since some limitation about CPU core count in one month, there strongly recommends that Don't change instance_charge_type frequentlly in one month.

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

The name of the ECS. This instance_name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin with a hyphen, and must not begin with http:// or https://. NOTE: From version 1.243.0, the default value ECS-Instance will be removed.

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

The type of instance to start. When it is changed, the instance will reboot to make the change take effect. If you do not use launch_template_id or launch_template_name to specify a launch template, you must specify instance_type.

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

Internet charge type of the instance, Valid values are PayByBandwidth, PayByTraffic. At present, 'PrePaid' instance cannot change the value to "PayByBandwidth" from "PayByTraffic". NOTE: From version 1.243.0, the default value PayByTraffic will be removed.

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

Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). Value range: 1, 200. If this value is not specified, then automatically sets it to 200 Mbps.

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

Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: 0, 100. NOTE: From version 1.243.0, the default value 0 will be removed.

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

The number of IPv6 addresses to randomly generate for the primary ENI. Valid values: 1 to 10. NOTE: You cannot specify both the ipv6_addresses and ipv6_address_count parameters.

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

A list of IPv6 address to be assigned to the primary ENI. Support up to 10. NOTE: From version 1.241.0, ipv6_addresses can be modified.

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

Whether to use outdated instance type.

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 an instance. If the password is filled in, this field will be ignored. When it is changed, the instance will reboot to make the change take effect.

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

An KMS encryption context used to decrypt kms_encrypted_password before creating or updating an instance with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set. When it is changed, the instance will reboot to make the change take effect.

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

The ID of the launch template. For more information, see DescribeLaunchTemplates.To use a launch template to create an instance, you must use the launch_template_id or launch_template_name parameter to specify the launch template.

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

The name of the launch template.

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

The version of the launch template. If you set launch_template_id or launch_template_name parameter but do not set the version number of the launch template, the default template version is used.

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

The maintenance action. Valid values: Stop, AutoRecover and AutoRedeploy.

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

Specifies whether to send an event notification before instance shutdown. Valid values: true, false. Default value: false.

Link copied to clipboard

The time of maintenance. See maintenance_time below.

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

The index of the network card for Primary ENI.

Link copied to clipboard

The list of network interfaces created with instance. See network_interfaces below.

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

The communication mode of the Primary ENI. Default value: Standard. Valid values:

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

The operation type. It is valid when instance_charge_type is PrePaid. Default value: upgrade. Valid values: upgrade, downgrade. NOTE: When the new instance type specified by the instance_type parameter has lower specifications than the current instance type, you must set operator_type to downgrade.

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

Password to an instance is a string of 8 to 30 characters. It must contain uppercase/lowercase letters and numerals, but cannot contain special symbols. When it is changed, the instance will reboot to make the change take effect.

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

Specifies whether to use the password preset in the image. Default value: false. Valid values:

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

The duration that you will buy the resource, in month. It is valid and required when instance_charge_type is PrePaid. Valid values:

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

The duration unit that you will buy the resource. It is valid when instance_charge_type is 'PrePaid'. Valid value: "Week", "Month". Default to "Month".

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

Instance private IP address can be specified when you creating new instance. It is valid when vswitch_id is specified. When it is changed, the instance will reboot to make the change take effect.

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

The number of queues supported by the ERI.

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

Whether to renew an ECS instance automatically or not. It is valid when instance_charge_type is PrePaid. Default to "Normal". Valid values:

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

The Id of resource group which the instance belongs.

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 secondaryPrivateIpAddressCount: Output<Int>? = null

The number of private IP addresses to be automatically assigned from within the CIDR block of the vswitch. NOTE: To assign secondary private IP addresses, you must specify secondary_private_ips or secondary_private_ip_address_count but not both.

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

A list of Secondary private IP addresses which is selected from within the CIDR block of the vSwitch.

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

The security enhancement strategy.

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

A list of security group ids to associate with. If you do not use launch_template_id or launch_template_name to specify a launch template, you must specify security_groups.

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

The retention time of the preemptive instance in hours. Valid values: 0, 1, 2, 3, 4, 5, 6. Retention duration 2~6 is under invitation test, please submit a work order if you need to open. If the value is 0, the mode is no protection period. Default value is 1.

Link copied to clipboard
val spotPriceLimit: Output<Double>? = null

The hourly price threshold of a instance, and it takes effect only when parameter 'spot_strategy' is 'SpotWithPriceLimit'. Three decimals is allowed at most.

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

The spot strategy of a Pay-As-You-Go instance, and it takes effect only when parameter instance_charge_type is 'PostPaid'. Value range:

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

The instance status. Valid values: "Running", "Stopped". You can control the instance start and stop through this parameter. Default to Running.

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

The stop mode of the pay-as-you-go instance. Valid values: StopCharging,KeepCharging, Not-applicable. Default value: If the prerequisites required for enabling the economical mode are met, and you have enabled this mode in the ECS console, the default value is StopCharging. For more information, see "Enable the economical mode" in Economical mode. Otherwise, the default value is KeepCharging. Note: Not-applicable: Economical mode is not applicable to the instance.`

Link copied to clipboard

The ID of the automatic snapshot policy applied to the system disk.

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

Specifies whether to enable the performance burst feature for the system disk. Valid values:

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

Valid values are ephemeral_ssd, cloud_efficiency, cloud_ssd, cloud_essd, cloud, cloud_auto, cloud_essd_entry. only is used to some none I/O optimized instance. Valid values cloud_auto Available since v1.184.0.

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

The algorithm to be used to encrypt the system disk. Valid values are aes-256, sm4-128. Default value is aes-256.

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

Specifies whether to encrypt the system disk. Valid values: true,false. Default value: false.

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

The ID of the Key Management Service (KMS) key to be used for the system disk.

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

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

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

The performance level of the ESSD used as the system disk, Valid values: PL0, PL1, PL2, PL3, Default to PL1;For more information about ESSD, See Encryption Context.

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

The provisioned read/write IOPS of the ESSD AutoPL disk to use as the system disk.

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

Size of the system disk, measured in GiB. Value range: 20, 500. The specified value must be equal to or greater than max{20, Imagesize}. Default value: max{40, ImageSize}.

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

The ID of the dedicated block storage cluster. If you want to use disks in a dedicated block storage cluster as system disks when you create instances, you must specify this parameter. For more information about dedicated block storage clusters.

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

A mapping of tags to assign to the resource.

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

User-defined data to customize the startup behaviors of an ECS instance and to pass data into an ECS instance. It supports to setting a base64-encoded value, and it is the recommended usage. From version 1.60.0, it can be updated in-place. If updated, the instance will reboot to make the change take effect. Note: Not all changes will take effect, and it depends on cloud-init module type.

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

A mapping of tags to assign to the devices created by the instance at launch time.

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

The ID of the VPC.

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

The virtual switch ID to launch in VPC. This parameter must be set unless you can create classic network instances. When it is changed, the instance will reboot to make the change take effect.

Functions

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