attribute
What is attribute?
attribute: A name = value assignment inside a block. Also called an argument. In Terraform, an attribute is a name = value setting inside a block, such as instance_type = "t3.micro" inside a server resource. The configuration language also calls these arguments. Resources also expose attributes you did not set, which become known after creation. An IP address or an ID assigned by the cloud provider can be referenced elsewhere, as in aws_instance.web.public_ip.
Frequently asked questions about attribute
What should you keep in mind with attribute?
Referencing attributes this way is how Terraform knows the order to create things. If a DNS record uses the server's IP, Terraform creates the server first. Prefer these references over hardcoded values. They keep your configuration correct when resources are recreated, and they make dependencies visible to anyone reading the code.
What does an example of attribute look like?
instance_type = "t3.micro" At a glance
| Category | Terraform |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |