Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 1
A workspace's configuration contains:
resource "aws_instance" "web" { count = 10 }
data "aws_ami" "base" { ... }
data "aws_vpc" "main" { ... }
module "logs" {
source = "./logs"
# inside: one aws_s3_bucket, and aws_s3_bucket_policy with
# for_each over three keys
}
After a successful apply, how many managed resources does this workspace
add to the organization's usage count?
A14: the ten instances plus the four resources in the module
B4, one per resource block
C16, with the two data sources counted as well
D11, with the module's resources counted once per module call
Show the answer and why
A14: the ten instances plus the four resources in the module
Correct
Every managed resource instance counts, including those in modules and those created by count or for_each; data sources do not.
B4, one per resource block
Incorrect
Each instance created by count or for_each is counted separately.
C16, with the two data sources counted as well
Incorrect
Resources whose mode is data are excluded from the managed resource count.
D11, with the module's resources counted once per module call
Incorrect
Resources in modules count like any other managed resource instance.
HCP Terraform reads state and counts every instance whose mode is managed, so count and for_each multiply the count while data sources add nothing.