Resource: aws_athena_database

Provides an Athena database.

Example Usage

resource "aws_s3_bucket" "example" {
  bucket = "example"
}

resource "aws_athena_database" "example" {
  name   = "database_name"
  bucket = aws_s3_bucket.example.id
}

Argument Reference

This resource supports the following arguments:

ACL Configuration

Encryption Configuration

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Athena Databases using their name. For example:

import {
  to = aws_athena_database.example
  id = "example"
}

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

% terraform import aws_athena_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. For example:

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