SSE encryption of S3 using Terraform

懵懂的女人 提交于 2019-12-22 08:45:04

问题


I want to create a S3 and make it encryption at rest with AES256, but terraform complain that: * aws_s3_bucket.s3: : invalid or unknown key: server_side_encryption_configuration (see my code complained by terraform below)

What is wrong with server_side_encryption_configuration? isn't it supported? https://www.terraform.io/docs/providers/aws/r/s3_bucket.html

Anyway, how to have "encryption at rest with AES256" for S3 using terraform?

resource "aws_s3_bucket" "s3" {
  bucket = "s3_bucket_name"
  acl = "private"
  force_destroy = true
  server_side_encryption_configuration {
    rule {
      apply_server_side_encryption_by_default {
        sse_algorithm     = "AES256"
      }
    }
 }
}

回答1:


You probably have an older version of the AWS provider plugin. To update it, run terraform init with the -upgrade flag set to true

terraform init -upgrade=true



来源:https://stackoverflow.com/questions/47957225/sse-encryption-of-s3-using-terraform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!