Define Infrastructure with Terraform Resources
Create an EC2 instance, then use the Terraform Registry to create a security group to make it publicly accessible. Learn how Terraform resources define infrastructure as code through arguments, attributes, and dependencies.
Customize Terraform Configuration with Variables
Customize infrastructure for a web application with Terraform. In this tutorial, you will use Terraform input variables, including lists, maps, strings, and booleans, to make the configuration for your infrastructure more flexible.
Protect Sensitive Input Variables
Protect sensitive values from accidental exposure using Terraform sensitive input variables. Provision a web application with Terraform, and mark input variables as sensitive to restrict when Terraform prints them out to the console.
Simplify Terraform Configuration with Locals
Customize infrastructure for a web application with Terraform. In this tutorial, you will use Terraform local values to simplify and improve the consistency of your configuration.
Output Data from Terraform
Output data about infrastructure with Terraform outputs. Provision a web application with Terraform, and use output values to export data about your application's infrastructure. Hide sensitive output values.
Query Data Sources
Provision a web application with Terraform, and use data sources to configure it to support multiple AWS regions and availability zones. Use a remote state data source to share data between Terraform projects and to configure EC2 instances with the appropriate AMI for the current region.
Create Resource Dependencies
Create an implicit dependency between an EC2 instance and its Elastic IP using variable interpolation. Create explicit dependencies on an S3 Bucket and SQS Queue using terraform configuration. Learn how Terraform creates independent resources in parallel.
Manage Similar Resources with Count
Manage similar Terraform resources using the count argument. Create a VPC with a load balancer and EC2 instances. Then use count to manage a configurable number of similar AWS EC2 instances across multiple subnets.
Manage Similar Resources with For Each
Provision similar infrastructure components by iterating over a data structure with the for_each argument. Duplicate an entire VPC including a load balancer and multiple EC2 instances for each project defined in a map.
Perform Dynamic Operations with Functions
Create Terraform resources with built-in reusable functions. Deploy reusable configurations with the templatefile function for provisioning resources using files with Terraform interpolation. Use the lookup function to pass a map output to a variable and the concat function to concatenate and output lists to your configuration.
Create Dynamic Expressions
Make your Terraform configurations more dynamic and reusable with expressions. Create an ELB deployment with locals to assign expressions to variables for reuse, conditionals to declare if/then scenarios, and the splat expression to return attributes from complex value types.