Skip to main content

catalogs

Creates, updates, deletes, gets or lists a catalogs resource.

Overview

Namecatalogs
TypeResource
Idaws.glue.catalogs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
allow_full_table_external_data_accessstringAllows third-party engines to access data in Amazon S3 locations that are registered with Lake Formation. (True, False)
catalog_idstringThe ID of the catalog. To grant access to the default catalog, this field should not be provided. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
catalog_propertiesobjectA CatalogProperties object that specifies data lake access properties and other custom properties.
create_database_default_permissionsarrayAn array of PrincipalPermissions objects. Creates a set of default permissions on the database(s) for principals. Used by Amazon Web Services Lake Formation. Not used in the normal course of Glue operations.
create_table_default_permissionsarrayAn array of PrincipalPermissions objects. Creates a set of default permissions on the table(s) for principals. Used by Amazon Web Services Lake Formation. Not used in the normal course of Glue operations.
create_timestring (date-time)The time at which the catalog was created.
descriptionstringDescription string, not more than 2048 bytes long, matching the URI address multi-line string pattern. A description of the catalog. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
federated_catalogobjectA FederatedCatalog object that points to an entity outside the Glue Data Catalog.
namestringThe name of the catalog. Cannot be the same as the account ID. (pattern: <code>^(?!(.[./\]|aws:)).$</code>)
parametersobjectA map array of key-value pairs that define parameters and properties of the catalog.
resource_arnstringThe Amazon Resource Name (ARN) assigned to the catalog resource.
target_redshift_catalogobjectA TargetRedshiftCatalog object that describes a target catalog for database resource linking.
update_timestring (date-time)The time at which the catalog was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_catalogselectregionThe name of the Catalog to retrieve. This should be all lowercase.
get_catalogsselectregionRetrieves all catalogs defined in a catalog in the Glue Data Catalog. For a Redshift-federated catalog use case, this operation returns the list of catalogs mapped to Redshift databases in the Redshift namespace catalog.
create_cataloginsertregion, Name, CatalogInputCreates a new catalog in the Glue Data Catalog.
update_catalogupdateregion, CatalogId, CatalogInputUpdates an existing catalog's properties in the Glue Data Catalog.
delete_catalogdeleteregionRemoves the specified catalog from the Glue Data Catalog. After completing this operation, you no longer have access to the databases, tables (and all table versions and partitions that might belong to the tables) and the user-defined functions in the deleted catalog. Glue deletes these "orphaned" resources asynchronously in a timely manner, at the discretion of the service. To ensure the immediate deletion of all related resources before calling the DeleteCatalog operation, use DeleteTableVersion (or BatchDeleteTableVersion), DeletePartition (or BatchDeletePartition), DeleteTable (or BatchDeleteTable), DeleteUserDefinedFunction and DeleteDatabase to delete any resources that belong to the catalog.
import_catalog_to_glueexecregionImports an existing Amazon Athena Data Catalog to Glue.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

The name of the Catalog to retrieve. This should be all lowercase.

SELECT
allow_full_table_external_data_access,
catalog_id,
catalog_properties,
create_database_default_permissions,
create_table_default_permissions,
create_time,
description,
federated_catalog,
name,
parameters,
resource_arn,
target_redshift_catalog,
update_time
FROM aws.glue.catalogs
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new catalog in the Glue Data Catalog.

INSERT INTO aws.glue.catalogs (
Name,
CatalogInput,
Tags,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ CatalogInput }}' /* required */,
'{{ Tags }}',
'{{ region }}'
;

UPDATE examples

Updates an existing catalog's properties in the Glue Data Catalog.

UPDATE aws.glue.catalogs
SET
CatalogId = '{{ CatalogId }}',
CatalogInput = '{{ CatalogInput }}'
WHERE
region = '{{ region }}' --required
AND CatalogId = '{{ CatalogId }}' --required
AND CatalogInput = '{{ CatalogInput }}' --required;

DELETE examples

Removes the specified catalog from the Glue Data Catalog. After completing this operation, you no longer have access to the databases, tables (and all table versions and partitions that might belong to the tables) and the user-defined functions in the deleted catalog. Glue deletes these "orphaned" resources asynchronously in a timely manner, at the discretion of the service. To ensure the immediate deletion of all related resources before calling the DeleteCatalog operation, use DeleteTableVersion (or BatchDeleteTableVersion), DeletePartition (or BatchDeletePartition), DeleteTable (or BatchDeleteTable), DeleteUserDefinedFunction and DeleteDatabase to delete any resources that belong to the catalog.

DELETE FROM aws.glue.catalogs
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Imports an existing Amazon Athena Data Catalog to Glue.

EXEC aws.glue.catalogs.import_catalog_to_glue
@region='{{ region }}' --required
@@json=
'{
"CatalogId": "{{ CatalogId }}"
}'
;