devops4me / terraform-aws-security-group

This module refactors repetitive security group definitions and can compact 200 lines into 5.
MIT License
4 stars 5 forks source link

permission denied error when in_use_default is set to true. #1

Open devops4me opened 5 years ago

devops4me commented 5 years ago

When attempting to use the VPC's default security group errors occur (sporadically as opposed to always). These errors state that permission denied because it tries to first delete rules that are present and AWS does not appear to allow this for default security groups.

Terraform AWS Security Group | InvalidPermission.NotFound Error

Error applying plan

1 error(s) occurred:

jsitarski commented 5 years ago

I am seeing the same issue during an apply step:

Error: Error applying plan:

1 error(s) occurred:

* aws_default_security_group.default: 1 error(s) occurred:

* aws_default_security_group.default: Error revoking default egress rules for Default Security Group (sg-2e0f243b): InvalidPermission.NotFound: The specified rule does not exist in this security group.
    status code: 400, request id: 5c5525bc-9953-462b-98af-78a1d5590122

Terraform version info:

terraform --version
Terraform v0.11.10
+ provider.aws v1.50.0

.tf configuration:

resource "aws_default_security_group" "default" {
  vpc_id = "${aws_vpc.vpc.id}"

  tags = {
        Name = "ProjectNameHere - Default"
        Client = "CompanyName"
    }

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