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/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/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/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/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=[aws.ec2.GetLaunchTemplateFilterArgs(
    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>
def get_launch_template(filters: Optional[Sequence[GetLaunchTemplateFilter]] = None,
                        id: Optional[str] = None,
                        name: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetLaunchTemplateResult
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<GetLaunchTemplateFilter>
Configuration block(s) for filtering. Detailed below.
Id string
The ID of the specific launch template to retrieve.
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.
Id string
The ID of the specific launch template to retrieve.
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.
id string
The ID of the specific launch template to retrieve.
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 Sequence[GetLaunchTemplateFilter]
Configuration block(s) for filtering. Detailed below.
id str
The ID of the specific launch template to retrieve.
name str
The name of the filter field. Valid values can be found in the EC2 DescribeLaunchTemplates API Reference.
tags Mapping[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.
EnclaveOptions List<GetLaunchTemplateEnclaveOption>
The enclave options of the Instance.
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 ID of the launch template.
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.
EnclaveOptions []GetLaunchTemplateEnclaveOption
The enclave options of the Instance.
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 ID of the launch template.
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.
enclaveOptions GetLaunchTemplateEnclaveOption[]
The enclave options of the Instance.
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 ID of the launch template.
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 Sequence[GetLaunchTemplateBlockDeviceMapping]
Specify volumes to attach to the instance besides the volumes specified by the AMI.
credit_specifications Sequence[GetLaunchTemplateCreditSpecification]
Customize the credit specification of the instance. See Credit Specification below for more details.
default_version int
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 Sequence[GetLaunchTemplateElasticGpuSpecification]
The elastic GPU to attach to the instance. See Elastic GPU below for more details.
enclave_options Sequence[GetLaunchTemplateEnclaveOption]
The enclave options of the Instance.
hibernation_options Sequence[GetLaunchTemplateHibernationOption]
The hibernation options for the instance.
iam_instance_profiles Sequence[GetLaunchTemplateIamInstanceProfile]
The IAM Instance Profile to launch the instance with. See Instance Profile below for more details.
id str
The ID of the launch template.
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 Sequence[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 int
The latest version of the launch template.
metadata_options Sequence[GetLaunchTemplateMetadataOption]
The metadata options for the instance.
monitorings Sequence[GetLaunchTemplateMonitoring]
The monitoring option for the instance.
network_interfaces Sequence[GetLaunchTemplateNetworkInterface]
Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
placements Sequence[GetLaunchTemplatePlacement]
The placement of the instance.
ram_disk_id str
The ID of the RAM disk.
security_group_names Sequence[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 Sequence[GetLaunchTemplateTagSpecification]
The tags to apply to the resources during launch.
tags Mapping[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 Sequence[str]
A list of security group IDs to associate with.
filters Sequence[GetLaunchTemplateFilter]
name str

Supporting Types

GetLaunchTemplateBlockDeviceMapping

GetLaunchTemplateBlockDeviceMappingEb

deleteOnTermination string
encrypted string
iops number
kmsKeyId string
snapshotId string
throughput number
volumeSize number
volumeType string

GetLaunchTemplateCreditSpecification

CpuCredits string
CpuCredits string
cpuCredits string

GetLaunchTemplateElasticGpuSpecification

Type string
Type string
type string
type str

GetLaunchTemplateEnclaveOption

Enabled bool
Whether Nitro Enclaves are enabled.
Enabled bool
Whether Nitro Enclaves are enabled.
enabled boolean
Whether Nitro Enclaves are enabled.
enabled bool
Whether Nitro Enclaves are enabled.

GetLaunchTemplateFilter

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 Sequence[str]
Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

GetLaunchTemplateHibernationOption

configured boolean

GetLaunchTemplateIamInstanceProfile

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

GetLaunchTemplateInstanceMarketOptionSpotOption

GetLaunchTemplateMetadataOption

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.
http_endpoint str
The state of the metadata service: enabled, disabled.
http_put_response_hop_limit int
The desired HTTP PUT response hop limit for instance metadata requests.
http_tokens str
If session tokens are required: optional, required.

GetLaunchTemplateMonitoring

Enabled bool
Whether Nitro Enclaves are enabled.
Enabled bool
Whether Nitro Enclaves are enabled.
enabled boolean
Whether Nitro Enclaves are enabled.
enabled bool
Whether Nitro Enclaves are enabled.

GetLaunchTemplateNetworkInterface

GetLaunchTemplatePlacement

GetLaunchTemplateTagSpecification

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 Mapping[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.