Terraform Tips for Resource Management
Last Updated:
Overview
This article provides information and approaches for managing the deployment strategy and resource allocation in Terraform. This is not something the Auth0 Terraform Provider can prescribe, as the structure and deployment of the Terraform configuration are workflow decisions.
Applies To
- Terraform
- Resource Management
- Deployment
Solution
Since the deployment strategy and resource allocation may vary significantly, consider one of the following approaches:
- Export or apply a single resource. Terraform allows users to target specific resources during planning or applying. For example, enter the following commands:
terraform plan -target=module.mymodule.aws_instance.myinstance terraform apply -target=module.mymodule.aws_instance.myinstance - Group resources into modules. Organizing related resources into Terraform modules may help to deploy only a subset of the configuration in smaller, more controlled pieces while maintaining a consistent overall state. For example, enter the following commands:
terraform apply -target=module.network terraform apply -target=module.database