EcsLaunchTemplateArgs

data class EcsLaunchTemplateArgs(val autoReleaseTime: Output<String>? = null, val dataDisks: Output<List<EcsLaunchTemplateDataDiskArgs>>? = null, val deploymentSetId: Output<String>? = null, val description: Output<String>? = null, val enableVmOsConfig: Output<Boolean>? = null, val hostName: Output<String>? = null, val imageId: Output<String>? = null, val imageOwnerAlias: Output<String>? = 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 ioOptimized: Output<String>? = null, val keyPairName: Output<String>? = null, val launchTemplateName: Output<String>? = null, val name: Output<String>? = null, val networkInterfaces: Output<EcsLaunchTemplateNetworkInterfacesArgs>? = null, val networkType: Output<String>? = null, val passwordInherit: Output<Boolean>? = null, val period: Output<Int>? = null, val privateIpAddress: Output<String>? = null, val ramRoleName: Output<String>? = null, val resourceGroupId: Output<String>? = null, val securityEnhancementStrategy: Output<String>? = null, val securityGroupId: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val spotDuration: Output<String>? = null, val spotPriceLimit: Output<Double>? = null, val spotStrategy: Output<String>? = null, val systemDisk: Output<EcsLaunchTemplateSystemDiskArgs>? = null, val systemDiskCategory: Output<String>? = null, val systemDiskDescription: Output<String>? = null, val systemDiskName: Output<String>? = null, val systemDiskSize: Output<Int>? = null, val tags: Output<Map<String, Any>>? = null, val templateResourceGroupId: Output<String>? = null, val templateTags: Output<Map<String, Any>>? = null, val userData: Output<String>? = null, val userdata: Output<String>? = null, val versionDescription: Output<String>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<EcsLaunchTemplateArgs>

Provides a ECS Launch Template resource. For information about ECS Launch Template and how to use it, see What is Launch Template.

NOTE: Available since v1.120.0.

Example Usage

Basic 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.EcsLaunchTemplate;
import com.pulumi.alicloud.ecs.EcsLaunchTemplateArgs;
import com.pulumi.alicloud.ecs.inputs.EcsLaunchTemplateSystemDiskArgs;
import com.pulumi.alicloud.ecs.inputs.EcsLaunchTemplateNetworkInterfacesArgs;
import com.pulumi.alicloud.ecs.inputs.EcsLaunchTemplateDataDiskArgs;
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 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()))
.build());
final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.owners("system")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultEcsLaunchTemplate = new EcsLaunchTemplate("defaultEcsLaunchTemplate", EcsLaunchTemplateArgs.builder()
.launchTemplateName("terraform-example")
.description("terraform-example")
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.hostName("terraform-example")
.instanceChargeType("PrePaid")
.instanceName("terraform-example")
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.internetChargeType("PayByBandwidth")
.internetMaxBandwidthIn("5")
.internetMaxBandwidthOut("5")
.ioOptimized("optimized")
.keyPairName("key_pair_name")
.ramRoleName("ram_role_name")
.networkType("vpc")
.securityEnhancementStrategy("Active")
.spotPriceLimit("5")
.spotStrategy("SpotWithPriceLimit")
.securityGroupIds(defaultSecurityGroup.id())
.systemDisk(EcsLaunchTemplateSystemDiskArgs.builder()
.category("cloud_ssd")
.description("Test For Terraform")
.name("terraform-example")
.size("40")
.deleteWithInstance("false")
.build())
.userData("xxxxxxx")
.vswitchId(defaultSwitch.id())
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.templateTags(Map.ofEntries(
Map.entry("Create", "Terraform"),
Map.entry("For", "example")
))
.networkInterfaces(EcsLaunchTemplateNetworkInterfacesArgs.builder()
.name("eth0")
.description("hello1")
.primaryIp("10.0.0.2")
.securityGroupId(defaultSecurityGroup.id())
.vswitchId(defaultSwitch.id())
.build())
.dataDisks(
EcsLaunchTemplateDataDiskArgs.builder()
.name("disk1")
.description("description")
.deleteWithInstance("true")
.category("cloud")
.encrypted("false")
.performanceLevel("PL0")
.size("20")
.build(),
EcsLaunchTemplateDataDiskArgs.builder()
.name("disk2")
.description("description2")
.deleteWithInstance("true")
.category("cloud")
.encrypted("false")
.performanceLevel("PL0")
.size("20")
.build())
.build());
}
}

Import

ECS Launch Template can be imported using the id, e.g.

$ pulumi import alicloud:ecs/ecsLaunchTemplate:EcsLaunchTemplate example <id>

Constructors

Link copied to clipboard
fun EcsLaunchTemplateArgs(autoReleaseTime: Output<String>? = null, dataDisks: Output<List<EcsLaunchTemplateDataDiskArgs>>? = null, deploymentSetId: Output<String>? = null, description: Output<String>? = null, enableVmOsConfig: Output<Boolean>? = null, hostName: Output<String>? = null, imageId: Output<String>? = null, imageOwnerAlias: Output<String>? = 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, ioOptimized: Output<String>? = null, keyPairName: Output<String>? = null, launchTemplateName: Output<String>? = null, name: Output<String>? = null, networkInterfaces: Output<EcsLaunchTemplateNetworkInterfacesArgs>? = null, networkType: Output<String>? = null, passwordInherit: Output<Boolean>? = null, period: Output<Int>? = null, privateIpAddress: Output<String>? = null, ramRoleName: Output<String>? = null, resourceGroupId: Output<String>? = null, securityEnhancementStrategy: Output<String>? = null, securityGroupId: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, spotDuration: Output<String>? = null, spotPriceLimit: Output<Double>? = null, spotStrategy: Output<String>? = null, systemDisk: Output<EcsLaunchTemplateSystemDiskArgs>? = null, systemDiskCategory: Output<String>? = null, systemDiskDescription: Output<String>? = null, systemDiskName: Output<String>? = null, systemDiskSize: Output<Int>? = null, tags: Output<Map<String, Any>>? = null, templateResourceGroupId: Output<String>? = null, templateTags: Output<Map<String, Any>>? = null, userData: Output<String>? = null, userdata: Output<String>? = null, versionDescription: Output<String>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

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

Properties

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

Instance auto release time. The time is presented using the ISO8601 standard and in UTC time. The format is YYYY-MM-DDTHH:MM:SSZ.

Link copied to clipboard

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

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

The Deployment Set Id.

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

Description of instance launch template version 1. It can be 2, 256 characters in length. It cannot start with "http://" or "https://". The default value is null.

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

Whether to enable the instance operating system configuration.

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

Instance host name.It cannot start or end with a period (.) or a hyphen (-) and it cannot have two or more consecutive periods (.) or hyphens (-).For Windows: The host name can be 2, 15 characters in length. It can contain A-Z, a-z, numbers, periods (.), and hyphens (-). It cannot only contain numbers. For other operating systems: The host name can be 2, 64 characters in length. It can be segments separated by periods (.). It can contain A-Z, a-z, numbers, and hyphens (-).

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

The Image ID.

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

Mirror source. Valid values: system, self, others, marketplace, "". Default to: "".

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

Billing methods. Valid values: PostPaid, PrePaid.

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

The name of the instance. The name 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 (-).

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

Instance type. For more information, call resource_alicloud_instances to obtain the latest instance type list.

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

Internet bandwidth billing method. Valid values: PayByTraffic, PayByBandwidth.

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

The maximum inbound bandwidth from the Internet network, measured in Mbit/s. Value range: 1, 200.

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

Maximum outbound bandwidth from the Internet, its unit of measurement is Mbit/s. Value range: 0, 100.

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

Whether it is an I/O-optimized instance or not. Valid values: none, optimized.

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

The name of the key pair.

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

The name of Launch Template.

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

It has been deprecated from version 1.120.0, and use field launch_template_name instead.

Link copied to clipboard

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

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

Network type of the instance. Valid values: classic, vpc.

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

Whether to use the password preset by the mirror.

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

The subscription period of the instance. Unit: months. This parameter takes effect and is required only when InstanceChargeType is set to PrePaid. If the DedicatedHostId parameter is specified, the value of the Period parameter must be within the subscription period of the dedicated host.

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

The private IP address of the instance.

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

The RAM role name of the instance. You can use the RAM API ListRoles to query instance RAM role names.

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

The ID of the resource group to which to assign the instance, Elastic Block Storage (EBS) device, and ENI.

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

Whether or not to activate the security enhancement feature and install network security software free of charge. Valid values: Active, Deactive.

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

The security group ID.

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

The ID of security group N to which to assign the instance.

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

The protection period of the preemptible instance. Unit: hours. Valid values: 0, 1, 2, 3, 4, 5, and 6. Default to: 1.

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

Sets the maximum hourly instance price. Supports up to three decimal places.

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

The spot strategy for a Pay-As-You-Go instance. This parameter is valid and required only when InstanceChargeType is set to PostPaid. Valid values: NoSpot, SpotAsPriceGo, SpotWithPriceLimit.

Link copied to clipboard

The System Disk. See system_disk below.

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

It has been deprecated from version 1.120.0, and use field system_disk instead.

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

It has been deprecated from version 1.120.0, and use field system_disk instead.

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

It has been deprecated from version 1.120.0, and use field system_disk instead.

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

It has been deprecated from version 1.120.0, and use field system_disk instead.

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

A mapping of tags to assign to instance, block storage, and elastic network.

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

The template resource group id.

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

A mapping of tags to assign to the launch template.

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

The User Data.

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

It has been deprecated from version 1.120.0, and use field user_data instead.

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

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

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

The ID of the VPC.

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

When creating a VPC-Connected instance, you must specify its VSwitch ID.

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

The zone ID of the instance.