Created
September 9, 2016 04:07
-
-
Save JohnnyNiu/fa54692803c9478277642a38fac0b01b to your computer and use it in GitHub Desktop.
terraform iterate a list to create resource
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
variable "foo" { | |
default = ["1", "2", "3"] | |
} | |
resource "aws_sns_topic" "test" { | |
name = "${element(var.foo, count.index)}" | |
count = "${length(var.foo) }" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment