From 75ae1b2cf8858ce9df31f6273df253a0bfe99028 Mon Sep 17 00:00:00 2001 From: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:25:26 -0400 Subject: [PATCH] fixing dependes on (#14) * fixing dependes on * Apply suggestions from code review Co-authored-by: Charles Bushong --------- Co-authored-by: Charles Bushong --- iam.tf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/iam.tf b/iam.tf index d84f38d..72fe0dc 100644 --- a/iam.tf +++ b/iam.tf @@ -99,7 +99,18 @@ data "aws_iam_policy_document" "vault_policy" { } } +# Adding this because a bug in the provider is causing implicit dependencies to not be enough +# Explict dependencies also don't work +# See https://github.com/hashicorp/terraform-provider-aws/issues/33173 +# Once this bug if fixed we can delete both this resource block along with the depends_on on the vault policy below +resource "time_sleep" "iam_delay" { + depends_on = [ aws_iam_role.efs_backup_restore_role ] + + create_duration = "20s" +} + resource "aws_backup_vault_policy" "efs_backup_vault" { + depends_on = [ time_sleep.iam_delay ] backup_vault_name = aws_backup_vault.daily.name policy = data.aws_iam_policy_document.vault_policy.json }