Skip to main content

databases

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

Overview

Namedatabases
TypeResource
DescriptionThe AWS::Timestream::Database resource creates a Timestream database.
Idawscc.timestream.databases

Fields

NameDatatypeDescription
arnstring
database_namestringThe name for the database. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the database name.
kms_key_idstringThe KMS key for the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcedatabasesINSERTregion
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,
arn,
database_name,
kms_key_id,
tags
FROM awscc.timestream.databases
WHERE
region = 'us-east-1' 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.timestream.databases (
DatabaseName,
KmsKeyId,
Tags,
region
)
SELECT
'{{ database_name }}',
'{{ kms_key_id }}',
'{{ tags }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.timestream.databases
SET PatchDocument = string('{{ {
"KmsKeyId": kms_key_id,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ database_name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.timestream.databases
WHERE
Identifier = '{{ database_name }}' AND
region = 'us-east-1';

Permissions

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

timestream:CreateDatabase,
timestream:DescribeEndpoints,
timestream:TagResource,
kms:CreateGrant,
kms:DescribeKey,
kms:Decrypt