Skip to content

Instantly share code, notes, and snippets.

@jmvbxx
Created November 8, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmvbxx/34b8794e746cd20dc1dae1529943d834 to your computer and use it in GitHub Desktop.
Save jmvbxx/34b8794e746cd20dc1dae1529943d834 to your computer and use it in GitHub Desktop.
security group error
Error applying plan:
5 error(s) occurred:
* aws_instance.app2: 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
* aws_instance.consul: 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
* aws_instance.app4: 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
* aws_instance.load_balancer: 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
* aws_instance.db1: 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
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
@techierytesh
Copy link

techierytesh commented Jun 29, 2017

provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}

resource "aws_security_group" "intsg" {
name = "intsg"
description = "Allow all inbound traffic"

    tags {
      Name = "intsg"

}

ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}

ingress {
from_port = 20
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}

}

resource "aws_instance" "rint" {
ami = "ami-b374d5a5"
instance_type = "t2.micro"
key_name = "${var.aws_key_name}"
vpc_security_group_ids = ["${aws_security_group.intsg.id}"]
tags {
Name = "rint"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment