Skip to main content

data_catalogs

Creates, updates, deletes or gets a data_catalog resource or lists data_catalogs in a region

Overview

Namedata_catalogs
TypeResource
DescriptionResource schema for AWS::Athena::DataCatalog
Idawscc.athena.data_catalogs

Fields

NameDatatypeDescription
namestringThe 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.
descriptionstringA description of the data catalog to be created.
parametersobjectSpecifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type.
tagsarrayA list of comma separated tags to add to the data catalog that is created.
typestringThe 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.
statusstringThe 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_typestringThe type of connection for a FEDERATED data catalog
errorstringText of the error that occurred during data catalog creation or deletion.
regionstringAWS region.

For more information, see AWS::Athena::DataCatalog.

Methods

NameResourceAccessible byRequired Params
create_resourcedata_catalogsINSERTName, Type, region
delete_resourcedata_catalogsDELETEIdentifier, region
update_resourcedata_catalogsUPDATEIdentifier, PatchDocument, region
list_resourcesdata_catalogs_list_onlySELECTregion
get_resourcedata_catalogsSELECTIdentifier, 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 = '{{ region }}' AND
Identifier = '{{ name }}';

INSERT example

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

/*+ 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
;

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:

ParameterDescription
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:

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