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
Idawscc.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

NameResourceAccessible byRequired Params
create_resourcedatabasesINSERTDatabaseInput, CatalogId, region
delete_resourcedatabasesDELETEIdentifier, region
update_resourcedatabasesUPDATEIdentifier, PatchDocument, region
list_resourcesdatabases_list_onlySELECTregion
get_resourcedatabasesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual database.

SELECT
region,
catalog_id,
database_input,
database_name
FROM awscc.glue.databases
WHERE
region = '{{ region }}' AND
Identifier = '{{ database_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.glue.databases (
CatalogId,
DatabaseInput,
region
)
SELECT
'{{ catalog_id }}',
'{{ database_input }}',
'{{ 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 database resource, using stack-deploy.

/*+ update */
UPDATE awscc.glue.databases
SET PatchDocument = string('{{ {
"CatalogId": catalog_id,
"DatabaseInput": database_input
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ database_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.glue.databases
WHERE
Identifier = '{{ database_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 databases resource, the following permissions are required:

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