DatabaseArgs

data class DatabaseArgs(val aclConfiguration: Output<DatabaseAclConfigurationArgs>? = null, val bucket: Output<String>? = null, val comment: Output<String>? = null, val encryptionConfiguration: Output<DatabaseEncryptionConfigurationArgs>? = null, val expectedBucketOwner: Output<String>? = null, val forceDestroy: Output<Boolean>? = null, val name: Output<String>? = null, val properties: Output<Map<String, String>>? = null) : ConvertibleToJava<DatabaseArgs>

Provides an Athena database.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketV2("example", {bucket: "example"});
const exampleDatabase = new aws.athena.Database("example", {
name: "database_name",
bucket: example.id,
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketV2("example", bucket="example")
example_database = aws.athena.Database("example",
name="database_name",
bucket=example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.BucketV2("example", new()
{
Bucket = "example",
});
var exampleDatabase = new Aws.Athena.Database("example", new()
{
Name = "database_name",
Bucket = example.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/athena"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
Bucket: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = athena.NewDatabase(ctx, "example", &athena.DatabaseArgs{
Name: pulumi.String("database_name"),
Bucket: example.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.s3.BucketV2Args;
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 example = new BucketV2("example", BucketV2Args.builder()
.bucket("example")
.build());
var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
.name("database_name")
.bucket(example.id())
.build());
}
}
resources:
example:
type: aws:s3:BucketV2
properties:
bucket: example
exampleDatabase:
type: aws:athena:Database
name: example
properties:
name: database_name
bucket: ${example.id}

Import

Using pulumi import, import Athena Databases using their name. For example:

$ 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 Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use ignore_changes to hide the difference. For example:

Constructors

Link copied to clipboard
constructor(aclConfiguration: Output<DatabaseAclConfigurationArgs>? = null, bucket: Output<String>? = null, comment: Output<String>? = null, encryptionConfiguration: Output<DatabaseEncryptionConfigurationArgs>? = null, expectedBucketOwner: Output<String>? = null, forceDestroy: Output<Boolean>? = null, name: Output<String>? = null, properties: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard

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

Link copied to clipboard
val bucket: Output<String>? = null

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

Link copied to clipboard
val comment: Output<String>? = null

Description of the database.

Link copied to clipboard

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.

Link copied to clipboard
val expectedBucketOwner: Output<String>? = null

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

Link copied to clipboard
val forceDestroy: Output<Boolean>? = null

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.

Link copied to clipboard
val name: Output<String>? = null

Name of the database to create.

Link copied to clipboard
val properties: Output<Map<String, String>>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): DatabaseArgs