hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 8.99k forks source link

[Enhancement]: Add workgroup parameter in aws_athena_database #36621

Open tlorreyte opened 3 months ago

tlorreyte commented 3 months ago

Description

Currently, the resource does not have a parameter for the workgroup in which the query should be executed, and by default, all databases are created in the "primary" workgroup.

This makes it impossible to deactivate.

It would be nice if we could have a parameter to indicate the workgroup where to execute the query to create the database.

Affected Resource(s) and/or Data Source(s)

aws_athena_database

Potential Terraform Configuration

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

resource "aws_athena_workgroup" "example" {
  name = "example"

  configuration {
    enforce_workgroup_configuration    = true
    publish_cloudwatch_metrics_enabled = true

    result_configuration {
      output_location = "s3://${aws_s3_bucket.example.bucket}/output/"

      encryption_configuration {
        encryption_option = "SSE_KMS"
        kms_key_arn       = aws_kms_key.example.arn
      }
    }
  }
}

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

References

No response

Would you like to implement a fix?

Yes

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue