Skip to content

Commit

Permalink
Work around sequencing bug (#15)
Browse files Browse the repository at this point in the history
* Add explicit sequencing of all three resource creations

* version bump
  • Loading branch information
mjreed-wbd authored Sep 2, 2020
1 parent dc9a663 commit ad47a95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ resource "aws_s3_bucket" "bucket" {
resource "aws_s3_bucket_public_access_block" "bucket" {
count = var.block_public_access ? 1 : 0

depends_on = [aws_s3_bucket_policy.bucket_policy]

bucket = aws_s3_bucket.bucket.id
block_public_acls = true
block_public_policy = true
Expand All @@ -97,6 +99,8 @@ data "aws_iam_role" "additional_roles" {

# grant the role access to the bucket
resource "aws_s3_bucket_policy" "bucket_policy" {

depends_on = [aws_s3_bucket.bucket]
bucket = aws_s3_bucket.bucket.id

policy = <<EOF
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ provider "aws" {
}
module "tf_remote_state" {
source = "github.com/turnerlabs/terraform-remote-state?ref=v4.0.1"
source = "github.com/turnerlabs/terraform-remote-state?ref=v4.0.2"
role = "aws-ent-prod-devops"
application = "my-test-app"
Expand Down

0 comments on commit ad47a95

Please sign in to comment.