diff --git a/iam.tf b/iam.tf index 72fe0dc..e8d20b3 100644 --- a/iam.tf +++ b/iam.tf @@ -104,13 +104,12 @@ data "aws_iam_policy_document" "vault_policy" { # 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 ] - + 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 ] + depends_on = [time_sleep.iam_delay] backup_vault_name = aws_backup_vault.daily.name policy = data.aws_iam_policy_document.vault_policy.json } @@ -141,7 +140,7 @@ data "aws_iam_policy_document" "backup_efs_policy" { } resource "aws_iam_policy" "efs_kms_backup_restore" { - name = var.backup_restore_policy_name + name = "${var.cluster_name}-${var.backup_restore_policy_name}" description = "Policy for EFS backup and restore with KMS encryption" path = var.iam_path