AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

Database

Provides an Athena database.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleBucketV2 = new Aws.S3.BucketV2("exampleBucketV2", new Aws.S3.BucketV2Args
        {
        });
        var exampleDatabase = new Aws.Athena.Database("exampleDatabase", new Aws.Athena.DatabaseArgs
        {
            Name = "database_name",
            Bucket = exampleBucketV2.Bucket,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleBucketV2, err := s3.NewBucketV2(ctx, "exampleBucketV2", nil)
		if err != nil {
			return err
		}
		_, err = athena.NewDatabase(ctx, "exampleDatabase", &athena.DatabaseArgs{
			Name:   pulumi.String("database_name"),
			Bucket: exampleBucketV2.Bucket,
		})
		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 exampleBucketV2 = new BucketV2("exampleBucketV2");

        var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()        
            .name("database_name")
            .bucket(exampleBucketV2.getBucket())
            .build());

        }
}
import pulumi
import pulumi_aws as aws

example_bucket_v2 = aws.s3.BucketV2("exampleBucketV2")
example_database = aws.athena.Database("exampleDatabase",
    name="database_name",
    bucket=example_bucket_v2.bucket)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleBucketV2 = new aws.s3.BucketV2("exampleBucketV2", {});
const exampleDatabase = new aws.athena.Database("exampleDatabase", {
    name: "database_name",
    bucket: exampleBucketV2.bucket,
});
resources:
  exampleBucketV2:
    type: aws:s3:BucketV2
  exampleDatabase:
    type: aws:athena:Database
    properties:
      name: database_name
      bucket: ${exampleBucketV2.bucket}

Create a Database Resource

new Database(name: string, args?: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             acl_configuration: Optional[DatabaseAclConfigurationArgs] = None,
             bucket: Optional[str] = None,
             comment: Optional[str] = None,
             encryption_configuration: Optional[DatabaseEncryptionConfigurationArgs] = None,
             expected_bucket_owner: Optional[str] = None,
             force_destroy: Optional[bool] = None,
             name: Optional[str] = None,
             properties: Optional[Mapping[str, str]] = None)
@overload
def Database(resource_name: str,
             args: Optional[DatabaseArgs] = None,
             opts: Optional[ResourceOptions] = None)
func NewDatabase(ctx *Context, name string, args *DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs? args = null, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: aws:athena: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:

AclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

Bucket string

Name of S3 bucket to save the results of the query execution.

Comment string

Description of the database.

EncryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

ExpectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

ForceDestroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

Name string

Name of the database to create.

Properties Dictionary<string, string>

A key-value map of custom metadata properties for the database definition.

AclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

Bucket string

Name of S3 bucket to save the results of the query execution.

Comment string

Description of the database.

EncryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

ExpectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

ForceDestroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

Name string

Name of the database to create.

Properties map[string]string

A key-value map of custom metadata properties for the database definition.

aclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket String

Name of S3 bucket to save the results of the query execution.

comment String

Description of the database.

encryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner String

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy Boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name String

Name of the database to create.

properties Map

A key-value map of custom metadata properties for the database definition.

aclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket string

Name of S3 bucket to save the results of the query execution.

comment string

Description of the database.

encryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name string

Name of the database to create.

properties {[key: string]: string}

A key-value map of custom metadata properties for the database definition.

acl_configuration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket str

Name of S3 bucket to save the results of the query execution.

comment str

Description of the database.

encryption_configuration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expected_bucket_owner str

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

force_destroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name str

Name of the database to create.

properties Mapping[str, str]

A key-value map of custom metadata properties for the database definition.

aclConfiguration Property Map

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket String

Name of S3 bucket to save the results of the query execution.

comment String

Description of the database.

encryptionConfiguration Property Map

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner String

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy Boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name String

Name of the database to create.

properties Map

A key-value map of custom metadata properties for the database definition.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

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,
        acl_configuration: Optional[DatabaseAclConfigurationArgs] = None,
        bucket: Optional[str] = None,
        comment: Optional[str] = None,
        encryption_configuration: Optional[DatabaseEncryptionConfigurationArgs] = None,
        expected_bucket_owner: Optional[str] = None,
        force_destroy: Optional[bool] = None,
        name: Optional[str] = None,
        properties: 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:
AclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

Bucket string

Name of S3 bucket to save the results of the query execution.

Comment string

Description of the database.

EncryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

ExpectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

ForceDestroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

Name string

Name of the database to create.

Properties Dictionary<string, string>

A key-value map of custom metadata properties for the database definition.

AclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

Bucket string

Name of S3 bucket to save the results of the query execution.

Comment string

Description of the database.

EncryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

ExpectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

ForceDestroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

Name string

Name of the database to create.

Properties map[string]string

A key-value map of custom metadata properties for the database definition.

aclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket String

Name of S3 bucket to save the results of the query execution.

comment String

Description of the database.

encryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner String

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy Boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name String

Name of the database to create.

properties Map

A key-value map of custom metadata properties for the database definition.

aclConfiguration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket string

Name of S3 bucket to save the results of the query execution.

comment string

Description of the database.

encryptionConfiguration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner string

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name string

Name of the database to create.

properties {[key: string]: string}

A key-value map of custom metadata properties for the database definition.

acl_configuration DatabaseAclConfigurationArgs

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket str

Name of S3 bucket to save the results of the query execution.

comment str

Description of the database.

encryption_configuration DatabaseEncryptionConfigurationArgs

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expected_bucket_owner str

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

force_destroy bool

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name str

Name of the database to create.

properties Mapping[str, str]

A key-value map of custom metadata properties for the database definition.

aclConfiguration Property Map

Indicates that an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.

bucket String

Name of S3 bucket to save the results of the query execution.

comment String

Description of the database.

encryptionConfiguration Property Map

The encryption key block AWS Athena uses to decrypt the data in S3, such as an AWS Key Management Service (AWS KMS) key. See Encryption Configuration below.

expectedBucketOwner String

The AWS account ID that you expect to be the owner of the Amazon S3 bucket.

forceDestroy Boolean

A boolean that indicates all tables should be deleted from the database so that the database can be destroyed without error. The tables are not recoverable.

name String

Name of the database to create.

properties Map

A key-value map of custom metadata properties for the database definition.

Supporting Types

DatabaseAclConfiguration

S3AclOption string

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

S3AclOption string

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

s3AclOption String

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

s3AclOption string

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

s3_acl_option str

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

s3AclOption String

The Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.

DatabaseEncryptionConfiguration

EncryptionOption string

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

KmsKey string

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

EncryptionOption string

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

KmsKey string

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

encryptionOption String

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey String

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

encryptionOption string

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey string

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

encryption_option str

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kms_key str

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

encryptionOption String

The type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey String

The KMS key ARN or ID; required for key types SSE_KMS and CSE_KMS.

Import

Athena Databases can be imported using their name, e.g.,

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

Certain resource arguments, like encryption_configuration and bucket, do not have an API method for reading the information after creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use ignore_changes to hide the difference, e.g., terraform resource “aws_athena_database” “example” {

name

= “database_name”

bucket = aws_s3_bucket.example.bucket

There is no API for reading bucket

lifecycle {

ignore_changes = [bucket]

} }

Package Details

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

This Pulumi package is based on the aws Terraform Provider.