# Terraform: Error: Unsupported attribute — This object has no argument, nested block, or exported attribute named "foo"

**Code:** `Unsupported attribute: This object does not have an attribute named` · **Category:** Terraform · **Seen on:** Terraform

An expression references an attribute that the resource/data source/module output doesn't expose.

## Meaning

Check the provider docs' "Attributes Reference", the module's declared `output` blocks, and the resource type. After provider upgrades attributes can be renamed/removed (e.g. `aws_eip.x.public_ip` ok vs `.address`). For count/for_each resources use indexes: `aws_instance.web[0].id` or `[*]`.

## Common causes

- Attribute doesn't exist for that resource
- Module output not declared
- Reference lacks index for count/for_each resources
- Provider version changed attributes
- Typo

## Quick fix

1. Check the "Attribute Reference" in docs
2. Add `output "name"` in the module
3. Use `resource[0].attr` or `resource[*].attr` for count

## Detailed fix by platform

### Terraform

1. `terraform console` → `aws_instance.web` to inspect available attributes

## How to diagnose

1. **Attribute** — Documented?
2. **Index** — count/for_each?
3. **Module** — Output declared?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/unsupported-attribute-object-has-no-attribute)
