Created
November 12, 2018 09:25
-
-
Save abhaybhargav/a79e968c846ff8a53014b348140f4a75 to your computer and use it in GitHub Desktop.
Amazon SSE with KMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_kms_key" "s3_key" { | |
| description = "This key is used to encrypt bucket objects" | |
| deletion_window_in_days = 10 | |
| } | |
| resource "random_string" "bucket_name" { | |
| length = 10 | |
| special = false | |
| upper = false | |
| } | |
| resource "aws_s3_bucket" "secret_bucket" { | |
| bucket = "${random_string.bucket_name.result}-we45-training" | |
| server_side_encryption_configuration { | |
| "rule" { | |
| "apply_server_side_encryption_by_default" { | |
| kms_master_key_id = "${aws_kms_key.s3_key.arn}" | |
| sse_algorithm = "aws:kms" | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment