prepared_statements
Creates, updates, deletes or gets a prepared_statement
resource or lists prepared_statements
in a region
Overview
Name | prepared_statements |
Type | Resource |
Description | Resource schema for AWS::Athena::PreparedStatement |
Id | aws.athena.prepared_statements |
Fields
Name | Datatype | Description |
---|---|---|
statement_name | string | The name of the prepared statement. |
work_group | string | The name of the workgroup to which the prepared statement belongs. |
description | string | The description of the prepared statement. |
query_statement | string | The query string for the prepared statement. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | StatementName, WorkGroup, QueryStatement, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.athena.prepared_statements (
StatementName,
WorkGroup,
QueryStatement,
region
)
SELECT
'{{ StatementName }}',
'{{ WorkGroup }}',
'{{ QueryStatement }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.athena.prepared_statements (
StatementName,
WorkGroup,
Description,
QueryStatement,
region
)
SELECT
'{{ StatementName }}',
'{{ WorkGroup }}',
'{{ Description }}',
'{{ QueryStatement }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: prepared_statement
props:
- name: StatementName
value: '{{ StatementName }}'
- name: WorkGroup
value: '{{ WorkGroup }}'
- name: Description
value: '{{ Description }}'
- name: QueryStatement
value: '{{ QueryStatement }}'
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