Data sources allow Terraform to use information defined outside of Terraform, defined by another separate Terraform configuration, or modified by functions. Data sources are like resources, but they don't create anything, just get some data you can refer to. A data source is accessed via a special kind of resource …
Read MoreTerraform Module Basics Terraform Modules are containers for multiple resources that are used together. A module consists of a collection of .tf and/or .tf.json files kept together in a directory. Modules are the main way to package and reuse resource configurations with Terraform. Root and Child Modules Every …
Read MoreTerraform offer output values make information about your infrastructure available on the command line, and can expose information for other Terraform configurations to use. About Output Values A child module can use outputs to expose a subset of its resource attributes to a parent module. A root module can use outputs …
Read MoreTerraform offers defining local values About Local Values A local value assigns a name to an expression, so you can use the name multiple times within a module instead of repeating the expression. If you're familiar with traditional programming languages, it can be useful to compare Terraform modules to function …
Read MoreAbout Input Variables Terraform offers input variables they are called "variables", but in fact these are parameters delivered to the current terraform module Variables are declared in a variable section, and they are parsed before other tf sections. Variables cannot reference other variables Variables allow default …
Read MoreAbout Terraform Resources Resources are the main thing we want to create with terraform, these are the components that make our infrastructure. Terraform intent is to create the resource idempotently, so that running apply more that once will not create multiple resources. body of resource contains configuration of …
Read MoreTerraform Basics Terraform Introduction Terraform Workflow Terraform init and Providers Terraform Configuration Terraform Resources input variables locals outputs data sources terraform modules
Read Moretf files After installation, you would start with a directory that has some file with a .tf extension. Convention says you should call the main configuration main.tf. but is you don't, terraform will load all files that ends with .tf Here's an example of the main configuration part, that should exist within one of you …
Read MoreTerraform Workflow There are 3 basic stages to the TF workflow: Write - Author infrastructure as code. Plan - Preview changes before applying. Apply - Provision reproducible infrastructure. Write -Write your terraform code ( HCL-Hashicorp Configuration Language ) using your favorite text editor. You can save those in a …
Read MoreWhere to learn from Terraform tutorials in Hashicorp site Since I focus on AWS, I enjoyed the aws tutorials About Terraform HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files. You can version, reuse, and share these file. …
Read More