named_queries
Creates, updates, deletes or gets a named_query
resource or lists named_queries
in a region
Overview
Name | named_queries |
Type | Resource |
Description | Resource schema for AWS::Athena::NamedQuery |
Id | aws.athena.named_queries |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The query name. |
database | string | The database to which the query belongs. |
description | string | The query description. |
query_string | string | The contents of the query with all query statements. |
work_group | string | The name of the workgroup that contains the named query. |
named_query_id | string | The unique ID of the query. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Database, QueryString, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all named_queries
in a region.
SELECT
region,
name,
database,
description,
query_string,
work_group,
named_query_id
FROM aws.athena.named_queries
WHERE region = 'us-east-1';
Gets all properties from an individual named_query
.
SELECT
region,
name,
database,
description,
query_string,
work_group,
named_query_id
FROM aws.athena.named_queries
WHERE region = 'us-east-1' AND data__Identifier = '<NamedQueryId>';
INSERT
example
Use the following StackQL query and manifest file to create a new named_query
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.athena.named_queries (
Database,
QueryString,
region
)
SELECT
'{{ Database }}',
'{{ QueryString }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.athena.named_queries (
Name,
Database,
Description,
QueryString,
WorkGroup,
region
)
SELECT
'{{ Name }}',
'{{ Database }}',
'{{ Description }}',
'{{ QueryString }}',
'{{ WorkGroup }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: named_query
props:
- name: Name
value: '{{ Name }}'
- name: Database
value: '{{ Database }}'
- name: Description
value: '{{ Description }}'
- name: QueryString
value: '{{ QueryString }}'
- name: WorkGroup
value: '{{ WorkGroup }}'
DELETE
example
/*+ delete */
DELETE FROM aws.athena.named_queries
WHERE data__Identifier = '<NamedQueryId>'
AND region = 'us-east-1';
Permissions
To operate on the named_queries
resource, the following permissions are required:
Create
athena:CreateNamedQuery
Read
athena:GetNamedQuery
List
athena:ListNamedQueries
Delete
athena:DeleteNamedQuery