-
Notifications
You must be signed in to change notification settings - Fork 0
/
tc5_dc2_ta4.tftest.hcl
28 lines (23 loc) · 1014 Bytes
/
tc5_dc2_ta4.tftest.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Excluded tests after measuring since the hardcoded account ID would fail in other environments
variables {
db_pwd = "password"
ownerId = "140191150128"
}
provider "aws" {
// Due to an observed limitation when testing via the Docker image hashicorp/terraform:1.6.2,
// variables defined in the "variables" block cannot be read in the "provider" block.
// As the reason for this behavior is not yet understood, the "region" attribute is hard-coded
// in the "provider" block for compatibility.
// Note: This limitation does not apply when testing in a devcontainer using the same Terraform version.
region = "eu-west-3"
}
run "confirm_deployment_credentials" {
command = plan
module {
source = "./tests/data_static"
}
assert {
condition = data.aws_caller_identity.current.account_id == var.ownerId
error_message = "Test deployments should be facilitated with account ID: ${var.ownerId}, but configured account ID is: ${data.aws_caller_identity.current.account_id}"
}
}