generated_templates
Creates, updates, deletes, gets or lists a generated_templates resource.
Overview
| Name | generated_templates |
| Type | Resource |
| Id | aws.cloudformation.generated_templates |
Fields
The following fields are returned by SELECT queries:
- describe_generated_template
- list_generated_templates
| Name | Datatype | Description |
|---|---|---|
logical_resource_id | string | The logical id for this resource in the final generated template. |
resource_identifier | string | A list of up to 256 key-value pairs that identifies the resource in the generated template. The key is the name of one of the primary identifiers for the resource. (Primary identifiers are specified in the primaryIdentifier list in the resource schema.) The value is the value of that primary identifier. For example, for a AWS::DynamoDB::Table resource, the primary identifiers is TableName so the key-value pair could be "TableName": "MyDDBTable". For more information, see primaryIdentifier in the CloudFormation Command Line Interface (CLI) User Guide. |
resource_status | string | Status of the processing of a resource in a generated template. InProgress The resource processing is still in progress. Complete The resource processing is complete. Pending The resource processing is pending. Failed The resource processing has failed. |
resource_status_reason | string | The reason for the resource detail, providing more information if a failure happened. |
resource_type | string | The type of the resource, such as AWS::DynamoDB::Table. For the list of supported resources, see Resource type support for imports and drift detection In the CloudFormation User Guide |
warnings | string | The warnings generated for this resource. |
| Name | Datatype | Description |
|---|---|---|
creation_time | string | The time the generated template was created. |
generated_template_id | string | The Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc . |
generated_template_name | string | The name of the generated template. |
last_updated_time | string | The time the generated template was last updated. |
number_of_resources | integer | The number of resources in the generated template. This is a total of resources in pending, in-progress, completed, and failed states. |
status | string | The status of the template generation. Supported values are: CreatePending - the creation of the template is pending. CreateInProgress - the creation of the template is in progress. DeletePending - the deletion of the template is pending. DeleteInProgress - the deletion of the template is in progress. UpdatePending - the update of the template is pending. UpdateInProgress - the update of the template is in progress. Failed - the template operation failed. Complete - the template operation is complete. |
status_reason | string | The reason for the current template generation status. This will provide more details if a failure happened. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_generated_template | select | GeneratedTemplateName, region | Describes a generated template. The output includes details about the progress of the creation of a generated template started by a CreateGeneratedTemplate API action or the update of a generated template started with an UpdateGeneratedTemplate API action. | |
list_generated_templates | select | region | NextToken, MaxResults | Lists your generated templates in this Region. |
create_generated_template | insert | GeneratedTemplateName, region | Resources, StackName, TemplateConfiguration | Creates a template from existing resources that are not already managed with CloudFormation. You can check the status of the template generation using the DescribeGeneratedTemplate API action. |
update_generated_template | update | GeneratedTemplateName, region | NewGeneratedTemplateName, AddResources, RemoveResources, RefreshAllResources, TemplateConfiguration | Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of the update to the generated template using the DescribeGeneratedTemplate API action. |
delete_generated_template | delete | GeneratedTemplateName, region | Deleted a generated template. | |
get_generated_template | exec | GeneratedTemplateName, region | Format | Retrieves a generated template. If the template is in an InProgress or Pending status then the template returned will be the template when the template was last in a Complete status. If the template has not yet been in a Complete status then an empty template will be 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 |
|---|---|---|
GeneratedTemplateName | string | The name or Amazon Resource Name (ARN) of the generated template. The format is arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. For example, arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc . |
region | string | AWS region (default: us-east-1) |
AddResources | array | An optional list of resources to be added to the generated template. |
Format | string | The language to use to retrieve for the generated template. Supported values are: JSON YAML |
MaxResults | integer | If the number of available results exceeds this maximum, the response includes a NextToken value that you can use for the NextToken parameter to get the next set of results. By default the ListGeneratedTemplates API action will return at most 50 results in each response. The maximum value is 100. |
NewGeneratedTemplateName | string | An optional new name to assign to the generated template. |
NextToken | string | The token for the next set of items to return. (You received this token from a previous call.) |
RefreshAllResources | boolean | If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template. |
RemoveResources | array | A list of logical ids for resources to remove from the generated template. |
Resources | array | An optional list of resources to be included in the generated template. If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action. |
StackName | string | An optional name or ARN of a stack to use as the base stack for the generated template. |
TemplateConfiguration | object | The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy. |
SELECT examples
- describe_generated_template
- list_generated_templates
Describes a generated template. The output includes details about the progress of the creation of a generated template started by a CreateGeneratedTemplate API action or the update of a generated template started with an UpdateGeneratedTemplate API action.
SELECT
logical_resource_id,
resource_identifier,
resource_status,
resource_status_reason,
resource_type,
warnings
FROM aws.cloudformation.generated_templates
WHERE GeneratedTemplateName = '{{ GeneratedTemplateName }}' -- required
AND region = '{{ region }}' -- required
;
Lists your generated templates in this Region.
SELECT
creation_time,
generated_template_id,
generated_template_name,
last_updated_time,
number_of_resources,
status,
status_reason
FROM aws.cloudformation.generated_templates
WHERE region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;
INSERT examples
- create_generated_template
- Manifest
Creates a template from existing resources that are not already managed with CloudFormation. You can check the status of the template generation using the DescribeGeneratedTemplate API action.
INSERT INTO aws.cloudformation.generated_templates (
GeneratedTemplateName,
region,
Resources,
StackName,
TemplateConfiguration
)
SELECT
'{{ GeneratedTemplateName }}',
'{{ region }}',
'{{ Resources }}',
'{{ StackName }}',
'{{ TemplateConfiguration }}'
RETURNING
line_items
;
# Description fields are for documentation purposes
- name: generated_templates
props:
- name: GeneratedTemplateName
value: "{{ GeneratedTemplateName }}"
description: Required parameter for the generated_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the generated_templates resource.
- name: Resources
value: "{{ Resources }}"
description: An optional list of resources to be included in the generated template. If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.
description: An optional list of resources to be included in the generated template. If no resources are specified,the template will be created without any resources. Resources can be added to the template using the UpdateGeneratedTemplate API action.
- name: StackName
value: "{{ StackName }}"
description: An optional name or ARN of a stack to use as the base stack for the generated template.
description: An optional name or ARN of a stack to use as the base stack for the generated template.
- name: TemplateConfiguration
value: "{{ TemplateConfiguration }}"
description: The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.
description: The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.
UPDATE examples
- update_generated_template
Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of the update to the generated template using the DescribeGeneratedTemplate API action.
UPDATE aws.cloudformation.generated_templates
SET
-- No updatable properties
WHERE
GeneratedTemplateName = '{{ GeneratedTemplateName }}' --required
AND region = '{{ region }}' --required
AND NewGeneratedTemplateName = '{{ NewGeneratedTemplateName}}'
AND AddResources = '{{ AddResources}}'
AND RemoveResources = '{{ RemoveResources}}'
AND RefreshAllResources = {{ RefreshAllResources}}
AND TemplateConfiguration = '{{ TemplateConfiguration}}'
RETURNING
line_items;
DELETE examples
- delete_generated_template
Deleted a generated template.
DELETE FROM aws.cloudformation.generated_templates
WHERE GeneratedTemplateName = '{{ GeneratedTemplateName }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- get_generated_template
Retrieves a generated template. If the template is in an InProgress or Pending status then the template returned will be the template when the template was last in a Complete status. If the template has not yet been in a Complete status then an empty template will be returned.
EXEC aws.cloudformation.generated_templates.get_generated_template
@GeneratedTemplateName='{{ GeneratedTemplateName }}' --required,
@region='{{ region }}' --required,
@Format='{{ Format }}'
;