Error 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

0 votes

Hi Guys,

I am trying to launch an EC2 instance using terraform, but it is showing me the below error.

Error: 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: InvalidParameterValue: Value () for parameter groupId is invalid. The value cannot be empty
        status code: 400, request id: de662e5a-4b53-4f83-a1dd-ab476b88061b
  on ec2.tf line 6, in resource "aws_instance" "myin2":
   6: resource "aws_instance" "myin2" {

How can I solve this error?

Jun 11, 2020 in Terraform by akhtar
• 38,260 points
4,473 views

1 answer to this question.

0 votes

Hi@akhtar,

According to your error, you didn't specify your security group properly. AWS is not able to match your security group with their database. So check your security group and use it in your terraform code properly.

answered Jun 11, 2020 by MD
• 95,460 points

Related Questions In Terraform

+2 votes
1 answer

can we start and stop EC2 instance using Terraform?

Hi@Lakshminarayanan, You can use command inside your local-exec ...READ MORE

answered Aug 17, 2020 in Terraform by MD
• 95,460 points
7,656 views
0 votes
1 answer

How to read the volume ID of the EC2 instance using Terraform?

Hi@akhtar, You won't be able to extract EBS ...READ MORE

answered Dec 4, 2020 in Terraform by MD
• 95,460 points
2,299 views
0 votes
1 answer

How to attach an EBS volume to EC2 instance using terraform?

Hi@akhtar, You can use aws_volume_attachment resource to attach ...READ MORE

answered Jun 12, 2020 in Terraform by MD
• 95,460 points
8,865 views
0 votes
1 answer

'terraform' is not recognized as an internal or external command, operable program or batch file.

Hi@akhtar, You have to set an environment variable ...READ MORE

answered Jun 10, 2020 in Terraform by MD
• 95,460 points
29,080 views
0 votes
1 answer

How to create one key in AWS using terraform?

Hi@akhtar, You can use aws_key_pair resource n terraform. ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,460 points
1,557 views
0 votes
1 answer

Why should I choose GCP over any other cloud platforms?

There are various Cloud service providers in ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,230 points
2,221 views
0 votes
1 answer

How do I create a Virtual Machine on GCP?

To create a VM instance: It is important you ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,230 points
1,266 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,460 points
2,665 views
0 votes
1 answer

How to manage AWS multiple regions and availability zones using terraform?

Hi, When you run your Terraform code it ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,460 points
6,655 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP