GetLaunchTemplate

Provides information about a Launch Template.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = Output.Create(Aws.Ec2.GetLaunchTemplate.InvokeAsync(new Aws.Ec2.GetLaunchTemplateArgs
        {
            Name = "my-launch-template",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "my-launch-template"
        _, err := ec2.LookupLaunchTemplate(ctx, &ec2.LookupLaunchTemplateArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

default = aws.ec2.get_launch_template(name="my-launch-template")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultLaunchTemplate = pulumi.output(aws.ec2.getLaunchTemplate({
    name: "my-launch-template",
}, { async: true }));

Filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Aws.Ec2.GetLaunchTemplate.InvokeAsync(new Aws.Ec2.GetLaunchTemplateArgs
        {
            Filters = 
            {
                new Aws.Ec2.Inputs.GetLaunchTemplateFilterArgs
                {
                    Name = "launch-template-name",
                    Values = 
                    {
                        "some-template",
                    },
                },
            },
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.LookupLaunchTemplate(ctx, &ec2.LookupLaunchTemplateArgs{
            Filters: []ec2.GetLaunchTemplateFilter{
                ec2.GetLaunchTemplateFilter{
                    Name: "launch-template-name",
                    Values: []string{
                        "some-template",
                    },
                },
            },
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test = aws.ec2.get_launch_template(filters=[{
    "name": "launch-template-name",
    "values": ["some-template"],
}])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = pulumi.output(aws.ec2.getLaunchTemplate({
    filters: [{
        name: "launch-template-name",
        values: ["some-template"],
    }],
}, { async: true }));

Using GetLaunchTemplate

function getLaunchTemplate(args: GetLaunchTemplateArgs, opts?: InvokeOptions): Promise<GetLaunchTemplateResult>
function  get_launch_template(filters=None, name=None, tags=None, opts=None)
func LookupLaunchTemplate(ctx *Context, args *LookupLaunchTemplateArgs, opts ...InvokeOption) (*LookupLaunchTemplateResult, error)

Note: This function is named LookupLaunchTemplate in the Go SDK.

public static class GetLaunchTemplate {
    public static Task<GetLaunchTemplateResult> InvokeAsync(GetLaunchTemplateArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetLaunchTemplateFilterArgs>

Configuration block(s) for filtering. Detailed below.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

Tags Dictionary<string, string>

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

Filters []GetLaunchTemplateFilter

Configuration block(s) for filtering. Detailed below.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

Tags map[string]string

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

filters GetLaunchTemplateFilter[]

Configuration block(s) for filtering. Detailed below.

name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

tags {[key: string]: string}

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

filters List[GetLaunchTemplateFilter]

Configuration block(s) for filtering. Detailed below.

name str

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

tags Dict[str, str]

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

GetLaunchTemplate Result

The following output properties are available:

Arn string

Amazon Resource Name (ARN) of the launch template.

BlockDeviceMappings List<GetLaunchTemplateBlockDeviceMapping>

Specify volumes to attach to the instance besides the volumes specified by the AMI.

CreditSpecifications List<GetLaunchTemplateCreditSpecification>

Customize the credit specification of the instance. See Credit Specification below for more details.

DefaultVersion int

The default version of the launch template.

Description string

Description of the launch template.

DisableApiTermination bool

If true, enables EC2 Instance Termination Protection

EbsOptimized string

If true, the launched EC2 instance will be EBS-optimized.

ElasticGpuSpecifications List<GetLaunchTemplateElasticGpuSpecification>

The elastic GPU to attach to the instance. See Elastic GPU below for more details.

HibernationOptions List<GetLaunchTemplateHibernationOption>

The hibernation options for the instance.

IamInstanceProfiles List<GetLaunchTemplateIamInstanceProfile>

The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.

Id string

The provider-assigned unique ID for this managed resource.

ImageId string

The AMI from which to launch the instance.

InstanceInitiatedShutdownBehavior string

Shutdown behavior for the instance. Can be stop or terminate. (Default: stop).

InstanceMarketOptions List<GetLaunchTemplateInstanceMarketOption>

The market (purchasing) option for the instance. below for details.

InstanceType string

The type of the instance.

KernelId string

The kernel ID.

KeyName string

The key name to use for the instance.

LatestVersion int

The latest version of the launch template.

MetadataOptions List<GetLaunchTemplateMetadataOption>

The metadata options for the instance.

Monitorings List<GetLaunchTemplateMonitoring>

The monitoring option for the instance.

NetworkInterfaces List<GetLaunchTemplateNetworkInterface>

Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.

Placements List<GetLaunchTemplatePlacement>

The placement of the instance.

RamDiskId string

The ID of the RAM disk.

SecurityGroupNames List<string>

A list of security group names to associate with. If you are creating Instances in a VPC, use vpc_security_group_ids instead.

TagSpecifications List<GetLaunchTemplateTagSpecification>

The tags to apply to the resources during launch.

Tags Dictionary<string, string>

(Optional) A map of tags to assign to the launch template.

UserData string

The Base64-encoded user data to provide when launching the instance.

VpcSecurityGroupIds List<string>

A list of security group IDs to associate with.

Filters List<GetLaunchTemplateFilter>
Name string
Arn string

Amazon Resource Name (ARN) of the launch template.

BlockDeviceMappings []GetLaunchTemplateBlockDeviceMapping

Specify volumes to attach to the instance besides the volumes specified by the AMI.

CreditSpecifications []GetLaunchTemplateCreditSpecification

Customize the credit specification of the instance. See Credit Specification below for more details.

DefaultVersion int

The default version of the launch template.

Description string

Description of the launch template.

DisableApiTermination bool

If true, enables EC2 Instance Termination Protection

EbsOptimized string

If true, the launched EC2 instance will be EBS-optimized.

ElasticGpuSpecifications []GetLaunchTemplateElasticGpuSpecification

The elastic GPU to attach to the instance. See Elastic GPU below for more details.

HibernationOptions []GetLaunchTemplateHibernationOption

The hibernation options for the instance.

IamInstanceProfiles []GetLaunchTemplateIamInstanceProfile

The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.

Id string

The provider-assigned unique ID for this managed resource.

ImageId string

The AMI from which to launch the instance.

InstanceInitiatedShutdownBehavior string

Shutdown behavior for the instance. Can be stop or terminate. (Default: stop).

InstanceMarketOptions []GetLaunchTemplateInstanceMarketOption

The market (purchasing) option for the instance. below for details.

InstanceType string

The type of the instance.

KernelId string

The kernel ID.

KeyName string

The key name to use for the instance.

LatestVersion int

The latest version of the launch template.

MetadataOptions []GetLaunchTemplateMetadataOption

The metadata options for the instance.

Monitorings []GetLaunchTemplateMonitoring

The monitoring option for the instance.

NetworkInterfaces []GetLaunchTemplateNetworkInterface

Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.

Placements []GetLaunchTemplatePlacement

The placement of the instance.

RamDiskId string

The ID of the RAM disk.

SecurityGroupNames []string

A list of security group names to associate with. If you are creating Instances in a VPC, use vpc_security_group_ids instead.

TagSpecifications []GetLaunchTemplateTagSpecification

The tags to apply to the resources during launch.

Tags map[string]string

(Optional) A map of tags to assign to the launch template.

UserData string

The Base64-encoded user data to provide when launching the instance.

VpcSecurityGroupIds []string

A list of security group IDs to associate with.

Filters []GetLaunchTemplateFilter
Name string
arn string

Amazon Resource Name (ARN) of the launch template.

blockDeviceMappings GetLaunchTemplateBlockDeviceMapping[]

Specify volumes to attach to the instance besides the volumes specified by the AMI.

creditSpecifications GetLaunchTemplateCreditSpecification[]

Customize the credit specification of the instance. See Credit Specification below for more details.

defaultVersion number

The default version of the launch template.

description string

Description of the launch template.

disableApiTermination boolean

If true, enables EC2 Instance Termination Protection

ebsOptimized string

If true, the launched EC2 instance will be EBS-optimized.

elasticGpuSpecifications GetLaunchTemplateElasticGpuSpecification[]

The elastic GPU to attach to the instance. See Elastic GPU below for more details.

hibernationOptions GetLaunchTemplateHibernationOption[]

The hibernation options for the instance.

iamInstanceProfiles GetLaunchTemplateIamInstanceProfile[]

The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.

id string

The provider-assigned unique ID for this managed resource.

imageId string

The AMI from which to launch the instance.

instanceInitiatedShutdownBehavior string

Shutdown behavior for the instance. Can be stop or terminate. (Default: stop).

instanceMarketOptions GetLaunchTemplateInstanceMarketOption[]

The market (purchasing) option for the instance. below for details.

instanceType string

The type of the instance.

kernelId string

The kernel ID.

keyName string

The key name to use for the instance.

latestVersion number

The latest version of the launch template.

metadataOptions GetLaunchTemplateMetadataOption[]

The metadata options for the instance.

monitorings GetLaunchTemplateMonitoring[]

The monitoring option for the instance.

networkInterfaces GetLaunchTemplateNetworkInterface[]

Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.

placements GetLaunchTemplatePlacement[]

The placement of the instance.

ramDiskId string

The ID of the RAM disk.

securityGroupNames string[]

A list of security group names to associate with. If you are creating Instances in a VPC, use vpc_security_group_ids instead.

tagSpecifications GetLaunchTemplateTagSpecification[]

The tags to apply to the resources during launch.

tags {[key: string]: string}

(Optional) A map of tags to assign to the launch template.

userData string

The Base64-encoded user data to provide when launching the instance.

vpcSecurityGroupIds string[]

A list of security group IDs to associate with.

filters GetLaunchTemplateFilter[]
name string
arn str

Amazon Resource Name (ARN) of the launch template.

block_device_mappings List[GetLaunchTemplateBlockDeviceMapping]

Specify volumes to attach to the instance besides the volumes specified by the AMI.

credit_specifications List[GetLaunchTemplateCreditSpecification]

Customize the credit specification of the instance. See Credit Specification below for more details.

default_version float

The default version of the launch template.

description str

Description of the launch template.

disable_api_termination bool

If true, enables EC2 Instance Termination Protection

ebs_optimized str

If true, the launched EC2 instance will be EBS-optimized.

elastic_gpu_specifications List[GetLaunchTemplateElasticGpuSpecification]

The elastic GPU to attach to the instance. See Elastic GPU below for more details.

hibernation_options List[GetLaunchTemplateHibernationOption]

The hibernation options for the instance.

iam_instance_profiles List[GetLaunchTemplateIamInstanceProfile]

The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.

id str

The provider-assigned unique ID for this managed resource.

image_id str

The AMI from which to launch the instance.

instance_initiated_shutdown_behavior str

Shutdown behavior for the instance. Can be stop or terminate. (Default: stop).

instance_market_options List[GetLaunchTemplateInstanceMarketOption]

The market (purchasing) option for the instance. below for details.

instance_type str

The type of the instance.

kernel_id str

The kernel ID.

key_name str

The key name to use for the instance.

latest_version float

The latest version of the launch template.

metadata_options List[GetLaunchTemplateMetadataOption]

The metadata options for the instance.

monitorings List[GetLaunchTemplateMonitoring]

The monitoring option for the instance.

network_interfaces List[GetLaunchTemplateNetworkInterface]

Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.

placements List[GetLaunchTemplatePlacement]

The placement of the instance.

ram_disk_id str

The ID of the RAM disk.

security_group_names List[str]

A list of security group names to associate with. If you are creating Instances in a VPC, use vpc_security_group_ids instead.

tag_specifications List[GetLaunchTemplateTagSpecification]

The tags to apply to the resources during launch.

tags Dict[str, str]

(Optional) A map of tags to assign to the launch template.

user_data str

The Base64-encoded user data to provide when launching the instance.

vpc_security_group_ids List[str]

A list of security group IDs to associate with.

filters List[GetLaunchTemplateFilter]
name str

Supporting Types

GetLaunchTemplateBlockDeviceMapping

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DeviceName string
Ebs List<GetLaunchTemplateBlockDeviceMappingEbArgs>
NoDevice string
VirtualName string
DeviceName string
Ebs []GetLaunchTemplateBlockDeviceMappingEb
NoDevice string
VirtualName string
deviceName string
ebs GetLaunchTemplateBlockDeviceMappingEb[]
noDevice string
virtualName string
device_name str
ebs List[GetLaunchTemplateBlockDeviceMappingEb]
noDevice str
virtualName str

GetLaunchTemplateBlockDeviceMappingEb

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DeleteOnTermination string
Encrypted string
Iops int
KmsKeyId string
SnapshotId string
VolumeSize int
VolumeType string
DeleteOnTermination string
Encrypted string
Iops int
KmsKeyId string
SnapshotId string
VolumeSize int
VolumeType string
deleteOnTermination string
encrypted string
iops number
kmsKeyId string
snapshotId string
volumeSize number
volumeType string
deleteOnTermination str
encrypted str
iops float
kms_key_id str
snapshot_id str
volumeType str
volume_size float

GetLaunchTemplateCreditSpecification

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CpuCredits string
CpuCredits string
cpuCredits string
cpuCredits str

GetLaunchTemplateElasticGpuSpecification

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Type string
Type string
type string
type str

GetLaunchTemplateFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

Values List<string>

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

Values []string

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

values string[]

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name str

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

values List[str]

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

GetLaunchTemplateHibernationOption

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Configured bool
Configured bool
configured boolean
configured bool

GetLaunchTemplateIamInstanceProfile

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Arn string

Amazon Resource Name (ARN) of the launch template.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

Arn string

Amazon Resource Name (ARN) of the launch template.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

arn string

Amazon Resource Name (ARN) of the launch template.

name string

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

arn str

Amazon Resource Name (ARN) of the launch template.

name str

The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.

GetLaunchTemplateInstanceMarketOption

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

MarketType string
SpotOptions List<GetLaunchTemplateInstanceMarketOptionSpotOptionArgs>
MarketType string
SpotOptions []GetLaunchTemplateInstanceMarketOptionSpotOption
marketType string
spotOptions GetLaunchTemplateInstanceMarketOptionSpotOption[]
marketType str
spot_options List[GetLaunchTemplateInstanceMarketOptionSpotOption]

GetLaunchTemplateInstanceMarketOptionSpotOption

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

BlockDurationMinutes int
InstanceInterruptionBehavior string
MaxPrice string
SpotInstanceType string
ValidUntil string
BlockDurationMinutes int
InstanceInterruptionBehavior string
MaxPrice string
SpotInstanceType string
ValidUntil string
blockDurationMinutes number
instanceInterruptionBehavior string
maxPrice string
spotInstanceType string
validUntil string
block_duration_minutes float
instanceInterruptionBehavior str
maxPrice str
spotInstanceType str
valid_until str

GetLaunchTemplateMetadataOption

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

HttpEndpoint string

The state of the metadata service: enabled, disabled.

HttpPutResponseHopLimit int

The desired HTTP PUT response hop limit for instance metadata requests.

HttpTokens string

If session tokens are required: optional, required.

HttpEndpoint string

The state of the metadata service: enabled, disabled.

HttpPutResponseHopLimit int

The desired HTTP PUT response hop limit for instance metadata requests.

HttpTokens string

If session tokens are required: optional, required.

httpEndpoint string

The state of the metadata service: enabled, disabled.

httpPutResponseHopLimit number

The desired HTTP PUT response hop limit for instance metadata requests.

httpTokens string

If session tokens are required: optional, required.

httpEndpoint str

The state of the metadata service: enabled, disabled.

httpPutResponseHopLimit float

The desired HTTP PUT response hop limit for instance metadata requests.

httpTokens str

If session tokens are required: optional, required.

GetLaunchTemplateMonitoring

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Enabled bool
Enabled bool
enabled boolean
enabled bool

GetLaunchTemplateNetworkInterface

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DeleteOnTermination bool
Description string

Description of the launch template.

DeviceIndex int
Ipv4AddressCount int
Ipv4Addresses List<string>
Ipv6AddressCount int
Ipv6Addresses List<string>
NetworkInterfaceId string
PrivateIpAddress string
SecurityGroups List<string>
SubnetId string
AssociatePublicIpAddress bool
DeleteOnTermination bool
Description string

Description of the launch template.

DeviceIndex int
Ipv4AddressCount int
Ipv4Addresses []string
Ipv6AddressCount int
Ipv6Addresses []string
NetworkInterfaceId string
PrivateIpAddress string
SecurityGroups []string
SubnetId string
AssociatePublicIpAddress bool
deleteOnTermination boolean
description string

Description of the launch template.

deviceIndex number
ipv4AddressCount number
ipv4Addresses string[]
ipv6AddressCount number
ipv6Addresses string[]
networkInterfaceId string
privateIpAddress string
securityGroups string[]
subnetId string
associatePublicIpAddress boolean
deleteOnTermination bool
description str

Description of the launch template.

device_index float
ipv4AddressCount float
ipv4Addresses List[str]
ipv6_address_count float
ipv6_addresses List[str]
network_interface_id str
private_ip_address str
security_groups List[str]
subnet_id str
associate_public_ip_address bool

GetLaunchTemplatePlacement

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Affinity string
AvailabilityZone string
GroupName string
HostId string
PartitionNumber int
SpreadDomain string
Tenancy string
Affinity string
AvailabilityZone string
GroupName string
HostId string
PartitionNumber int
SpreadDomain string
Tenancy string
affinity string
availabilityZone string
groupName string
hostId string
partitionNumber number
spreadDomain string
tenancy string
affinity str
availability_zone str
group_name str
host_id str
partitionNumber float
spreadDomain str
tenancy str

GetLaunchTemplateTagSpecification

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

ResourceType string
Tags Dictionary<string, string>

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

ResourceType string
Tags map[string]string

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

resourceType string
tags {[key: string]: string}

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

resource_type str
tags Dict[str, str]

A map of tags, each pair of which must exactly match a pair on the desired Launch Template.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.