Skip to content

Instantly share code, notes, and snippets.

@garo
Created September 7, 2016 05:45
Show Gist options
  • Save garo/f9511287e73ec625312d3c6a05db4a10 to your computer and use it in GitHub Desktop.
Save garo/f9511287e73ec625312d3c6a05db4a10 to your computer and use it in GitHub Desktop.
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}"
}
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