Skip to content

Commit 0bd626c

Browse files
committed
fix tests
1 parent 08225b0 commit 0bd626c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ resource "aws_backup_plan" "main" {
105105
}
106106
}
107107

108+
depends_on = [aws_backup_vault.main]
109+
108110
tags = var.tags
109111
}
110112

tests/custom_rules.tftest.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ run "create_vault_with_custom_rules" {
4141
}
4242

4343
assert {
44-
condition = length(aws_backup_vault.main.kms_key_arn) >= 1
44+
condition = length(aws_backup_vault.main[0].kms_key_arn) >= 1
4545
error_message = "Expected Backup Plan to be encrypted by default AWS KMS key."
4646
}
4747

tests/predefined_rules.tftest.hcl

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ run "create_vault_with_predefined_rules" {
2121
}
2222

2323
assert {
24-
condition = length(aws_backup_vault.main.kms_key_arn) >= 1
24+
condition = length(aws_backup_vault.main[0].kms_key_arn) >= 1
2525
error_message = "Expected Backup Plan to be encrypted by default AWS KMS key."
2626
}
2727

@@ -46,7 +46,7 @@ run "create_vault_with_predefined_rules" {
4646
}
4747

4848
assert {
49-
condition = length(aws_backup_vault.main.tags) == 2
49+
condition = length(aws_backup_vault.main[0].tags) == 2
5050
error_message = "Expected Vault to have 2 tags."
5151
}
5252

0 commit comments

Comments
 (0)