Consider a Terraform resource with the meta-argument count = 3. What is the effect of this meta-argument on the resource behavior?
Think about how repeating a resource multiple times works in Terraform.
The count meta-argument tells Terraform to create multiple separate instances of the resource, each with the same configuration. So, count = 3 means three identical resources are created.
In Terraform, the depends_on meta-argument is used in a resource block. What behavior does it control?
Think about how Terraform manages the order of resource creation.
The depends_on meta-argument explicitly tells Terraform to wait until the listed resources are created before creating this resource, ensuring correct order.
Given a Terraform resource with the following snippet:
lifecycle {
prevent_destroy = true
}What behavior does this enforce when you try to destroy the resource?
Consider what 'prevent_destroy' means literally.
Setting prevent_destroy = true in the lifecycle meta-argument stops Terraform from destroying the resource. If a destroy is attempted, Terraform raises an error to protect the resource.
In Terraform, if a resource has:
lifecycle {
ignore_changes = ["tags"]
}What happens when the tags are changed outside Terraform?
Think about what 'ignore_changes' means for specific attributes.
The ignore_changes lifecycle argument tells Terraform to skip updating specified attributes, even if they differ from the configuration. This is useful for attributes changed outside Terraform.
When using the count meta-argument on resources that have complex dependencies, what is a common issue that can arise?
Think about how Terraform handles multiple instances and dependencies.
Using count with complex dependencies can make it hard for Terraform to determine the correct order of resource creation, causing errors or unexpected behavior.