Terraform: providers/aws: Issue creating security group.

Created on 6 May 2015  ยท  3Comments  ยท  Source: hashicorp/terraform

resource "aws_security_group" "common_sg" {
    name = "common_rules"
    description = "Common rules used across all machines."
    vpc_id = "${aws_vpc.main.id}"

    egress {
        from_port = 0
        to_port = 0
        protocol = "-1"
        cidr_blocks = ["0.0.0.0/0"]
    }

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

    ingress {
        protocol = "-1"
        from_port = 0
        to_port = 65335
        cidr_blocks = ["10.0.0.0/24", "10.0.1.0/24"]
    }

    ingress {
        protocol = "icmp"
        from_port = -1
        to_port = -1
        cidr_blocks = ["0.0.0.0/0"]
    }
}

returns:

aws_main_route_table_association.vpc-main-route-table: Refreshing state... (ID: rtbassoc-50a55634)
aws_route_table_association.network_b: Refreshing state... (ID: rtbassoc-56a55632)
aws_route_table_association.network_a: Refreshing state... (ID: rtbassoc-57a55633)
aws_security_group.common_sg: Modifying...
  ingress.#:                            "2" => "3"
  ingress.1799340084.cidr_blocks.#:     "1" => "1"
  ingress.1799340084.cidr_blocks.0:     "0.0.0.0/0" => "0.0.0.0/0"
  ingress.1799340084.from_port:         "-1" => "-1"
  ingress.1799340084.protocol:          "icmp" => "icmp"
  ingress.1799340084.security_groups.#: "0" => "0"
  ingress.1799340084.self:              "0" => "0"
  ingress.1799340084.to_port:           "-1" => "-1"
  ingress.2541437006.cidr_blocks.#:     "1" => "1"
  ingress.2541437006.cidr_blocks.0:     "0.0.0.0/0" => "0.0.0.0/0"
  ingress.2541437006.from_port:         "22" => "22"
  ingress.2541437006.protocol:          "tcp" => "tcp"
  ingress.2541437006.security_groups.#: "0" => "0"
  ingress.2541437006.self:              "0" => "0"
  ingress.2541437006.to_port:           "22" => "22"
  ingress.3686738667.cidr_blocks.#:     "0" => "2"
  ingress.3686738667.cidr_blocks.0:     "" => "10.0.0.0/24"
  ingress.3686738667.cidr_blocks.1:     "" => "10.0.0.0/24"
  ingress.3686738667.from_port:         "" => "0"
  ingress.3686738667.protocol:          "" => "-1"
  ingress.3686738667.security_groups.#: "0" => "0"
  ingress.3686738667.self:              "" => "0"
  ingress.3686738667.to_port:           "" => "65335"
aws_security_group.common_sg: Error: 1 error(s) occurred:

* Error authorizing security group ingress rules: InvalidParameterValue: The same permission must not appear multiple times
Error applying plan:

1 error(s) occurred:

* 1 error(s) occurred:

* 1 error(s) occurred:

* Error authorizing security group ingress rules: InvalidParameterValue: The same permission must not appear multiple times

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.

what am I doing wrong here?

Most helpful comment

What was the issue?

All 3 comments

Nevermind, it was my bad.

What was the issue?

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings