Table: aws_ec2_launch_template - Query AWS EC2 Launch Templates using SQL
The AWS EC2 Launch Template is a resource within the Amazon Elastic Compute Cloud (EC2) service. It allows you to save launch parameters within Amazon EC2 so you can quickly launch instances with those settings. This ensures consistency across instances and reduces the manual effort required to configure individual instances.
Table Usage Guide
The aws_ec2_launch_template
table in Steampipe provides you with information about EC2 Launch Templates within AWS Elastic Compute Cloud (EC2). This table allows you, as a DevOps engineer, to query template-specific details, including instance type, key pair, security groups, and user data. You can utilize this table to gather insights on templates, such as associated AMIs, security configurations, instance configurations, and more. The schema outlines the various attributes of the EC2 Launch Template for you, including the template ID, creation date, default version, and associated tags.
Examples
Basic info
Explore which AWS EC2 launch templates have been created, by whom, and when. This can help in understanding the evolution of your infrastructure, including the original and most recent versions of each template.
select launch_template_name, launch_template_id, created_time, created_by, default_version_number, latest_version_numberfrom aws_ec2_launch_template;
select launch_template_name, launch_template_id, created_time, created_by, default_version_number, latest_version_numberfrom aws_ec2_launch_template;
List launch templates created by a user
Discover the segments that include launch templates created by a specific user in AWS EC2. This is beneficial for understanding and managing user-specific resources within the cloud infrastructure.
select launch_template_name, launch_template_id, create_time, created_byfrom aws_ec2_launch_templatewhere created_by like '%turbot';
select launch_template_name, launch_template_id, create_time, created_byfrom aws_ec2_launch_templatewhere created_by like '%turbot';
List launch templates created in the last 30 days
Identify recently created launch templates within the past month. This is useful for monitoring new additions and ensuring proper configuration and usage.
select launch_template_name, launch_template_id, create_timefrom aws_ec2_launch_templatewhere create_time >= now() - interval '30' day;
select launch_template_name, launch_template_id, create_timefrom aws_ec2_launch_templatewhere create_time >= datetime('now', '-30 days');
Schema for aws_ec2_launch_template
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
create_time | timestamp with time zone | The time launch template was created. | |
created_by | text | The principal that created the launch template. | |
default_version_number | bigint | The version number of the default version of the launch template. | |
latest_version_number | bigint | The name of the Application-Layer Protocol Negotiation (ALPN) policy. | |
launch_template_id | text | = | The ID of the launch template. |
launch_template_name | text | = | The name of the launch template. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | The tags for the launch template. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_ec2_launch_template