Skip to content

Instantly share code, notes, and snippets.

@GMKBabu
Forked from 100daysofdevops/s3_kms.tf
Created October 21, 2019 07:01
Show Gist options
  • Save GMKBabu/fcb8ddabb8d0e1c782794dac46e3b970 to your computer and use it in GitHub Desktop.
Save GMKBabu/fcb8ddabb8d0e1c782794dac46e3b970 to your computer and use it in GitHub Desktop.
provider "aws" {
region = "us-west-2"
}
resource "aws_s3_bucket" "mybucket" {
bucket = "mys3bucket-withkms-serverside-encryption"
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = "${var.kms_key}"
sse_algorithm = "aws:kms"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment