LaunchTemplate

class LaunchTemplate : KotlinCustomResource

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

DEPRECATED: This resource has been deprecated from version 1.120.0. Please use new resource alicloud_ecs_launch_template.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
import com.pulumi.alicloud.ecs.LaunchTemplate;
import com.pulumi.alicloud.ecs.LaunchTemplateArgs;
import com.pulumi.alicloud.ecs.inputs.LaunchTemplateNetworkInterfacesArgs;
import com.pulumi.alicloud.ecs.inputs.LaunchTemplateDataDiskArgs;
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 images = EcsFunctions.getImages(GetImagesArgs.builder()
.owners("system")
.build());
final var instances = EcsFunctions.getInstances();
var template = new LaunchTemplate("template", LaunchTemplateArgs.builder()
.description("test1")
.imageId(images.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.hostName("tf-test-host")
.instanceChargeType("PrePaid")
.instanceName("tf-instance-name")
.instanceType(instances.applyValue(getInstancesResult -> getInstancesResult.instances()[0].instanceType()))
.internetChargeType("PayByBandwidth")
.internetMaxBandwidthIn(5)
.internetMaxBandwidthOut(0)
.ioOptimized("none")
.keyPairName("test-key-pair")
.ramRoleName("xxxxx")
.networkType("vpc")
.securityEnhancementStrategy("Active")
.spotPriceLimit(5)
.spotStrategy("SpotWithPriceLimit")
.securityGroupId("sg-zxcvj0lasdf102350asdf9a")
.systemDiskCategory("cloud_ssd")
.systemDiskDescription("test disk")
.systemDiskName("hello")
.systemDiskSize(40)
.resourceGroupId("rg-zkdfjahg9zxncv0")
.userdata("xxxxxxxxxxxxxx")
.vswitchId("sw-ljkngaksdjfj0nnasdf")
.vpcId("vpc-asdfnbg0as8dfk1nb2")
.zoneId("beijing-a")
.tags(Map.ofEntries(
Map.entry("tag1", "hello"),
Map.entry("tag2", "world")
))
.networkInterfaces(LaunchTemplateNetworkInterfacesArgs.builder()
.name("eth0")
.description("hello1")
.primaryIp("10.0.0.2")
.securityGroupId("xxxx")
.vswitchId("xxxxxxx")
.build())
.dataDisks(
LaunchTemplateDataDiskArgs.builder()
.name("disk1")
.description("test1")
.build(),
LaunchTemplateDataDiskArgs.builder()
.name("disk2")
.description("test2")
.build())
.build());
}
}

Import

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

$ pulumi import alicloud:ecs/launchTemplate:LaunchTemplate lt lt-abc1234567890000

Properties

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

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.

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

The description of the data disk.

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

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 id: Output<String>
Link copied to clipboard
val imageId: Output<String>?

Image ID.

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

Billing methods. Optional values:

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

The name of the instance. The name is a string of 2 to 128 characters. It must begin with an English or a Chinese character. It can contain A-Z, a-z, Chinese characters, numbers, periods (.), colons (:), underscores (_), and hyphens (-).

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

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

Link copied to clipboard

Internet bandwidth billing method. Optional values: PayByTraffic | PayByBandwidth.

Link copied to clipboard

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

Link copied to clipboard

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

Whether it is an I/O-optimized instance or not. Optional values:

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

The name of the key pair.

Link copied to clipboard
Link copied to clipboard
val name: Output<String>

The name of the data disk.

Link copied to clipboard

The list of network interfaces created with instance.

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

Network type of the instance. Value options: classic | vpc.

Link copied to clipboard
val passwordInherit: Output<Boolean>?
Link copied to clipboard
val period: Output<Int>?
Link copied to clipboard
val privateIpAddress: Output<String>?
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ramRoleName: Output<String>?

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>?
Link copied to clipboard

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

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

The security group ID must be one in the same VPC.

Link copied to clipboard
Link copied to clipboard
val spotDuration: Output<String>?
Link copied to clipboard
val spotPriceLimit: Output<Double>?

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

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

The spot strategy for a Pay-As-You-Go instance. This parameter is valid and required only when InstanceChargeType is set to PostPaid. Value range:

Link copied to clipboard
Link copied to clipboard

The category of the system disk. System disk type. Optional values:

Link copied to clipboard

System disk description. It cannot begin with http:// or https://.

Link copied to clipboard
val systemDiskName: Output<String>

System disk name. The name is a string of 2 to 128 characters. It must begin with an English or a Chinese character. It can contain A-Z, a-z, Chinese characters, numbers, periods (.), colons (:), underscores (_), and hyphens (-).

Link copied to clipboard
val systemDiskSize: Output<Int>

Size of the system disk, measured in GB. Value range: 20, 500.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
Link copied to clipboard
val templateTags: Output<Map<String, Any>>?
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userData: Output<String>
Link copied to clipboard
val userdata: Output<String>

User data of the instance, which is Base64-encoded. Size of the raw data cannot exceed 16 KB.

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

The VSwitch ID for ENI. The instance must be in the same zone of the same VPC network as the ENI, but they may belong to different VSwitches.

Link copied to clipboard
val zoneId: Output<String>

The zone ID of the instance.