I have the following configuration:
resource "aws_security_group""allow_ssh" {
name = "allow_ssh"
vpc_id = "${aws_default_vpc.default.id}"
description = "Allow ssh connections on port 22"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_instance""your-app" {
ami = "ami-2757f631"
instance_type = "t2.micro"
security_groups = ["${aws_security_group.allow_ssh.id}"]
key_name = "${aws_key_pair.twilio_key.key_name}"
}
When I do terraform apply
, I get this error:
* aws_instance.your-app: Error launching instance, possible mismatch of Security Group IDs and Names. See AWS Instance docs here: https://terraform.io/docs/providers/aws/r/instance.html.
AWS Error: Value () for parameter groupId is invalid. The value cannot be empty
What should I do to solve the above error ?