Try AWS Native preview for resources not in the classic version.
aws.athena.Database
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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)
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
})
}
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 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}
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: Optional[DatabaseArgs] = None,
opts: Optional[ResourceOptions] = None)
@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)
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.
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 databaseResource = new Aws.Athena.Database("databaseResource", new()
{
AclConfiguration = new Aws.Athena.Inputs.DatabaseAclConfigurationArgs
{
S3AclOption = "string",
},
Bucket = "string",
Comment = "string",
EncryptionConfiguration = new Aws.Athena.Inputs.DatabaseEncryptionConfigurationArgs
{
EncryptionOption = "string",
KmsKey = "string",
},
ExpectedBucketOwner = "string",
ForceDestroy = false,
Name = "string",
Properties =
{
{ "string", "string" },
},
});
example, err := athena.NewDatabase(ctx, "databaseResource", &athena.DatabaseArgs{
AclConfiguration: &athena.DatabaseAclConfigurationArgs{
S3AclOption: pulumi.String("string"),
},
Bucket: pulumi.String("string"),
Comment: pulumi.String("string"),
EncryptionConfiguration: &athena.DatabaseEncryptionConfigurationArgs{
EncryptionOption: pulumi.String("string"),
KmsKey: pulumi.String("string"),
},
ExpectedBucketOwner: pulumi.String("string"),
ForceDestroy: pulumi.Bool(false),
Name: pulumi.String("string"),
Properties: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var databaseResource = new Database("databaseResource", DatabaseArgs.builder()
.aclConfiguration(DatabaseAclConfigurationArgs.builder()
.s3AclOption("string")
.build())
.bucket("string")
.comment("string")
.encryptionConfiguration(DatabaseEncryptionConfigurationArgs.builder()
.encryptionOption("string")
.kmsKey("string")
.build())
.expectedBucketOwner("string")
.forceDestroy(false)
.name("string")
.properties(Map.of("string", "string"))
.build());
database_resource = aws.athena.Database("databaseResource",
acl_configuration={
"s3AclOption": "string",
},
bucket="string",
comment="string",
encryption_configuration={
"encryptionOption": "string",
"kmsKey": "string",
},
expected_bucket_owner="string",
force_destroy=False,
name="string",
properties={
"string": "string",
})
const databaseResource = new aws.athena.Database("databaseResource", {
aclConfiguration: {
s3AclOption: "string",
},
bucket: "string",
comment: "string",
encryptionConfiguration: {
encryptionOption: "string",
kmsKey: "string",
},
expectedBucketOwner: "string",
forceDestroy: false,
name: "string",
properties: {
string: "string",
},
});
type: aws:athena:Database
properties:
aclConfiguration:
s3AclOption: string
bucket: string
comment: string
encryptionConfiguration:
encryptionOption: string
kmsKey: string
expectedBucketOwner: string
forceDestroy: false
name: string
properties:
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
The Database resource accepts the following input properties:
- Acl
Configuration DatabaseAcl Configuration - 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.
- Encryption
Configuration DatabaseEncryption Configuration - 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 stringOwner - 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 string
- Name of the database to create.
- Properties Dictionary<string, string>
- Key-value map of custom metadata properties for the database definition.
- Acl
Configuration DatabaseAcl Configuration Args - 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.
- Encryption
Configuration DatabaseEncryption Configuration Args - 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 stringOwner - 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 string
- Name of the database to create.
- Properties map[string]string
- Key-value map of custom metadata properties for the database definition.
- acl
Configuration DatabaseAcl Configuration - 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.
- encryption
Configuration DatabaseEncryption Configuration - 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 StringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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.
- acl
Configuration DatabaseAcl Configuration - 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.
- encryption
Configuration DatabaseEncryption Configuration - 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 stringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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 DatabaseAcl Configuration Args - 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 DatabaseEncryption Configuration Args - 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_ strowner - 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.
- acl
Configuration 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.
- encryption
Configuration 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.
- expected
Bucket StringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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.
- Acl
Configuration DatabaseAcl Configuration - 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.
- Encryption
Configuration DatabaseEncryption Configuration - 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 stringOwner - 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 string
- Name of the database to create.
- Properties Dictionary<string, string>
- Key-value map of custom metadata properties for the database definition.
- Acl
Configuration DatabaseAcl Configuration Args - 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.
- Encryption
Configuration DatabaseEncryption Configuration Args - 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 stringOwner - 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 string
- Name of the database to create.
- Properties map[string]string
- Key-value map of custom metadata properties for the database definition.
- acl
Configuration DatabaseAcl Configuration - 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.
- encryption
Configuration DatabaseEncryption Configuration - 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 StringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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.
- acl
Configuration DatabaseAcl Configuration - 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.
- encryption
Configuration DatabaseEncryption Configuration - 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 stringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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 DatabaseAcl Configuration Args - 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 DatabaseEncryption Configuration Args - 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_ strowner - 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.
- acl
Configuration 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.
- encryption
Configuration 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.
- expected
Bucket StringOwner - AWS account ID that you expect to be the owner of the Amazon S3 bucket.
- force
Destroy 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, DatabaseAclConfigurationArgs
- S3Acl
Option string Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
- S3Acl
Option string Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
- s3Acl
Option String Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
- s3Acl
Option string Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
- s3_
acl_ stroption Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
- s3Acl
Option String Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is
BUCKET_OWNER_FULL_CONTROL
.NOTE: When Athena queries are executed, result files may be created in the specified bucket. Consider using
force_destroy
on the bucket too in order to avoid any problems when destroying the bucket.
DatabaseEncryptionConfiguration, DatabaseEncryptionConfigurationArgs
- Encryption
Option string - Type of key; one of
SSE_S3
,SSE_KMS
,CSE_KMS
- Kms
Key string - KMS key ARN or ID; required for key types
SSE_KMS
andCSE_KMS
.
- Encryption
Option string - Type of key; one of
SSE_S3
,SSE_KMS
,CSE_KMS
- Kms
Key string - KMS key ARN or ID; required for key types
SSE_KMS
andCSE_KMS
.
- encryption
Option String - Type of key; one of
SSE_S3
,SSE_KMS
,CSE_KMS
- kms
Key String - KMS key ARN or ID; required for key types
SSE_KMS
andCSE_KMS
.
- encryption
Option string - Type of key; one of
SSE_S3
,SSE_KMS
,CSE_KMS
- kms
Key string - KMS key ARN or ID; required for key types
SSE_KMS
andCSE_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
andCSE_KMS
.
- encryption
Option String - Type of key; one of
SSE_S3
,SSE_KMS
,CSE_KMS
- kms
Key String - KMS key ARN or ID; required for key types
SSE_KMS
andCSE_KMS
.
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:
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.
Try AWS Native preview for resources not in the classic version.