Use configuration to import existing infrastructure into Terraform. Review important considerations when bringing infrastructure under Terraform management.
Migrate state to Terraform Cloud
Migrate a state file to Terraform Cloud for secure storage and easy collaboration.
Manage resources in Terraform state
Create an EC2 instance and security group, and move a resource to another state file. Remove, replace, and re-import resources to manage state and reconcile drift in your infrastructure.
Apply changes to an AWS S3 bucket and bucket objects using resource targeting. Target individual resources, modules, and collections of resources to change or destroy. Explore how Terraform handles upstream and downstream dependencies.
Interpret and fix a Terraform configuration with common configuration language errors and deploy an EC2 instance with security groups in AWS. Learn best practices for logging application errors and reporting bugs.
Manage resource drift
Create an AWS instance and security group. Manually change the instance to create drift in your Terraform state file. Reconcile your state drift and import your resources while avoiding downtime.
Manage resource lifecycle
Create an AWS instance and security group. Update your configuration with lifecycle management blocks to prevent resource deletion, create resources before destroying them, and ignore changes to specific resource attributes.
Version remote state with the Terraform Cloud API
Deploy an EC2 instance to a Terraform Cloud workspace and use the Terraform API to interact with and update state.
Use refresh-only mode to sync Terraform state
Use refresh-only plans and applies to update Terraform state to match real-world infrastructure. Understand the implicit refresh behavior in Terraform plan and apply operations.
Develop configuration with the console
Use the Terraform console to inspect resources and evaluate Terraform expressions before using them in configurations. Configure an S3 bucket with an IAM role to restrict access by IP address.
Use configuration to move resources
Use the configuration-driven workflow to change Terraform resource IDs. Refactor configuration to move resources into modules using the `moved` block.