You must be logged in to view saved presets
This template creates an AWS S3 bucket, an Athena workgroup, an Athena database, and a prepared statement for querying the database.
resource "aws_athena_database" "test" {
bucket = aws_s3_bucket.test.bucket
name = "example"
}
resource "aws_athena_prepared_statement" "test" {
name = "tf_test"
query_statement = "SELECT * FROM ${aws_athena_database.test.name} WHERE x = ?"
workgroup = aws_athena_workgroup.test.name
}
resource "aws_athena_workgroup" "test" {
name = "tf-test"
}
resource "aws_s3_bucket" "test" {
bucket = "tf-test"
force_destroy = true
}