aws logo
AWS Classic v5.41.0, May 15 23

aws.athena.Database

Explore with Pulumi AI

Provides an Athena database.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleBucketV2 = new Aws.S3.BucketV2("exampleBucketV2");

    var exampleDatabase = new Aws.Athena.Database("exampleDatabase", new()
    {
        Name = "database_name",
        Bucket = exampleBucketV2.Id,
    });

});
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.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.athena.Database;
import com.pulumi.aws.athena.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 exampleBucketV2 = new BucketV2("exampleBucketV2");

        var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()        
            .name("database_name")
            .bucket(exampleBucketV2.id())
            .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.id)
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.id,
});
resources:
  exampleBucketV2:
    type: aws:s3:BucketV2
  exampleDatabase:
    type: aws:athena:Database
    properties:
      name: database_name
      bucket: ${exampleBucketV2.id}

Create 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

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

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

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

ForceDestroy bool

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>

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

AclConfiguration DatabaseAclConfigurationArgs

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

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

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

ForceDestroy bool

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

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

aclConfiguration DatabaseAclConfigurationArgs

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

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

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

forceDestroy Boolean

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>

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

aclConfiguration DatabaseAclConfigurationArgs

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

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

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

forceDestroy boolean

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}

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

acl_configuration DatabaseAclConfigurationArgs

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

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

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

force_destroy bool

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]

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

aclConfiguration Property Map

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

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

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

forceDestroy Boolean

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>

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 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

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

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

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

ForceDestroy bool

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>

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

AclConfiguration DatabaseAclConfigurationArgs

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

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

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

ForceDestroy bool

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

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

aclConfiguration DatabaseAclConfigurationArgs

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

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

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

forceDestroy Boolean

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>

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

aclConfiguration DatabaseAclConfigurationArgs

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

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

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

forceDestroy boolean

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}

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

acl_configuration DatabaseAclConfigurationArgs

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

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

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

force_destroy bool

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]

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

aclConfiguration Property Map

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

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

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

forceDestroy Boolean

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>

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

Supporting Types

DatabaseAclConfiguration

S3AclOption string

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

S3AclOption string

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

s3AclOption String

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

s3AclOption string

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

s3_acl_option str

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

s3AclOption String

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

DatabaseEncryptionConfiguration

EncryptionOption string

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

KmsKey string

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

EncryptionOption string

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

KmsKey string

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

encryptionOption String

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey String

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

encryptionOption string

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey string

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

encryption_option str

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kms_key str

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

encryptionOption String

Type of key; one of SSE_S3, SSE_KMS, CSE_KMS

kmsKey String

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 configuration on an imported resource, the provider will always show a difference. To workaround this behavior, either omit the argument from the 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.id

There is no API for reading bucket

lifecycle {

ignore_changes = [bucket]

} }

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.