databases
Creates, updates, deletes or gets a database
resource or lists databases
in a region
Overview
Name | databases |
Type | Resource |
Description | The AWS::Timestream::Database resource creates a Timestream database. |
Id | aws.timestream.databases |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
database_name | string | The 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_id | string | The 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. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all databases
in a region.
SELECT
region,
arn,
database_name,
kms_key_id,
tags
FROM aws.timestream.databases
WHERE region = 'us-east-1';
Gets all properties from an individual database
.
SELECT
region,
arn,
database_name,
kms_key_id,
tags
FROM aws.timestream.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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.timestream.databases (
DatabaseName,
KmsKeyId,
Tags,
region
)
SELECT
'{{ DatabaseName }}',
'{{ KmsKeyId }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.timestream.databases (
DatabaseName,
KmsKeyId,
Tags,
region
)
SELECT
'{{ DatabaseName }}',
'{{ KmsKeyId }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: database
props:
- name: DatabaseName
value: '{{ DatabaseName }}'
- name: KmsKeyId
value: '{{ KmsKeyId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.timestream.databases
WHERE data__Identifier = '<DatabaseName>'
AND region = 'us-east-1';
Permissions
To operate on the databases
resource, the following permissions are required:
Create
timestream:CreateDatabase,
timestream:DescribeEndpoints,
timestream:TagResource,
kms:CreateGrant,
kms:DescribeKey,
kms:Decrypt
Read
timestream:DescribeDatabase,
timestream:DescribeEndpoints,
timestream:ListTagsForResource
Update
timestream:UpdateDatabase,
timestream:DescribeDatabase,
timestream:DescribeEndpoints,
timestream:TagResource,
timestream:UntagResource
Delete
timestream:DeleteDatabase,
timestream:DescribeEndpoints
List
timestream:ListDatabases,
timestream:DescribeEndpoints