Skip to content

Instantly share code, notes, and snippets.

@garo
Created August 31, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garo/e216a9a9a8ee8b0271e2d946fa46f9a8 to your computer and use it in GitHub Desktop.
Save garo/e216a9a9a8ee8b0271e2d946fa46f9a8 to your computer and use it in GitHub Desktop.
variable "foo" {
default = ["1", "2", "3"]
}
variable "bar" {
default = ["a", "b", "c"]
}
resource "aws_sns_topic" "test" {
name = "${element(var.foo, count.index)}-${element(var.bar, count.index)}"
count = "${length(var.foo) * length(var.bar)}"
}
+ aws_sns_topic.test.0
arn: "<computed>"
name: "1-a"
policy: "<computed>"
+ aws_sns_topic.test.1
arn: "<computed>"
name: "2-b"
policy: "<computed>"
+ aws_sns_topic.test.2
arn: "<computed>"
name: "3-c"
policy: "<computed>"
+ aws_sns_topic.test.3
arn: "<computed>"
name: "1-a"
policy: "<computed>"
+ aws_sns_topic.test.4
arn: "<computed>"
name: "2-b"
policy: "<computed>"
+ aws_sns_topic.test.5
arn: "<computed>"
name: "3-c"
policy: "<computed>"
+ aws_sns_topic.test.6
arn: "<computed>"
name: "1-a"
policy: "<computed>"
+ aws_sns_topic.test.7
arn: "<computed>"
name: "2-b"
policy: "<computed>"
+ aws_sns_topic.test.8
arn: "<computed>"
name: "3-c"
policy: "<computed>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment