Skip to content

Commit

Permalink
Add S3 bucket encryptation
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman authored and iknite committed Feb 19, 2019
1 parent 019bf72 commit 13993a1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deploy/aws/pre-build/bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ provider "aws" {
profile = "${var.aws_profile}"
}

resource "aws_kms_key" "bucket-key" {
description = "This key is used to encrypt bucket objects"
deletion_window_in_days = 10
}
resource "aws_s3_bucket" "terraform-qed-cluster" {
bucket = "terraform-qed-cluster"

Expand All @@ -18,7 +22,15 @@ resource "aws_s3_bucket" "terraform-qed-cluster" {
lifecycle {
prevent_destroy = true
}


server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = "${aws_kms_key.bucket-key.arn}"
sse_algorithm = "aws:kms"
}
}
}
tags {
Name = "S3 Remote Terraform State Store"
}
Expand Down

0 comments on commit 13993a1

Please sign in to comment.