Skip to content

Instantly share code, notes, and snippets.

@devops-school
devops-school / terraform-map-variable.tf
Last active June 9, 2023 22:35
Terraform variable Map Type Explained
Example 1
===============================
Maps are a way to create variables that are lookup tables. An example will show this best. Let's extract our AMIs into a map and add support for the us-west-2 region as well:
variable "amis" {
type = "map"
default = {
"us-east-1" = "ami-b374d5a5"
"us-west-2" = "ami-4b32be2b"
}