AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

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/v5/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{
			Name: pulumi.StringRef("my-launch-template"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var default = Output.of(Ec2Functions.getLaunchTemplate(GetLaunchTemplateArgs.builder()
            .name("my-launch-template")
            .build()));

        }
}
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",
}));
variables:
  default:
    Fn::Invoke:
      Function: aws:ec2:getLaunchTemplate
      Arguments:
        name: my-launch-template

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/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var test = Output.of(Ec2Functions.getLaunchTemplate(GetLaunchTemplateArgs.builder()
            .filters(GetLaunchTemplateFilter.builder()
                .name("launch-template-name")
                .values("some-template")
                .build())
            .build()));

        }
}
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"],
    }],
}));
variables:
  test:
    Fn::Invoke:
      Function: aws:ec2:getLaunchTemplate
      Arguments:
        filters:
          - name: launch-template-name
            values:
              - some-template

Using getLaunchTemplate

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getLaunchTemplate(args: GetLaunchTemplateArgs, opts?: InvokeOptions): Promise<GetLaunchTemplateResult>
function getLaunchTemplateOutput(args: GetLaunchTemplateOutputArgs, opts?: InvokeOptions): Output<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
def get_launch_template_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLaunchTemplateFilterArgs]]]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetLaunchTemplateResult]
func LookupLaunchTemplate(ctx *Context, args *LookupLaunchTemplateArgs, opts ...InvokeOption) (*LookupLaunchTemplateResult, error)
func LookupLaunchTemplateOutput(ctx *Context, args *LookupLaunchTemplateOutputArgs, opts ...InvokeOption) LookupLaunchTemplateResultOutput

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

public static class GetLaunchTemplate 
{
    public static Task<GetLaunchTemplateResult> InvokeAsync(GetLaunchTemplateArgs args, InvokeOptions? opts = null)
    public static Output<GetLaunchTemplateResult> Invoke(GetLaunchTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLaunchTemplateResult> getLaunchTemplate(GetLaunchTemplateArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ec2/getLaunchTemplate:getLaunchTemplate
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Filters List<Pulumi.Aws.Ec2.Inputs.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 ListLaunchTemplateFilter>

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

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.

filters List

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

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
BlockDeviceMappings List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateBlockDeviceMapping>
CapacityReservationSpecifications List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateCapacityReservationSpecification>
CpuOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateCpuOption>
CreditSpecifications List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateCreditSpecification>
DefaultVersion int
Description string
DisableApiTermination bool
EbsOptimized string
ElasticGpuSpecifications List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateElasticGpuSpecification>
ElasticInferenceAccelerators List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateElasticInferenceAccelerator>
EnclaveOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateEnclaveOption>
HibernationOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateHibernationOption>
IamInstanceProfiles List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateIamInstanceProfile>
Id string

The ID of the launch template.

ImageId string
InstanceInitiatedShutdownBehavior string
InstanceMarketOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateInstanceMarketOption>
InstanceType string
KernelId string
KeyName string
LatestVersion int
LicenseSpecifications List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateLicenseSpecification>
MetadataOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateMetadataOption>
Monitorings List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateMonitoring>
Name string
NetworkInterfaces List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateNetworkInterface>
Placements List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplatePlacement>
PrivateDnsNameOptions List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplatePrivateDnsNameOption>
RamDiskId string
SecurityGroupNames List<string>
TagSpecifications List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateTagSpecification>
Tags Dictionary<string, string>
UserData string
VpcSecurityGroupIds List<string>
Filters List<Pulumi.Aws.Ec2.Outputs.GetLaunchTemplateFilter>
Arn string
BlockDeviceMappings []GetLaunchTemplateBlockDeviceMapping
CapacityReservationSpecifications []GetLaunchTemplateCapacityReservationSpecification
CpuOptions []GetLaunchTemplateCpuOption
CreditSpecifications []GetLaunchTemplateCreditSpecification
DefaultVersion int
Description string
DisableApiTermination bool
EbsOptimized string
ElasticGpuSpecifications []GetLaunchTemplateElasticGpuSpecification
ElasticInferenceAccelerators []GetLaunchTemplateElasticInferenceAccelerator
EnclaveOptions []GetLaunchTemplateEnclaveOption
HibernationOptions []GetLaunchTemplateHibernationOption
IamInstanceProfiles []GetLaunchTemplateIamInstanceProfile
Id string

The ID of the launch template.

ImageId string
InstanceInitiatedShutdownBehavior string
InstanceMarketOptions []GetLaunchTemplateInstanceMarketOption
InstanceType string
KernelId string
KeyName string
LatestVersion int
LicenseSpecifications []GetLaunchTemplateLicenseSpecification
MetadataOptions []GetLaunchTemplateMetadataOption
Monitorings []GetLaunchTemplateMonitoring
Name string
NetworkInterfaces []GetLaunchTemplateNetworkInterface
Placements []GetLaunchTemplatePlacement
PrivateDnsNameOptions []GetLaunchTemplatePrivateDnsNameOption
RamDiskId string
SecurityGroupNames []string
TagSpecifications []GetLaunchTemplateTagSpecification
Tags map[string]string
UserData string
VpcSecurityGroupIds []string
Filters []GetLaunchTemplateFilter
arn String
blockDeviceMappings ListLaunchTemplateBlockDeviceMapping>
capacityReservationSpecifications ListLaunchTemplateCapacityReservationSpecification>
cpuOptions ListLaunchTemplateCpuOption>
creditSpecifications ListLaunchTemplateCreditSpecification>
defaultVersion Integer
description String
disableApiTermination Boolean
ebsOptimized String
elasticGpuSpecifications ListLaunchTemplateElasticGpuSpecification>
elasticInferenceAccelerators ListLaunchTemplateElasticInferenceAccelerator>
enclaveOptions ListLaunchTemplateEnclaveOption>
hibernationOptions ListLaunchTemplateHibernationOption>
iamInstanceProfiles ListLaunchTemplateIamInstanceProfile>
id String

The ID of the launch template.

imageId String
instanceInitiatedShutdownBehavior String
instanceMarketOptions ListLaunchTemplateInstanceMarketOption>
instanceType String
kernelId String
keyName String
latestVersion Integer
licenseSpecifications ListLaunchTemplateLicenseSpecification>
metadataOptions ListLaunchTemplateMetadataOption>
monitorings ListLaunchTemplateMonitoring>
name String
networkInterfaces ListLaunchTemplateNetworkInterface>
placements ListLaunchTemplatePlacement>
privateDnsNameOptions ListLaunchTemplatePrivateDnsNameOption>
ramDiskId String
securityGroupNames List
tagSpecifications ListLaunchTemplateTagSpecification>
tags Map
userData String
vpcSecurityGroupIds List
filters ListLaunchTemplateFilter>
arn string
blockDeviceMappings GetLaunchTemplateBlockDeviceMapping[]
capacityReservationSpecifications GetLaunchTemplateCapacityReservationSpecification[]
cpuOptions GetLaunchTemplateCpuOption[]
creditSpecifications GetLaunchTemplateCreditSpecification[]
defaultVersion number
description string
disableApiTermination boolean
ebsOptimized string
elasticGpuSpecifications GetLaunchTemplateElasticGpuSpecification[]
elasticInferenceAccelerators GetLaunchTemplateElasticInferenceAccelerator[]
enclaveOptions GetLaunchTemplateEnclaveOption[]
hibernationOptions GetLaunchTemplateHibernationOption[]
iamInstanceProfiles GetLaunchTemplateIamInstanceProfile[]
id string

The ID of the launch template.

imageId string
instanceInitiatedShutdownBehavior string
instanceMarketOptions GetLaunchTemplateInstanceMarketOption[]
instanceType string
kernelId string
keyName string
latestVersion number
licenseSpecifications GetLaunchTemplateLicenseSpecification[]
metadataOptions GetLaunchTemplateMetadataOption[]
monitorings GetLaunchTemplateMonitoring[]
name string
networkInterfaces GetLaunchTemplateNetworkInterface[]
placements GetLaunchTemplatePlacement[]
privateDnsNameOptions GetLaunchTemplatePrivateDnsNameOption[]
ramDiskId string
securityGroupNames string[]
tagSpecifications GetLaunchTemplateTagSpecification[]
tags {[key: string]: string}
userData string
vpcSecurityGroupIds string[]
filters GetLaunchTemplateFilter[]
arn str
block_device_mappings Sequence[GetLaunchTemplateBlockDeviceMapping]
capacity_reservation_specifications Sequence[GetLaunchTemplateCapacityReservationSpecification]
cpu_options Sequence[GetLaunchTemplateCpuOption]
credit_specifications Sequence[GetLaunchTemplateCreditSpecification]
default_version int
description str
disable_api_termination bool
ebs_optimized str
elastic_gpu_specifications Sequence[GetLaunchTemplateElasticGpuSpecification]
elastic_inference_accelerators Sequence[GetLaunchTemplateElasticInferenceAccelerator]
enclave_options Sequence[GetLaunchTemplateEnclaveOption]
hibernation_options Sequence[GetLaunchTemplateHibernationOption]
iam_instance_profiles Sequence[GetLaunchTemplateIamInstanceProfile]
id str

The ID of the launch template.

image_id str
instance_initiated_shutdown_behavior str
instance_market_options Sequence[GetLaunchTemplateInstanceMarketOption]
instance_type str
kernel_id str
key_name str
latest_version int
license_specifications Sequence[GetLaunchTemplateLicenseSpecification]
metadata_options Sequence[GetLaunchTemplateMetadataOption]
monitorings Sequence[GetLaunchTemplateMonitoring]
name str
network_interfaces Sequence[GetLaunchTemplateNetworkInterface]
placements Sequence[GetLaunchTemplatePlacement]
private_dns_name_options Sequence[GetLaunchTemplatePrivateDnsNameOption]
ram_disk_id str
security_group_names Sequence[str]
tag_specifications Sequence[GetLaunchTemplateTagSpecification]
tags Mapping[str, str]
user_data str
vpc_security_group_ids Sequence[str]
filters Sequence[GetLaunchTemplateFilter]

Supporting Types

GetLaunchTemplateBlockDeviceMapping

GetLaunchTemplateBlockDeviceMappingEb

deleteOnTermination String
encrypted String
iops Integer
kmsKeyId String
snapshotId String
throughput Integer
volumeSize Integer
volumeType String
deleteOnTermination string
encrypted string
iops number
kmsKeyId string
snapshotId string
throughput number
volumeSize number
volumeType string
deleteOnTermination String
encrypted String
iops Number
kmsKeyId String
snapshotId String
throughput Number
volumeSize Number
volumeType String

GetLaunchTemplateCapacityReservationSpecification

GetLaunchTemplateCapacityReservationSpecificationCapacityReservationTarget

GetLaunchTemplateCpuOption

coreCount Integer
threadsPerCore Integer

GetLaunchTemplateCreditSpecification

CpuCredits string
CpuCredits string
cpuCredits String
cpuCredits string
cpuCredits String

GetLaunchTemplateElasticGpuSpecification

Type string
Type string
type String
type string
type str
type String

GetLaunchTemplateElasticInferenceAccelerator

Type string
Type string
type String
type string
type str
type String

GetLaunchTemplateEnclaveOption

Enabled bool
Enabled bool
enabled Boolean
enabled boolean
enabled bool
enabled Boolean

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 List

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.

name String

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

values List

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

GetLaunchTemplateHibernationOption

configured Boolean
configured boolean
configured Boolean

GetLaunchTemplateIamInstanceProfile

Arn string
Name string

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

Arn string
Name string

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

arn String
name String

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

arn string
name string

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

arn str
name str

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

arn String
name String

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

GetLaunchTemplateInstanceMarketOption

GetLaunchTemplateInstanceMarketOptionSpotOption

GetLaunchTemplateLicenseSpecification

GetLaunchTemplateMetadataOption

GetLaunchTemplateMonitoring

Enabled bool
Enabled bool
enabled Boolean
enabled boolean
enabled bool
enabled Boolean

GetLaunchTemplateNetworkInterface

GetLaunchTemplatePlacement

GetLaunchTemplatePrivateDnsNameOption

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 Map

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.

resourceType String
tags Map

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.