1. Packages
  2. AWS
  3. API Docs
  4. timestreamwrite
  5. Database
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.timestreamwrite.Database

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a Timestream database resource.

    Example Usage

    Basic usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.timestreamwrite.Database("example", {databaseName: "database-example"});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.timestreamwrite.Database("example", database_name="database-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.TimestreamWrite.Database("example", new()
        {
            DatabaseName = "database-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.timestreamwrite.Database;
    import com.pulumi.aws.timestreamwrite.DatabaseArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    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());
    
        }
    }
    
    resources:
      example:
        type: aws:timestreamwrite:Database
        properties:
          databaseName: database-example
    

    Full usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.timestreamwrite.Database("example", {
        databaseName: "database-example",
        kmsKeyId: exampleAwsKmsKey.arn,
        tags: {
            Name: "value",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.timestreamwrite.Database("example",
        database_name="database-example",
        kms_key_id=example_aws_kms_key["arn"],
        tags={
            "Name": "value",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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(exampleAwsKmsKey.Arn),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.TimestreamWrite.Database("example", new()
        {
            DatabaseName = "database-example",
            KmsKeyId = exampleAwsKmsKey.Arn,
            Tags = 
            {
                { "Name", "value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.timestreamwrite.Database;
    import com.pulumi.aws.timestreamwrite.DatabaseArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    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(exampleAwsKmsKey.arn())
                .tags(Map.of("Name", "value"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:timestreamwrite:Database
        properties:
          databaseName: database-example
          kmsKeyId: ${exampleAwsKmsKey.arn}
          tags:
            Name: value
    

    Create Database Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def Database(resource_name: str,
                 args: DatabaseArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @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)
    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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var exampledatabaseResourceResourceFromTimestreamwritedatabase = new Aws.TimestreamWrite.Database("exampledatabaseResourceResourceFromTimestreamwritedatabase", new()
    {
        DatabaseName = "string",
        KmsKeyId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := timestreamwrite.NewDatabase(ctx, "exampledatabaseResourceResourceFromTimestreamwritedatabase", &timestreamwrite.DatabaseArgs{
    	DatabaseName: pulumi.String("string"),
    	KmsKeyId:     pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var exampledatabaseResourceResourceFromTimestreamwritedatabase = new Database("exampledatabaseResourceResourceFromTimestreamwritedatabase", DatabaseArgs.builder()
        .databaseName("string")
        .kmsKeyId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    exampledatabase_resource_resource_from_timestreamwritedatabase = aws.timestreamwrite.Database("exampledatabaseResourceResourceFromTimestreamwritedatabase",
        database_name="string",
        kms_key_id="string",
        tags={
            "string": "string",
        })
    
    const exampledatabaseResourceResourceFromTimestreamwritedatabase = new aws.timestreamwrite.Database("exampledatabaseResourceResourceFromTimestreamwritedatabase", {
        databaseName: "string",
        kmsKeyId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:timestreamwrite:Database
    properties:
        databaseName: string
        kmsKeyId: string
        tags:
            string: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    Look up 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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    Import

    Using pulumi import, import Timestream databases using the database_name. For example:

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi