Skip to main content

templates

Creates, updates, deletes, gets or lists a templates resource.

Overview

Nametemplates
TypeResource
Idaws.quicksight.templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
request_idstringThe Amazon Web Services request ID for this operation.
statusintegerThe HTTP status of the request.
templateobjectThe template structure for the object you want to describe.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_templateselectaws_account_id, template_id, regionversion-number, alias-nameDescribes a template's metadata.
list_templatesselectaws_account_id, regionnext-token, max-resultLists all the templates in the current Amazon Quick Sight account.
create_templateinsertaws_account_id, template_id, regionCreates a template either from a TemplateDefinition or from an existing Quick Sight analysis or template. You can use the resulting template to create additional dashboards, templates, or analyses. A template is an entity in Quick Sight that encapsulates the metadata required to create an analysis and that you can use to create s dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with the analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.
update_templateupdateaws_account_id, template_id, regionUpdates a template from an existing Amazon Quick Sight analysis or another template.
delete_templatedeleteaws_account_id, template_id, regionversion-numberDeletes a template.

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.

NameDatatypeDescription
aws_account_idstringThe ID of the Amazon Web Services account that contains the template that you're deleting.
regionstringAWS region (default: us-east-1)
template_idstringAn ID for the template you want to delete.
alias-namestringThe alias of the template that you want to describe. If you name a specific alias, you describe the version that the alias points to. You can specify the latest version of the template by providing the keyword $LATEST in the AliasName parameter. The keyword $PUBLISHED doesn't apply to templates.
max-resultintegerThe maximum number of results to be returned per request.
next-tokenstringThe token for the next set of results, or null if there are no more results.
version-numberinteger (int64)Specifies the version of the template that you want to delete. If you don't provide a version number, DeleteTemplate deletes all versions of the template.

SELECT examples

Describes a template's metadata.

SELECT
request_id,
status,
template
FROM aws.quicksight.templates
WHERE aws_account_id = '{{ aws_account_id }}' -- required
AND template_id = '{{ template_id }}' -- required
AND region = '{{ region }}' -- required
AND `version-number` = '{{ version-number }}'
AND `alias-name` = '{{ alias-name }}'
;

INSERT examples

Creates a template either from a TemplateDefinition or from an existing Quick Sight analysis or template. You can use the resulting template to create additional dashboards, templates, or analyses. A template is an entity in Quick Sight that encapsulates the metadata required to create an analysis and that you can use to create s dashboard. A template adds a layer of abstraction by using placeholders to replace the dataset associated with the analysis. You can use templates to create dashboards by replacing dataset placeholders with datasets that follow the same schema that was used to create the source analysis and template.

INSERT INTO aws.quicksight.templates (
Name,
Permissions,
SourceEntity,
Tags,
VersionDescription,
Definition,
ValidationStrategy,
aws_account_id,
template_id,
region
)
SELECT
'{{ Name }}',
'{{ Permissions }}',
'{{ SourceEntity }}',
'{{ Tags }}',
'{{ VersionDescription }}',
'{{ Definition }}',
'{{ ValidationStrategy }}',
'{{ aws_account_id }}',
'{{ template_id }}',
'{{ region }}'
RETURNING
arn,
creation_status,
request_id,
status,
template_id,
version_arn
;

UPDATE examples

Updates a template from an existing Amazon Quick Sight analysis or another template.

UPDATE aws.quicksight.templates
SET
SourceEntity = '{{ SourceEntity }}',
VersionDescription = '{{ VersionDescription }}',
Name = '{{ Name }}',
Definition = '{{ Definition }}',
ValidationStrategy = '{{ ValidationStrategy }}'
WHERE
aws_account_id = '{{ aws_account_id }}' --required
AND template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required
RETURNING
arn,
creation_status,
request_id,
status,
template_id,
version_arn;

DELETE examples

Deletes a template.

DELETE FROM aws.quicksight.templates
WHERE aws_account_id = '{{ aws_account_id }}' --required
AND template_id = '{{ template_id }}' --required
AND region = '{{ region }}' --required
AND `version-number` = '{{ version-number }}'
;