Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS VPC Security Group loses all ingresses #740

Closed
mahnve opened this issue Jan 5, 2015 · 9 comments · Fixed by #997
Closed

AWS VPC Security Group loses all ingresses #740

mahnve opened this issue Jan 5, 2015 · 9 comments · Fixed by #997

Comments

@mahnve
Copy link

mahnve commented Jan 5, 2015

We have a few security groups that always lose all ingress information when running apply

Definition:

resource "aws_security_group" "internal_web" {
  name="internal-web-sg"
  description="internally open to http and https"
  vpc_id="${aws_vpc.dryleaf.id}"

  ingress {
    from_port=80
    to_port=80
    protocol="tcp"
    cidr_block=["10.20.0.0/16"]
  }

  tags {
    app="dryleaf"
    Name="dryleaf-internal-web-sg"
  }
}

state:

"aws_security_group.internal_web": {
                    "type": "aws_security_group",
                    "depends_on": [
                        "aws_vpc.dryleaf"
                    ],
                    "primary": {
                        "id": "<id>",
                        "attributes": {
                            "description": "internally open to http and https",
                            "id": "<id>",
                            "ingress.#": "0",
                            "name": "internal-web-sg",
                            "owner_id": "<id>",
                            "tags.Name": "dryleaf-internal-web-sg",
                            "tags.app": "dryleaf",
                            "vpc_id": "<id>"
                        }
                    }
                },

Running apply outputs the following;

~ aws_security_group.internal_web
    ingress.#:                   "0" => "1"
    ingress.0.cidr_blocks.#:     "0" => "0"
    ingress.0.from_port:         "" => "80"
    ingress.0.protocol:          "" => "tcp"
    ingress.0.security_groups.#: "0" => "0"
    ingress.0.self:              "" => "0"
    ingress.0.to_port:           "" => "80"

However, after running apply, the security group has no ingresses and the state file remains the same.

@pmoust
Copy link
Contributor

pmoust commented Jan 5, 2015

Try v0.3.6? (or master if you are up to it)

@mahnve
Copy link
Author

mahnve commented Jan 5, 2015

Thanks - how would I get 0.3.6? I can't see such a tag in the repo.

@pmoust
Copy link
Contributor

pmoust commented Jan 5, 2015

Hm, you are right, I thought the guys had released it.
Try building upstream/master I guess.

@mahnve
Copy link
Author

mahnve commented Jan 5, 2015

Cool, thanks for the help.

@mitchellh
Copy link
Contributor

Ouch! This sounds not good. Tagged to take a look.

@mitchellh
Copy link
Contributor

Reproduced as of master right now.

@mitchellh
Copy link
Contributor

Hah, cidr_block should be cidr_blocks. I'm going to keep this bug open so that we can validate better.

@mahnve
Copy link
Author

mahnve commented Mar 2, 2015

Awesome, thanks.

@ghost
Copy link

ghost commented May 4, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants