Skip to content

Instantly share code, notes, and snippets.

@ImIOImI
Last active March 30, 2020 22:20
Show Gist options
  • Save ImIOImI/1aa9e758d671ee7aa7a99988b5d72c03 to your computer and use it in GitHub Desktop.
Save ImIOImI/1aa9e758d671ee7aa7a99988b5d72c03 to your computer and use it in GitHub Desktop.
Simple Terraform 12 Map Example
####Simple Map example####
output "out" {
value = var.project-map[var.environment]
}
variable "environment" {
default = "stage"
}
variable "project-map" {
type = map(string)
description = "Simple example of how to make a string map variable in Terraform 12"
default = {
dev = "dev.example.com"
stage = "stage.example.com"
prod = "prod.example.com"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment