Show / Hide Table of Contents

Class LaunchTemplate

Provides an ECS Launch Template resource.

For information about Launch Template and how to use it, see Launch Template.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var images = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
    {
        Owners = "system",
    }));
    var instances = Output.Create(AliCloud.Ecs.GetInstances.InvokeAsync());
    var template = new AliCloud.Ecs.LaunchTemplate("template", new AliCloud.Ecs.LaunchTemplateArgs
    {
        DataDisks = 
        {
            new AliCloud.Ecs.Inputs.LaunchTemplateDataDiskArgs
            {
                Description = "test1",
                Name = "disk1",
            },
            new AliCloud.Ecs.Inputs.LaunchTemplateDataDiskArgs
            {
                Description = "test2",
                Name = "disk2",
            },
        },
        Description = "test1",
        HostName = "tf-test-host",
        ImageId = images.Apply(images => images.Images[0].Id),
        InstanceChargeType = "PrePaid",
        InstanceName = "tf-instance-name",
        InstanceType = instances.Apply(instances => instances.Instances[0].InstanceType),
        InternetChargeType = "PayByBandwidth",
        InternetMaxBandwidthIn = 5,
        InternetMaxBandwidthOut = 0,
        IoOptimized = "none",
        KeyPairName = "test-key-pair",
        NetworkInterfaces = new AliCloud.Ecs.Inputs.LaunchTemplateNetworkInterfacesArgs
        {
            Description = "hello1",
            Name = "eth0",
            PrimaryIp = "10.0.0.2",
            SecurityGroupId = "xxxx",
            VswitchId = "xxxxxxx",
        },
        NetworkType = "vpc",
        RamRoleName = "xxxxx",
        ResourceGroupId = "rg-zkdfjahg9zxncv0",
        SecurityEnhancementStrategy = "Active",
        SecurityGroupId = "sg-zxcvj0lasdf102350asdf9a",
        SpotPriceLimit = 5,
        SpotStrategy = "SpotWithPriceLimit",
        SystemDiskCategory = "cloud_ssd",
        SystemDiskDescription = "test disk",
        SystemDiskName = "hello",
        SystemDiskSize = 40,
        Tags = 
        {
            { "tag1", "hello" },
            { "tag2", "world" },
        },
        Userdata = "xxxxxxxxxxxxxx",
        VpcId = "vpc-asdfnbg0as8dfk1nb2",
        VswitchId = "sw-ljkngaksdjfj0nnasdf",
        ZoneId = "beijing-a",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
LaunchTemplate
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Ecs
Assembly: Pulumi.AliCloud.dll
Syntax
public class LaunchTemplate : CustomResource

Constructors

View Source

LaunchTemplate(String, LaunchTemplateArgs, CustomResourceOptions)

Create a LaunchTemplate resource with the given unique name, arguments, and options.

Declaration
public LaunchTemplate(string name, LaunchTemplateArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

LaunchTemplateArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AutoReleaseTime

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

Declaration
public Output<string> AutoReleaseTime { get; }
Property Value
Type Description
Output<System.String>
View Source

DataDisks

The list of data disks created with instance.

Declaration
public Output<ImmutableArray<LaunchTemplateDataDisk>> DataDisks { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<LaunchTemplateDataDisk>>
View Source

Description

The description of the data disk.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

HostName

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 (-).

Declaration
public Output<string> HostName { get; }
Property Value
Type Description
Output<System.String>
View Source

ImageId

Image ID.

Declaration
public Output<string> ImageId { get; }
Property Value
Type Description
Output<System.String>
View Source

ImageOwnerAlias

Declaration
public Output<string> ImageOwnerAlias { get; }
Property Value
Type Description
Output<System.String>
View Source

InstanceChargeType

Billing methods. Optional values:

  • PrePaid: Monthly, or annual subscription. Make sure that your registered credit card is invalid or you have insufficient balance in your PayPal account. Otherwise, InvalidPayMethod error may occur.
  • PostPaid: Pay-As-You-Go.
Declaration
public Output<string> InstanceChargeType { get; }
Property Value
Type Description
Output<System.String>
View Source

InstanceName

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 (-).

Declaration
public Output<string> InstanceName { get; }
Property Value
Type Description
Output<System.String>
View Source

InstanceType

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

Declaration
public Output<string> InstanceType { get; }
Property Value
Type Description
Output<System.String>
View Source

InternetChargeType

Internet bandwidth billing method. Optional values: PayByTraffic.

Declaration
public Output<string> InternetChargeType { get; }
Property Value
Type Description
Output<System.String>
View Source

InternetMaxBandwidthIn

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

Declaration
public Output<int> InternetMaxBandwidthIn { get; }
Property Value
Type Description
Output<System.Int32>
View Source

InternetMaxBandwidthOut

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

Declaration
public Output<int?> InternetMaxBandwidthOut { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

IoOptimized

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

  • none
  • optimized
Declaration
public Output<string> IoOptimized { get; }
Property Value
Type Description
Output<System.String>
View Source

KeyPairName

The name of the key pair.

  • Ignore this parameter for Windows instances. It is null by default. Even if you enter this parameter, only the Password content is used.
  • The password logon method for Linux instances is set to forbidden upon initialization.
Declaration
public Output<string> KeyPairName { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

The name of the data disk.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

NetworkInterfaces

The list of network interfaces created with instance.

Declaration
public Output<LaunchTemplateNetworkInterfaces> NetworkInterfaces { get; }
Property Value
Type Description
Output<LaunchTemplateNetworkInterfaces>
View Source

NetworkType

Network type of the instance. Value options: Classic | VPC.

Declaration
public Output<string> NetworkType { get; }
Property Value
Type Description
Output<System.String>
View Source

RamRoleName

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

Declaration
public Output<string> RamRoleName { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceGroupId

Declaration
public Output<string> ResourceGroupId { get; }
Property Value
Type Description
Output<System.String>
View Source

SecurityEnhancementStrategy

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

Declaration
public Output<string> SecurityEnhancementStrategy { get; }
Property Value
Type Description
Output<System.String>
View Source

SecurityGroupId

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

Declaration
public Output<string> SecurityGroupId { get; }
Property Value
Type Description
Output<System.String>
View Source

SpotPriceLimit

-(Optional) Sets the maximum hourly instance price. Supports up to three decimal places.

Declaration
public Output<double?> SpotPriceLimit { get; }
Property Value
Type Description
Output<System.Nullable<System.Double>>
View Source

SpotStrategy

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:

  • NoSpot: Normal Pay-As-You-Go instance.
  • SpotWithPriceLimit: Sets the maximum price for a spot instance.
  • SpotAsPriceGo: The system automatically calculates the price. The maximum value is the Pay-As-You-Go price.
Declaration
public Output<string> SpotStrategy { get; }
Property Value
Type Description
Output<System.String>
View Source

SystemDiskCategory

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

  • cloud: Basic cloud disk.
  • cloud_efficiency: Ultra cloud disk.
  • cloud_ssd: SSD cloud Disks.
  • ephemeral_ssd: local SSD Disks
  • cloud_essd: ESSD cloud Disks.
Declaration
public Output<string> SystemDiskCategory { get; }
Property Value
Type Description
Output<System.String>
View Source

SystemDiskDescription

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

Declaration
public Output<string> SystemDiskDescription { get; }
Property Value
Type Description
Output<System.String>
View Source

SystemDiskName

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 (-).

Declaration
public Output<string> SystemDiskName { get; }
Property Value
Type Description
Output<System.String>
View Source

SystemDiskSize

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

Declaration
public Output<int?> SystemDiskSize { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

Tags

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

Userdata

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

Declaration
public Output<string> Userdata { get; }
Property Value
Type Description
Output<System.String>
View Source

VpcId

Declaration
public Output<string> VpcId { get; }
Property Value
Type Description
Output<System.String>
View Source

VswitchId

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.

Declaration
public Output<string> VswitchId { get; }
Property Value
Type Description
Output<System.String>
View Source

ZoneId

The zone ID of the instance.

Declaration
public Output<string> ZoneId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, LaunchTemplateState, CustomResourceOptions)

Get an existing LaunchTemplate resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static LaunchTemplate Get(string name, Input<string> id, LaunchTemplateState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

LaunchTemplateState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
LaunchTemplate
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.