Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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 = ["${}"]
# This would also work, but it's ugly
a_single_security_group = "${}"
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