AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

Database

Provides a Timestream database resource.

Example Usage

Basic usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.TimestreamWrite.Database("example", new Aws.TimestreamWrite.DatabaseArgs
        {
            DatabaseName = "database-example",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/timestreamwrite"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := timestreamwrite.NewDatabase(ctx, "example", &timestreamwrite.DatabaseArgs{
			DatabaseName: pulumi.String("database-example"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Database("example", DatabaseArgs.builder()        
            .databaseName("database-example")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.timestreamwrite.Database("example", database_name="database-example")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.timestreamwrite.Database("example", {
    databaseName: "database-example",
});
resources:
  example:
    type: aws:timestreamwrite:Database
    properties:
      databaseName: database-example

Full usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.TimestreamWrite.Database("example", new Aws.TimestreamWrite.DatabaseArgs
        {
            DatabaseName = "database-example",
            KmsKeyId = aws_kms_key.Example.Arn,
            Tags = 
            {
                { "Name", "value" },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/timestreamwrite"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := timestreamwrite.NewDatabase(ctx, "example", &timestreamwrite.DatabaseArgs{
			DatabaseName: pulumi.String("database-example"),
			KmsKeyId:     pulumi.Any(aws_kms_key.Example.Arn),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("value"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Database("example", DatabaseArgs.builder()        
            .databaseName("database-example")
            .kmsKeyId(aws_kms_key.example().arn())
            .tags(Map.of("Name", "value"))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.timestreamwrite.Database("example",
    database_name="database-example",
    kms_key_id=aws_kms_key["example"]["arn"],
    tags={
        "Name": "value",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.timestreamwrite.Database("example", {
    databaseName: "database-example",
    kmsKeyId: aws_kms_key.example.arn,
    tags: {
        Name: "value",
    },
});
resources:
  example:
    type: aws:timestreamwrite:Database
    properties:
      databaseName: database-example
      kmsKeyId: ${aws_kms_key.example.arn}
      tags:
        Name: value

Create a Database Resource

new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             database_name: Optional[str] = None,
             kms_key_id: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)
@overload
def Database(resource_name: str,
             args: DatabaseArgs,
             opts: Optional[ResourceOptions] = None)
func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: aws:timestreamwrite:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Database Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Database resource accepts the following input properties:

DatabaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

KmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

Tags Dictionary<string, string>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

DatabaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

KmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

Tags map[string]string

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

databaseName String

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId String

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tags Map<String,String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

databaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tags {[key: string]: string}

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

database_name str

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kms_key_id str

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tags Mapping[str, str]

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

databaseName String

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId String

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tags Map<String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:

Arn string

The ARN that uniquely identifies this database.

Id string

The provider-assigned unique ID for this managed resource.

TableCount int

The total number of tables found within the Timestream database.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The ARN that uniquely identifies this database.

Id string

The provider-assigned unique ID for this managed resource.

TableCount int

The total number of tables found within the Timestream database.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN that uniquely identifies this database.

id String

The provider-assigned unique ID for this managed resource.

tableCount Integer

The total number of tables found within the Timestream database.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The ARN that uniquely identifies this database.

id string

The provider-assigned unique ID for this managed resource.

tableCount number

The total number of tables found within the Timestream database.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The ARN that uniquely identifies this database.

id str

The provider-assigned unique ID for this managed resource.

table_count int

The total number of tables found within the Timestream database.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN that uniquely identifies this database.

id String

The provider-assigned unique ID for this managed resource.

tableCount Number

The total number of tables found within the Timestream database.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up an Existing Database Resource

Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        database_name: Optional[str] = None,
        kms_key_id: Optional[str] = None,
        table_count: Optional[int] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Database
func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)
public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

The ARN that uniquely identifies this database.

DatabaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

KmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

TableCount int

The total number of tables found within the Timestream database.

Tags Dictionary<string, string>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The ARN that uniquely identifies this database.

DatabaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

KmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

TableCount int

The total number of tables found within the Timestream database.

Tags map[string]string

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN that uniquely identifies this database.

databaseName String

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId String

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tableCount Integer

The total number of tables found within the Timestream database.

tags Map<String,String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The ARN that uniquely identifies this database.

databaseName string

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId string

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tableCount number

The total number of tables found within the Timestream database.

tags {[key: string]: string}

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The ARN that uniquely identifies this database.

database_name str

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kms_key_id str

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

table_count int

The total number of tables found within the Timestream database.

tags Mapping[str, str]

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN that uniquely identifies this database.

databaseName String

The name of the Timestream database. Minimum length of 3. Maximum length of 64.

kmsKeyId String

The ARN (not Alias ARN) of the KMS key to be used to encrypt the data stored in the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

tableCount Number

The total number of tables found within the Timestream database.

tags Map<String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Import

Timestream databases can be imported using the database_name, e.g.,

 $ pulumi import aws:timestreamwrite/database:Database example example

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.