count vs for_each
https://spacelift.io/blog/terraform-count-for-each
Exploring Ephemerality in Terraform 1.10 and Beyond
https://developer.hashicorp.com/terraform/intro/terraform-editions
https://thomasthornton.cloud/2024/04/25/using-terraform-tfvars-for-environment-agnostic-deployments/
New ways to simplify HashiCorp Terraform workflows with AI-powered insights from Anthropic.
1️⃣ Automate commands to ensure your Terraform configurations are reliable before deploying.
2️⃣ For HCP #Terraform customers, the Plan Analyzer helps you review plan files, even when working with public modules or unfamiliar code.
Make your infrastructure more efficient and secure. Start exploring these tools today: https://bit.ly/4iyitAn
https://youtu.be/hBmcwtVQkPM?si=Rd8q4cEucr-bnIkM
https://gist.github.com/burimali/fdc782235b5ec81625ced7ff7bd1c87d
on:
push:
branches:
- main
jobs:
terraform:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Terraform Init
run: terraform init
- name: Terraform Plan
run: terraform plan
- name: Terraform Apply
run: terraform apply
Terraform supports several data types that can be used in configuration files and expressions. Here are some of the most common data types in Terraform:
String: A sequence of characters. Strings are enclosed in double quotes (“) or single quotes (') in Terraform configuration files. Examples: “hello world”, 'my string'.
Number: A numeric value. Numbers can be integers or floating-point values. Examples: 42, 3.14159.
Boolean: A value that represents true or false. Boolean values are represented by the keywords true and false in Terraform configuration files.
List: A collection of items of any data type. Lists are defined using the list function and enclosed in square brackets []. Examples: [1, 2, 3], [“item1”, “item2”].
Map: A collection of key-value pairs of any data type. Maps are defined using the map function and enclosed in curly braces {}. Examples: { “name” = “John”, “age” = 30 }, { “key1” = “value1”, “key2” = “value2” }
Tuple: A collection of fixed number of items of different data types. Tuples are defined with parentheses () and comma separated values. Examples: (“firstname”, “lastname”), (1, “string”)
Set: A collection of unique items of any data type. Sets are defined using the set function and enclosed in curly braces {}.
Object: Terraform does not have a specific object type, but you can use a map to represent an object, where the keys are the object's properties and the values are the property's values.
Null: A special value that represents the absence of a value. It can be used to indicate that a variable or an output has no value.
Any: Terraform also has an “any” type, which can be used to represent any type of value. This is useful when you want to pass a value to a function or a resource that can accept multiple types of input.
Terraform also has a number of built-in functions that can be used to manipulate and process data, such as length, lookup, concat, flatten, zipmap, setproduct, distinct, sort, reverse, slice, chunklist among others. These functions allow you to perform operations on data, such as counting the number of items in a list, looking up a specific item in a list, or joining two lists together.
https://blog.zittatech.com/google-cloud-platform/bootstrapping-gcp-project-with-terraform/
https://www.techgeeknext.com/cloud/terraform-gcp-github-example
https://cobalt.io/blog/iac-pipelines-with-terraform-and-cloud-build
https://learn.hashicorp.com/tutorials/terraform/github-actions
https://discuss.hashicorp.com/t/how-to-authenticate-to-gcp-when-using-terraform-cloud/17489/10
https://learn.hashicorp.com/tutorials/terraform/tfe-provider-run-triggers?in=terraform/cloud
https://acloudguru.com/blog/engineering/how-to-use-github-actions-to-automate-terraform
https://www.terraform.io/intro/index.html
https://elatov.github.io/2018/07/use-terraform-to-deploy-a-vm-in-esxi/#installing-terraform
https://elatov.github.io/2018/07/use-terraform-to-deploy-a-vm-in-esxi/
https://blog.inkubate.io/create-a-ubuntu-18-04-terraform-template-for-vmware-vsphere/
Terraform is declarative.
Ansible is a mix of declarative and procedural, depending on the modules.
running terraform
terraform init terraform plan terraform apply