Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
cloudtrail: always use callee’s region
Browse files Browse the repository at this point in the history
  • Loading branch information
kerscher committed Nov 29, 2017
1 parent 2d1c6e4 commit 3c67c1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tf-modules/cloudtrail/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ resource "aws_cloudtrail" "cloudtrail" {

resource "aws_s3_bucket" "cloudtrail" {
bucket = "${var.name_prefix}-cloudtrail"
region = "${data.aws_region.current.name}"
acl = "private"
policy = "${data.aws_iam_policy_document.cloudtrail-bucket.json}"

tags = "${merge(map("Name", "${var.name_prefix}-cloudtrail"), "${var.extra_tags}")}"
}

data "aws_region" "current" {
current = true
}

data "aws_iam_policy_document" "cloudtrail-bucket" {
statement {
sid = "AWSCloudTrailAclCheck"
Expand Down

0 comments on commit 3c67c1f

Please sign in to comment.