Skip to main content

prepared_statements

Creates, updates, deletes or gets a prepared_statement resource or lists prepared_statements in a region

Overview

Nameprepared_statements
TypeResource
DescriptionResource schema for AWS::Athena::PreparedStatement
Idaws.athena.prepared_statements

Fields

NameDatatypeDescription
statement_namestringThe name of the prepared statement.
work_groupstringThe name of the workgroup to which the prepared statement belongs.
descriptionstringThe description of the prepared statement.
query_statementstringThe query string for the prepared statement.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTStatementName, WorkGroup, QueryStatement, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all prepared_statements in a region.

SELECT
region,
statement_name,
work_group,
description,
query_statement
FROM aws.athena.prepared_statements
WHERE region = 'us-east-1';

Gets all properties from an individual prepared_statement.

SELECT
region,
statement_name,
work_group,
description,
query_statement
FROM aws.athena.prepared_statements
WHERE region = 'us-east-1' AND data__Identifier = '<StatementName>|<WorkGroup>';

INSERT example

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

/*+ create */
INSERT INTO aws.athena.prepared_statements (
StatementName,
WorkGroup,
QueryStatement,
region
)
SELECT
'{{ StatementName }}',
'{{ WorkGroup }}',
'{{ QueryStatement }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.athena.prepared_statements
WHERE data__Identifier = '<StatementName|WorkGroup>'
AND region = 'us-east-1';

Permissions

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

Create

athena:CreatePreparedStatement,
athena:GetPreparedStatement

Read

athena:GetPreparedStatement

Update

athena:UpdatePreparedStatement

Delete

athena:DeletePreparedStatement,
athena:GetPreparedStatement

List

athena:ListPreparedStatements