Terraform "Unsupported attribute" module output not declared in CI
An expression reads module.network.subnet_ids, but the network module declares no output "subnet_ids". Terraform reports an unsupported attribute because a module exposes only the outputs it explicitly declares.
What this error means
plan or validate stops with "Error: Unsupported attribute" and "This object does not have an attribute named \"X\"." on a module.<name>.<output> reference.
Error: Unsupported attribute
on main.tf line 20, in resource "aws_route_table_association" "a":
20: subnet_id = module.network.subnet_ids[0]
This object does not have an attribute named "subnet_ids".Common causes
The module does not declare that output
You read module.network.subnet_ids but the module has no matching output block, or the output was renamed.
A module version dropped or renamed an output
A module upgrade removed or renamed the output your code still references.
How to fix it
Declare the output in the module
- Open the module and check its
outputblocks. - Add an
outputfor the value you need, or fix the name you reference. - Re-run validate to confirm the attribute resolves.
output "subnet_ids" {
value = aws_subnet.this[*].id
}Match the reference to an existing output
Correct the caller to use an output name the module actually exposes after an upgrade.
How to prevent it
- Declare an
outputfor every module value callers consume. - Review module changelogs for renamed or removed outputs.
- Run
terraform validateafter module upgrades.