Created
September 7, 2016 05:45
-
-
Save garo/f9511287e73ec625312d3c6a05db4a10 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
module "test" { | |
source "./mymodule" | |
# This seems to work | |
security_groups_as_a_list = ["12341234"] | |
# But this produces an error: aws_instance.vm: security_groups: should be a list | |
security_groups_as_a_list = ["${aws_security_group.terminal.id}"] | |
# This would also work, but it's ugly | |
a_single_security_group = "${aws_security_group.terminal.id}" | |
} |
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 "security_groups_as_a_list" { | |
type = "list" | |
} | |
variable "a_single_security_group" {} | |
resource "aws_instance" "vm" { | |
security_groups = "${var.security_groups_as_a_list}" | |
# This would also work | |
security_groups = ["${var.a_single_security_group}"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment