From ad47a959dff248119dedde10ecdf9385aac62bd5 Mon Sep 17 00:00:00 2001 From: "Mark J. Reed" Date: Wed, 2 Sep 2020 15:07:38 -0400 Subject: [PATCH] Work around sequencing bug (#15) * Add explicit sequencing of all three resource creations * version bump --- main.tf | 4 ++++ readme.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 1f58342..661d62c 100644 --- a/main.tf +++ b/main.tf @@ -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 @@ -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 = <