Skip to main content

databases

Creates, updates, deletes or gets a database resource or lists databases in a region

Overview

Namedatabases
TypeResource
DescriptionResource Type definition for AWS::Glue::Database
Idaws.glue.databases

Fields

NameDatatypeDescription
catalog_idstringThe AWS account ID for the account in which to create the catalog object.
database_inputobjectThe metadata for the database.
database_namestringThe name of the database. For hive compatibility, this is folded to lowercase when it is store.
regionstringAWS region.

For more information, see AWS::Glue::Database.

Methods

NameAccessible byRequired Params
create_resourceINSERTDatabaseInput, CatalogId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all databases in a region.

SELECT
region,
catalog_id,
database_input,
database_name
FROM aws.glue.databases
WHERE region = 'us-east-1';

Gets all properties from an individual database.

SELECT
region,
catalog_id,
database_input,
database_name
FROM aws.glue.databases
WHERE region = 'us-east-1' AND data__Identifier = '<DatabaseName>';

INSERT example

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

/*+ create */
INSERT INTO aws.glue.databases (
CatalogId,
DatabaseInput,
region
)
SELECT
'{{ CatalogId }}',
'{{ DatabaseInput }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.glue.databases
WHERE data__Identifier = '<DatabaseName>'
AND region = 'us-east-1';

Permissions

To operate on the databases resource, the following permissions are required:

Create

glue:CreateDatabase,
glue:GetDatabase,
glue:PassConnection,
glue:CreateConnection,
lakeformation:ListResources,
lakeformation:DescribeResource,
lakeformation:DescribeLakeFormationIdentityCenterConfiguration

Read

glue:GetDatabase,
glue:GetConnection,
lakeformation:ListResources,
lakeformation:DescribeResource,
lakeformation:DescribeLakeFormationIdentityCenterConfiguration

Update

glue:UpdateDatabase,
glue:UpdateConnection,
lakeformation:ListResources,
lakeformation:DescribeResource,
lakeformation:DescribeLakeFormationIdentityCenterConfiguration

Delete

glue:DeleteDatabase,
glue:GetDatabase,
glue:DeleteConnection,
glue:GetConnection,
lakeformation:ListResources,
lakeformation:DescribeResource,
lakeformation:DescribeLakeFormationIdentityCenterConfiguration

List

glue:GetDatabases,
lakeformation:ListResources,
lakeformation:DescribeResource,
lakeformation:DescribeLakeFormationIdentityCenterConfiguration