Skip to main content

launch_templates

Creates, updates, deletes or gets a launch_template resource or lists launch_templates in a region

Overview

Namelaunch_templates
TypeResource
Description
Specifies the properties for creating a launch template.The minimum required properties for specifying a launch template are as follows:
+ You must specify at least one property for the launch template data.
+ You can optionally specify a name for the launch template. If you do not specify a name, CFN creates a name for you.
A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.
For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide.
Idawscc.ec2.launch_templates

Fields

NameDatatypeDescription
launch_template_namestringA name for the launch template.
launch_template_dataobjectThe information for the launch template.
version_descriptionstringA description for the first version of the launch template.
tag_specificationsarray
The tags to apply to the launch template on creation. To tag the launch template, the resource type must be launch-template.To specify the tags for resources that are created during instance launch, use TagSpecifications.
latest_version_numberstring
launch_template_idstring
default_version_numberstring
regionstringAWS region.

For more information, see AWS::EC2::LaunchTemplate.

Methods

NameResourceAccessible byRequired Params
create_resourcelaunch_templatesINSERTLaunchTemplateData, region
delete_resourcelaunch_templatesDELETEIdentifier, region
update_resourcelaunch_templatesUPDATEIdentifier, PatchDocument, region
list_resourceslaunch_templates_list_onlySELECTregion
get_resourcelaunch_templatesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual launch_template.

SELECT
region,
launch_template_name,
launch_template_data,
version_description,
tag_specifications,
latest_version_number,
launch_template_id,
default_version_number
FROM awscc.ec2.launch_templates
WHERE
region = '{{ region }}' AND
Identifier = '{{ launch_template_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new launch_template resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.launch_templates (
LaunchTemplateData,
region
)
SELECT
'{{ launch_template_data }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a launch_template resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.launch_templates
SET PatchDocument = string('{{ {
"LaunchTemplateData": launch_template_data,
"VersionDescription": version_description,
"TagSpecifications": tag_specifications
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ launch_template_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.launch_templates
WHERE
Identifier = '{{ launch_template_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the launch_templates resource, the following permissions are required:

ec2:DescribeLaunchTemplates