Hi, can someone help me to fix the error ?
│ Error: Unsupported attribute
│
│ on proccess_runner.tf line 106, in resource "aws_volume_attachment" "this":
│ 106: instance_id = element(module.ec2_instance.*.id, count.index)
│
│ This object does not have an attribute named "id".
module "ec2_instance" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 3.0"
name = local.server_name
for_each = data.aws_subnet_ids.private_subnets.ids
subnet_id = each.value
ami = data.aws_ami.amazon_linux.id
instance_type = local.ec2_instance_type
}
resource "aws_ebs_volume" "this" {
count = length(local.azs)
availability_zone = element(local.azs, count.index)
size = local.ebs_size
}
resource "aws_volume_attachment" "this" {
count = length(local.azs)
volume_id = element(aws_ebs_volume.this.*.id, count.index)
instance_id = element(module.ec2_instance.*.id, count.index)
}