templates
Creates, updates, deletes, gets or lists a templates resource.
Overview
| Name | templates |
| Type | Resource |
| Id | aws.cloudformation.templates |
Fields
The following fields are returned by SELECT queries:
- get_template
| Name | Datatype | Description |
|---|---|---|
line_items | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_template | select | region | StackName, ChangeSetName, TemplateStage | Returns the template body for a specified stack. You can get the template for running or deleted stacks. For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted. If the template doesn't exist, a ValidationError is returned. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
ChangeSetName | string | The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated template. If you specify a name, you must also specify the StackName. |
StackName | string | The name or the unique stack ID that's associated with the stack, which aren't always interchangeable: Running stacks: You can specify either the stack's name or its unique stack ID. Deleted stacks: You must specify the unique stack ID. |
TemplateStage | string | For templates that include transforms, the stage of the template that CloudFormation returns. To get the user-submitted template, specify Original. To get the template after CloudFormation has processed all transforms, specify Processed. If the template doesn't include transforms, Original and Processed return the same template. By default, CloudFormation specifies Processed. |
SELECT examples
- get_template
Returns the template body for a specified stack. You can get the template for running or deleted stacks. For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted. If the template doesn't exist, a ValidationError is returned.
SELECT
line_items
FROM aws.cloudformation.templates
WHERE region = '{{ region }}' -- required
AND StackName = '{{ StackName }}'
AND ChangeSetName = '{{ ChangeSetName }}'
AND TemplateStage = '{{ TemplateStage }}'
;