instance = Instance(self, "compute",
ami=ami.id,
instance_type=instance_type,
security_groups = security_groups,
#TODO: Find a better way to query subnet
subnet_id = Fn.element(Token.as_list(subnets.ids), 0)
)
TypeError: type of argument security_groups must be one of (Sequence[str], NoneType); got imports.aws.data_aws_security_groups.DataAwsSecurityGroups instead
The security_groups property accepts a list of names of security groups (AWS Terraform provider docs) and the DataAwsSecurityGroups data source (docs) only has a list of ids (security_groups.ids) which you could try passing to that property but might not work – I’m not that experienced with AWS.