LaunchTemplateArgs

data class LaunchTemplateArgs(val autoReleaseTime: Output<String>? = null, val autoRenew: Output<Boolean>? = null, val autoRenewPeriod: Output<Int>? = null, val dataDisks: Output<List<LaunchTemplateDataDiskArgs>>? = null, val defaultVersionNumber: Output<Int>? = null, val deploymentSetId: Output<String>? = null, val description: Output<String>? = null, val enableVmOsConfig: Output<Boolean>? = null, val hostName: Output<String>? = null, val httpEndpoint: Output<String>? = null, val httpPutResponseHopLimit: Output<Int>? = null, val httpTokens: 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<LaunchTemplateNetworkInterfacesArgs>? = null, val networkType: Output<String>? = null, val passwordInherit: Output<Boolean>? = null, val period: Output<Int>? = null, val periodUnit: Output<String>? = 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<LaunchTemplateSystemDiskArgs>? = 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, String>>? = null, val templateResourceGroupId: Output<String>? = null, val templateTags: Output<Map<String, String>>? = null, val updateDefaultVersionNumber: Output<Boolean>? = 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<LaunchTemplateArgs>

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const images = alicloud.ecs.getImages({
owners: "system",
});
const instances = alicloud.ecs.getInstances({});
const template = new alicloud.ecs.LaunchTemplate("template", {
name: "tf-test-template",
description: "test1",
imageId: images.then(images => images.images?.[0]?.id),
hostName: "tf-test-host",
instanceChargeType: "PrePaid",
instanceName: "tf-instance-name",
instanceType: instances.then(instances => instances.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: {
tag1: "hello",
tag2: "world",
},
networkInterfaces: {
name: "eth0",
description: "hello1",
primaryIp: "10.0.0.2",
securityGroupId: "xxxx",
vswitchId: "xxxxxxx",
},
dataDisks: [
{
name: "disk1",
description: "test1",
},
{
name: "disk2",
description: "test2",
},
],
});
import pulumi
import pulumi_alicloud as alicloud
images = alicloud.ecs.get_images(owners="system")
instances = alicloud.ecs.get_instances()
template = alicloud.ecs.LaunchTemplate("template",
name="tf-test-template",
description="test1",
image_id=images.images[0].id,
host_name="tf-test-host",
instance_charge_type="PrePaid",
instance_name="tf-instance-name",
instance_type=instances.instances[0].instance_type,
internet_charge_type="PayByBandwidth",
internet_max_bandwidth_in=5,
internet_max_bandwidth_out=0,
io_optimized="none",
key_pair_name="test-key-pair",
ram_role_name="xxxxx",
network_type="vpc",
security_enhancement_strategy="Active",
spot_price_limit=5,
spot_strategy="SpotWithPriceLimit",
security_group_id="sg-zxcvj0lasdf102350asdf9a",
system_disk_category="cloud_ssd",
system_disk_description="test disk",
system_disk_name="hello",
system_disk_size=40,
resource_group_id="rg-zkdfjahg9zxncv0",
userdata="xxxxxxxxxxxxxx",
vswitch_id="sw-ljkngaksdjfj0nnasdf",
vpc_id="vpc-asdfnbg0as8dfk1nb2",
zone_id="beijing-a",
tags={
"tag1": "hello",
"tag2": "world",
},
network_interfaces={
"name": "eth0",
"description": "hello1",
"primary_ip": "10.0.0.2",
"security_group_id": "xxxx",
"vswitch_id": "xxxxxxx",
},
data_disks=[
{
"name": "disk1",
"description": "test1",
},
{
"name": "disk2",
"description": "test2",
},
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var images = AliCloud.Ecs.GetImages.Invoke(new()
{
Owners = "system",
});
var instances = AliCloud.Ecs.GetInstances.Invoke();
var template = new AliCloud.Ecs.LaunchTemplate("template", new()
{
Name = "tf-test-template",
Description = "test1",
ImageId = images.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
HostName = "tf-test-host",
InstanceChargeType = "PrePaid",
InstanceName = "tf-instance-name",
InstanceType = instances.Apply(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 =
{
{ "tag1", "hello" },
{ "tag2", "world" },
},
NetworkInterfaces = new AliCloud.Ecs.Inputs.LaunchTemplateNetworkInterfacesArgs
{
Name = "eth0",
Description = "hello1",
PrimaryIp = "10.0.0.2",
SecurityGroupId = "xxxx",
VswitchId = "xxxxxxx",
},
DataDisks = new[]
{
new AliCloud.Ecs.Inputs.LaunchTemplateDataDiskArgs
{
Name = "disk1",
Description = "test1",
},
new AliCloud.Ecs.Inputs.LaunchTemplateDataDiskArgs
{
Name = "disk2",
Description = "test2",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
images, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
Owners: pulumi.StringRef("system"),
}, nil)
if err != nil {
return err
}
instances, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{}, nil)
if err != nil {
return err
}
_, err = ecs.NewLaunchTemplate(ctx, "template", &ecs.LaunchTemplateArgs{
Name: pulumi.String("tf-test-template"),
Description: pulumi.String("test1"),
ImageId: pulumi.String(images.Images[0].Id),
HostName: pulumi.String("tf-test-host"),
InstanceChargeType: pulumi.String("PrePaid"),
InstanceName: pulumi.String("tf-instance-name"),
InstanceType: pulumi.String(instances.Instances[0].InstanceType),
InternetChargeType: pulumi.String("PayByBandwidth"),
InternetMaxBandwidthIn: pulumi.Int(5),
InternetMaxBandwidthOut: pulumi.Int(0),
IoOptimized: pulumi.String("none"),
KeyPairName: pulumi.String("test-key-pair"),
RamRoleName: pulumi.String("xxxxx"),
NetworkType: pulumi.String("vpc"),
SecurityEnhancementStrategy: pulumi.String("Active"),
SpotPriceLimit: pulumi.Float64(5),
SpotStrategy: pulumi.String("SpotWithPriceLimit"),
SecurityGroupId: pulumi.String("sg-zxcvj0lasdf102350asdf9a"),
SystemDiskCategory: pulumi.String("cloud_ssd"),
SystemDiskDescription: pulumi.String("test disk"),
SystemDiskName: pulumi.String("hello"),
SystemDiskSize: pulumi.Int(40),
ResourceGroupId: pulumi.String("rg-zkdfjahg9zxncv0"),
Userdata: pulumi.String("xxxxxxxxxxxxxx"),
VswitchId: pulumi.String("sw-ljkngaksdjfj0nnasdf"),
VpcId: pulumi.String("vpc-asdfnbg0as8dfk1nb2"),
ZoneId: pulumi.String("beijing-a"),
Tags: pulumi.StringMap{
"tag1": pulumi.String("hello"),
"tag2": pulumi.String("world"),
},
NetworkInterfaces: &ecs.LaunchTemplateNetworkInterfacesArgs{
Name: pulumi.String("eth0"),
Description: pulumi.String("hello1"),
PrimaryIp: pulumi.String("10.0.0.2"),
SecurityGroupId: pulumi.String("xxxx"),
VswitchId: pulumi.String("xxxxxxx"),
},
DataDisks: ecs.LaunchTemplateDataDiskArray{
&ecs.LaunchTemplateDataDiskArgs{
Name: pulumi.String("disk1"),
Description: pulumi.String("test1"),
},
&ecs.LaunchTemplateDataDiskArgs{
Name: pulumi.String("disk2"),
Description: pulumi.String("test2"),
},
},
})
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.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(GetInstancesArgs.builder()
.build());
var template = new LaunchTemplate("template", LaunchTemplateArgs.builder()
.name("tf-test-template")
.description("test1")
.imageId(images.images()[0].id())
.hostName("tf-test-host")
.instanceChargeType("PrePaid")
.instanceName("tf-instance-name")
.instanceType(instances.instances()[0].instanceType())
.internetChargeType("PayByBandwidth")
.internetMaxBandwidthIn(5)
.internetMaxBandwidthOut(0)
.ioOptimized("none")
.keyPairName("test-key-pair")
.ramRoleName("xxxxx")
.networkType("vpc")
.securityEnhancementStrategy("Active")
.spotPriceLimit(5.0)
.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());
}
}
resources:
template:
type: alicloud:ecs:LaunchTemplate
properties:
name: tf-test-template
description: test1
imageId: ${images.images[0].id}
hostName: tf-test-host
instanceChargeType: PrePaid
instanceName: tf-instance-name
instanceType: ${instances.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:
tag1: hello
tag2: world
networkInterfaces:
name: eth0
description: hello1
primaryIp: 10.0.0.2
securityGroupId: xxxx
vswitchId: xxxxxxx
dataDisks:
- name: disk1
description: test1
- name: disk2
description: test2
variables:
images:
fn::invoke:
function: alicloud:ecs:getImages
arguments:
owners: system
instances:
fn::invoke:
function: alicloud:ecs:getInstances
arguments: {}

Import

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

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

Constructors

Link copied to clipboard
constructor(autoReleaseTime: Output<String>? = null, autoRenew: Output<Boolean>? = null, autoRenewPeriod: Output<Int>? = null, dataDisks: Output<List<LaunchTemplateDataDiskArgs>>? = null, defaultVersionNumber: Output<Int>? = null, deploymentSetId: Output<String>? = null, description: Output<String>? = null, enableVmOsConfig: Output<Boolean>? = null, hostName: Output<String>? = null, httpEndpoint: Output<String>? = null, httpPutResponseHopLimit: Output<Int>? = null, httpTokens: 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<LaunchTemplateNetworkInterfacesArgs>? = null, networkType: Output<String>? = null, passwordInherit: Output<Boolean>? = null, period: Output<Int>? = null, periodUnit: Output<String>? = 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<LaunchTemplateSystemDiskArgs>? = null, systemDiskCategory: Output<String>? = null, systemDiskDescription: Output<String>? = null, systemDiskName: Output<String>? = null, systemDiskSize: Output<Int>? = null, tags: Output<Map<String, String>>? = null, templateResourceGroupId: Output<String>? = null, templateTags: Output<Map<String, String>>? = null, updateDefaultVersionNumber: Output<Boolean>? = 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)

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
val autoRenew: Output<Boolean>? = null
Link copied to clipboard
val autoRenewPeriod: Output<Int>? = null
Link copied to clipboard

The list of data disks created with instance.

Link copied to clipboard
val defaultVersionNumber: Output<Int>? = null
Link copied to clipboard
val deploymentSetId: Output<String>? = null
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
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 httpEndpoint: Output<String>? = null
Link copied to clipboard
val httpPutResponseHopLimit: Output<Int>? = null
Link copied to clipboard
val httpTokens: Output<String>? = null
Link copied to clipboard
val imageId: Output<String>? = null

Image ID.

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

Billing methods. Optional values:

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

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>? = 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. Optional 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. Optional values:

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

The name of the key pair.

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

Instance launch template name. Can contain 2, 128 characters in length. It must start with an English letter or Chinese, can contain numbers, periods (.), colons (:), underscores (_), and hyphens (-). It cannot start with "http://" or "https://".

Link copied to clipboard

The list of network interfaces created with instance.

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

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

Link copied to clipboard
val passwordInherit: Output<Boolean>? = null
Link copied to clipboard
val period: Output<Int>? = null
Link copied to clipboard
val periodUnit: Output<String>? = null
Link copied to clipboard
val privateIpAddress: Output<String>? = null
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
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. Optional 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
Link copied to clipboard
val spotDuration: Output<String>? = null
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. Value range:

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

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

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

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

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

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

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

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 templateResourceGroupId: Output<String>? = null
Link copied to clipboard
val templateTags: Output<Map<String, String>>? = null
Link copied to clipboard
val updateDefaultVersionNumber: Output<Boolean>? = null
Link copied to clipboard
val userData: Output<String>? = null
Link copied to clipboard
val userdata: Output<String>? = null

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

Link copied to clipboard
val versionDescription: Output<String>? = null
Link copied to clipboard
val vpcId: Output<String>? = null
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.

Functions

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