Created
January 3, 2020 21:01
-
-
Save rafaeljesus/56e744aee20aae32969d31e0a3cedfea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables.tf | |
variable "env" { | |
description = "env: stg or prod" | |
} | |
variable "image_name" { | |
type = "map" | |
description = "Image for container." | |
default = { | |
dev = "occollector:latest" | |
prod = "occollector:ubuntu" | |
} | |
} | |
# main.tf | |
resource "docker_image" "image_id" { | |
name = lookup(var.image_name, var.env) | |
} | |
# run it! | |
# terraform plan -out=tfstg_plan -var env=stg | |
# terraform plan -out=tfprod_plan -var env=prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment