data_catalogs
Creates, updates, deletes or gets a data_catalog resource or lists data_catalogs in a region
Overview
| Name | data_catalogs |
| Type | Resource |
| Description | Resource schema for AWS::Athena::DataCatalog |
| Id | awscc.athena.data_catalogs |
Fields
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters. |
description | string | A description of the data catalog to be created. |
parameters | object | Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type. |
tags | array | A list of comma separated tags to add to the data catalog that is created. |
type | string | The type of data catalog to create: LAMBDA for a federated catalog, GLUE for AWS Glue Catalog, or HIVE for an external hive metastore. FEDERATED is a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass. |
status | string | The status of the creation or deletion of the data catalog. LAMBDA, GLUE, and HIVE data catalog types are created synchronously. Their status is either CREATE_COMPLETE or CREATE_FAILED. The FEDERATED data catalog type is created asynchronously. |
connection_type | string | The type of connection for a FEDERATED data catalog |
error | string | Text of the error that occurred during data catalog creation or deletion. |
region | string | AWS region. |
For more information, see AWS::Athena::DataCatalog.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Name, Type, 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 properties from an individual data_catalog.
SELECT
region,
name,
description,
parameters,
tags,
type,
status,
connection_type,
error
FROM awscc.athena.data_catalogs
WHERE region = 'us-east-1' AND data__Identifier = '<Name>';
INSERT example
Use the following StackQL query and manifest file to create a new data_catalog resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.athena.data_catalogs (
Name,
Type,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.athena.data_catalogs (
Name,
Description,
Parameters,
Tags,
Type,
Status,
ConnectionType,
Error,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Parameters }}',
'{{ Tags }}',
'{{ Type }}',
'{{ Status }}',
'{{ ConnectionType }}',
'{{ Error }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: data_catalog
props:
- name: Name
value: '{{ Name }}'
- name: Description
value: '{{ Description }}'
- name: Parameters
value: {}
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: Type
value: '{{ Type }}'
- name: Status
value: '{{ Status }}'
- name: ConnectionType
value: '{{ ConnectionType }}'
- name: Error
value: '{{ Error }}'
DELETE example
/*+ delete */
DELETE FROM awscc.athena.data_catalogs
WHERE data__Identifier = '<Name>'
AND region = 'us-east-1';
Permissions
To operate on the data_catalogs resource, the following permissions are required:
Create
athena:CreateDataCatalog,
athena:GetDataCatalog,
athena:TagResource,
s3:ListBucket,
glue:TagResource,
glue:CreateConnection,
glue:DeleteConnection,
glue:UpdateConnection,
serverlessrepo:CreateCloudFormationTemplate,
serverlessrepo:GetCloudFormationTemplate,
cloudformation:CreateStack,
cloudformation:DeleteStack,
cloudformation:DescribeStacks,
cloudformation:CreateChangeSet,
iam:AttachRolePolicy,
iam:DetachRolePolicy,
iam:DeleteRolePolicy,
iam:PutRolePolicy,
iam:CreateRole,
iam:TagRole,
iam:DeleteRole,
iam:GetRole,
iam:GetRolePolicy,
iam:PassRole,
lambda:DeleteFunction,
lambda:CreateFunction,
lambda:TagResource,
lambda:GetFunction,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcs,
secretsmanager:ListSecrets,
glue:GetConnection,
ecr:BatchGetImage,
ecr:GetDownloadUrlForLayer
Read
athena:GetDataCatalog,
athena:ListTagsForResource
Update
athena:UpdateDataCatalog,
athena:TagResource,
athena:GetDataCatalog,
athena:UntagResource,
athena:ListTagsForResource
Delete
athena:DeleteDataCatalog,
athena:GetDataCatalog,
glue:GetConnection,
glue:UpdateConnection,
cloudformation:DeleteStack,
cloudformation:DescribeStacks,
lambda:DeleteFunction,
iam:DeleteRole,
iam:DeleteRolePolicy,
iam:DetachRolePolicy,
s3:ListBucket
List
athena:ListDataCatalogs