Я пытаюсь получить группы безопасности, связанные с экземпляром с идентификатором "i-0abcdefgh1234", но вывод не дает результата.
terraform.tf
data "aws_instance" "ec2" {
instance_id = "i-0abcdefgh1234"
filter {
name = "tag:Name"
values = ["name-of-the-server"]
}
}
output "sg" {
value = "${data.aws_instance.ec2.*.security_groups}"
}
Вывод
data.aws_instance.ec2: Refreshing state...
------------------------------------------------------------------------
No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
Пробовал с и без * ниже
value = "${data.aws_instance.ec2.*.security_groups}"