Skip to content

Commit

Permalink
block public access to cloudtrail bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
smelchior committed Jan 3, 2019
1 parent c8dcdff commit 2b8f9a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BACKWARDS INCOMPATIBILITIES / NOTES:
* n.a.

IMPROVEMENTS:
* n.a.
* Add Public Access Block for Cloudtrail S3 Bucket

BUG FIXES:
* n.a.
Expand Down
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
provider "aws" {
region = "${var.aws_region}"
version = "~> 1.6"
version = "~> 1.54"
}
9 changes: 9 additions & 0 deletions s3_cloudtrail.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ resource "aws_s3_bucket" "cloudtrail_bucket" {
}
EOF
}

resource "aws_s3_bucket_public_access_block" "cloudtrail_bucket" {
bucket = "${aws_s3_bucket.cloudtrail_bucket.id}"
count = "${var.trail_bucketname_create}"
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}

0 comments on commit 2b8f9a1

Please sign in to comment.