Terraform Modules, Workspaces, Variables, and Git Repo Structure.
7min
Modules overview
Read about how Terraform modules make configuration easier to organize, understand, reuse, and share. Learn about the directory structure of a module, and how to call them.
12min
Use registry modules in configuration
Use modules from the public Terraform Registry to define an Amazon VPC containing two EC2 instances. Select module and root input and output variables, install the modules, and apply the configuration.
15min
Build and use a local module
Write a local module to create an Amazon S3 bucket hosting a static website. Create a module directory, write the module configuration, variables, and outputs, and call the module from a root configuration.
7min
Share modules in the private registry
Import modules to share securely in Terraform Cloud's free private registry. Fork an example module, tag a version-controlled release, deploy the module into the registry, and use it in a configuration.
5min
Add public providers and modules to your private registry
Curate modules and providers in your private registry. Track approved modules and providers for your organization's use.
18min
Refactor monolithic Terraform configuration
Deploy development and production versions of an S3-hosted static website. Separate their configuration into files, directories, and workspaces, and explore the architectural trade-offs of each approach.
17min
Module creation - recommended pattern
Learn the architectural recommendations for module creation distilled from engagements with large enterprises using Terraform. Use Terraform module best practices to scope, build, improve and consume Terraform modules.
1min
Manage infrastructure collections with Workspaces
Working with Terraform involves managing collections of infrastructure resources, and most organizations manage many different collections.
18min
Import Terraform configuration
Use configuration to import existing infrastructure into Terraform. Review important considerations when bringing infrastructure under Terraform management.
9min
Migrate state to Terraform Cloud
Migrate a state file to Terraform Cloud for secure storage and easy collaboration.
19min
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.
20min
Target resources
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.
15min
Troubleshoot Terraform
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.
12min
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.
8min
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.
13min
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.
10min
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.
1min
Terraform runs and remote operations
If you're accustomed to running Terraform from your workstation, the way Terraform Cloud manages runs can be unfamiliar.