【问题标题】:Terraform: How to set the Amazon Athena "Query result location" with TerraformTerraform:如何使用 Terraform 设置 Amazon Athena“查询结果位置”
【发布时间】:2023-01-14 00:36:30
【问题描述】:

如果有人知道如何通过 Terraform 设置 Athena 查询结果位置,请帮助我

我的代码如下所示

resource "aws_athena_workgroup" "athena_query_result" {
 name = var.name
configuration {
  enforce_workgroup_configuration    = true
  publish_cloudwatch_metrics_enabled = true

result_configuration {
  output_location = "s3://athena-query-location/output/"

}
}
}

【问题讨论】:

    标签: terraform terraform-provider-aws amazon-athena


    【解决方案1】:

    你需要配置aws_athena_workgroup资源

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

    【讨论】:

    • 我试过了,但对我不起作用?
    • 我的示例将创建新工作组,您是否检查了新创建的工作组或primary工作组?
    • 哦,我检查了主要工作组。有什么方法可以更新主工作组吗?
    猜你喜欢
    • 2020-12-17
    • 2018-06-03
    • 2021-03-07
    • 2018-09-09
    • 2016-11-10
    • 2018-03-06
    • 1970-01-01
    • 1970-01-01
    • 2020-04-22
    相关资源
    最近更新 更多