Last active
December 6, 2018 23:58
-
-
Save atz/9e2e60e3454921f3594d6dbc681bb4ba to your computer and use it in GitHub Desktop.
Terraform list-in/list-out operational
This file contains hidden or 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
module "example1" { | |
source = "./list" | |
} | |
module "example2" { | |
source = "./list" | |
values = ["this", "that", "other"] | |
} | |
module "example3" { | |
source = "./list" | |
values = ["${module.example2.many}"] | |
} | |
module "example4" { | |
source = "./list" | |
values = ["${module.example2.many}", "extra"] | |
} |
This file contains hidden or 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
output "many" { | |
value = ["${var.values}"] | |
} |
This file contains hidden or 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 "values" { | |
type = "list" | |
default = ["first", "second", "third"] | |
} |
This file contains hidden or 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
output "example1_vals" { | |
value = ["${module.example1.many}"] | |
} | |
output "example2_vals" { | |
value = ["${module.example2.many}"] | |
} | |
output "example3_vals" { | |
value = ["${module.example3.many}"] | |
} | |
output "example4_vals" { | |
value = ["${module.example4.many}"] | |
} |
This file contains hidden or 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
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. | |
Releasing state lock. This may take a few moments... | |
Outputs: | |
example1_vals = [ | |
first, | |
second, | |
third | |
] | |
example2_vals = [ | |
this, | |
that, | |
other | |
] | |
example3_vals = [ | |
this, | |
that, | |
other | |
] | |
example4_vals = [ | |
this, | |
that, | |
other, | |
extra | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To compensate for lack of subdirs in gists, after pulling: