I am using data source to filter security groups based on Tags and assign subnet_id based on the datasource output, Whenever I am trying to execute the config it gives me an error string required.
data "aws_security_group" "db" {
filter {
name = "tag:Name"
values = ["*app*"]
}
vpc_security_group_ids = data.aws_security_group.db.id
Error: Incorrect attribute value type
on Instance.tf line 12, in resource “aws_instance” “web”:
12: vpc_security_group_ids = data.aws_security_group.db.id
|----------------
| data.aws_security_group.db.id is “sg-007a1c68c73512fa8”Inappropriate value for attribute “vpc_security_group_ids”: set of string
required.