In Terraform, resources are fundamental. What is their main purpose?
Think about what Terraform needs to know to build your cloud setup.
Resources in Terraform describe the actual infrastructure elements like servers, databases, or networks that Terraform will create or manage.
Terraform tracks infrastructure changes using resources. How does this process work?
Consider how Terraform knows what to add, change, or remove.
Terraform uses resource definitions to compare desired state with actual state, enabling it to plan and apply changes accurately.
When you remove a resource block from your Terraform code and apply changes, what is the expected behavior?
Think about how Terraform aligns real infrastructure with your code.
Removing a resource block signals Terraform to destroy that resource in the real infrastructure to keep the state consistent.
Terraform resources can include sensitive information like passwords or keys. What is a key reason to handle this data carefully?
Consider where Terraform keeps information about resources after applying changes.
Terraform stores resource attributes, including sensitive data, in state files which can be read if not secured, so careful management is essential.
To keep Terraform configurations clean and reusable, what is the best practice regarding resource organization?
Think about how to share and reuse infrastructure code efficiently.
Modules allow grouping resources logically and using parameters, making Terraform code modular, reusable, and easier to maintain.