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
- get (all properties)
- list (identifiers only)
| 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. |
| 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. |
region | string | AWS region. |
For more information, see AWS::Athena::DataCatalog.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | data_catalogs | INSERT | Name, Type, region |
delete_resource | data_catalogs | DELETE | Identifier, region |
update_resource | data_catalogs | UPDATE | Identifier, PatchDocument, region |
list_resources | data_catalogs_list_only | SELECT | region |
get_resource | data_catalogs | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = '{{ region }}' AND
Identifier = '{{ name }}';
Lists all data_catalogs in a region.
SELECT
region,
name
FROM awscc.athena.data_catalogs_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.athena.data_catalogs (
Name,
Description,
Parameters,
Tags,
Type,
Status,
ConnectionType,
Error,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ parameters }}',
'{{ tags }}',
'{{ type }}',
'{{ status }}',
'{{ connection_type }}',
'{{ error }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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: connection_type
value: '{{ connection_type }}'
- name: error
value: '{{ error }}'
UPDATE example
Use the following StackQL query and manifest file to update a data_catalog resource, using stack-deploy.
/*+ update */
UPDATE awscc.athena.data_catalogs
SET PatchDocument = string('{{ {
"Description": description,
"Parameters": parameters,
"Tags": tags,
"Type": type,
"Status": status,
"ConnectionType": connection_type,
"Error": error
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.athena.data_catalogs
WHERE
Identifier = '{{ name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the data_catalogs resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
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
athena:GetDataCatalog,
athena:ListTagsForResource
athena:UpdateDataCatalog,
athena:TagResource,
athena:GetDataCatalog,
athena:UntagResource,
athena:ListTagsForResource
athena:DeleteDataCatalog,
athena:GetDataCatalog,
glue:GetConnection,
glue:UpdateConnection,
cloudformation:DeleteStack,
cloudformation:DescribeStacks,
lambda:DeleteFunction,
iam:DeleteRole,
iam:DeleteRolePolicy,
iam:DetachRolePolicy,
s3:ListBucket
athena:ListDataCatalogs