Skip to content

Commit

Permalink
feat(aws): added CloudTrail bucket server-side encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Nix committed Jul 28, 2020
1 parent 38b57ac commit cbb76b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aws/modules/cloudtrail/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ resource "aws_s3_bucket" "cloudtrail_bucket" {
bucket = local.bucket_name
force_destroy = var.bucket_force_destroy
policy = data.aws_iam_policy_document.cloudtrail_s3_policy.json

server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = var.bucket_sse_algorithm
}
}
}
}

# we need the identity of the caller to get their account_id for the s3 bucket
Expand Down
6 changes: 6 additions & 0 deletions aws/modules/cloudtrail/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ variable "bucket_force_destroy" {
default = false
}

variable "bucket_sse_algorithm" {
type = string
default = "AES256"
description = "The encryption algorithm to use for S3 bucket server-side encryption"
}

variable "sns_topic_name" {
type = string
default = ""
Expand Down

0 comments on commit cbb76b4

Please sign in to comment.