Malik Adeel Imtiaz:
Dear Gurus,
I am facing below error, your kind support and guidance is needed to resolve it.
Ravichandran:
@Malik Adeel Imtiaz Could you please share the code snippet?
Cai Walkowiak:
The first error is undiagnosible as it is not in your code snippet above - resource aws_instance.ec2_public
But it looks like you either do not have a default VPC and/or are using a VPC name attribute which the instance resource cannot use with modern ec2 instances.
The second error for resource
aws_isntance.ec2_private
the cal you want for modern vpc environments is
``vpc_security_group_idsand should call
aws_security_group.example.id`
ex:
resource "aws_instance" "private" {
count = var.instance_private_count
instance_type = var.private_size
security_group_ids = [
aws_security_group.example.id,
]
}
Cai Walkowiak:
Both are likely to be solved by the
security_group_ids = [
aws_security_group.example.id,
]
}
change