resource
What is resource?
resource: A single piece of infrastructure Terraform creates and manages — a VM, a bucket, a DNS record. The verb of Terraform. A resource in Terraform is a single piece of infrastructure that Terraform creates and manages: a server, a database, a storage bucket, a DNS record, a firewall rule. Each resource block has a type, such as aws_s3_bucket, and a local name, such as logs. Together they form its address in Terraform, aws_s3_bucket.logs, which other resources can reference.
Frequently asked questions about resource
What should you keep in mind with resource?
Terraform tracks every resource in the state file and compares it with the configuration on each plan. Renaming a resource block makes Terraform think you want to delete one and create another; a moved block tells it the resource was only renamed. Keep resources focused and group related ones in modules, so a large configuration stays readable.
What does an example of resource look like?
resource "aws_s3_bucket" "logs" { bucket = "my-app-logs" } At a glance
| Category | Terraform |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |