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

Error revoking security group ingress rules: InvalidPermission.NotFound #2879

Closed
hashibot opened this issue Jan 5, 2018 · 3 comments · Fixed by #4416
Closed

Error revoking security group ingress rules: InvalidPermission.NotFound #2879

hashibot opened this issue Jan 5, 2018 · 3 comments · Fixed by #4416
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@hashibot
Copy link

hashibot commented Jan 5, 2018

This issue was originally opened by @djgrubson as hashicorp/terraform#17042. It was migrated here as a result of the provider split. The original body of the issue is below.


-terraform version
0.11.1

-this is happening in custom created VPC
each terraform apply generate update in place even no changes are made with sg-caci-all-ip SG;

-plan output
Resource actions are indicated with the following symbols:
~ update in-place

Terraform will perform the following actions:

~ module.bastion.aws_security_group.sg-caci-all-ip
ingress.1228639923.cidr_blocks.#: "0" => "1"
ingress.1228639923.cidr_blocks.0: "" => "195.1.1.1/26"
ingress.1228639923.description: "" => "CACI Proxy"
ingress.1228639923.from_port: "" => "0"
ingress.1228639923.ipv6_cidr_blocks.#: "0" => "0"
ingress.1228639923.protocol: "" => "tcp"
ingress.1228639923.security_groups.#: "0" => "0"
ingress.1228639923.self: "" => "false"
ingress.1228639923.to_port: "" => "65535"
ingress.1455026123.cidr_blocks.#: "0" => "1"
ingress.1455026123.cidr_blocks.0: "" => "195.1.1.2/32"
ingress.1455026123.description: "" => "LDS CACI"
ingress.1455026123.from_port: "" => "0"
...
security_groups.#: "0" => "1" (forces new resource)
security_groups.3062004935: "" => "sg-01efd77a" (forces new resource)

  • terraform apply ending with error
    1 error(s) occurred:
  • module.bastion.aws_security_group.sg-caci-all-ip: 1 error(s) occurred:

  • aws_security_group.sg-caci-all-ip: Error revoking security group ingress rules: InvalidPermission.NotFound: The specified rule does not exist in this security group.
    status code: 400, request id: 298dde37-c18f-4fd7-aa77-8e772a8bb517

-config file to reproduce from bastion module

locals {
default_tags = {
Owner = "coop"
Environment = "stage"
Terraform = "true"
}
}

resource "aws_security_group" "sg-caci-all-ip" {
name = "caci-all"
description = "Internal IP for TEST Networks"
vpc_id = "${var.vpc_id}"

ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.1/32"]
    description = "KV TEST"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.2/32"]
    description = "KV TEST"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.3/32"]
    description = "KV TEST"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.3/32"]
    description = "LDS TEST"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.4/32"]
    description = "LDS TEST"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.5/29"]
    description = "TEST Proxy"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.6/26"]
    description = "TEST Proxy"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = ["195.1.1.7/29"]
    description = "TEST Proxy"
}
ingress {
    from_port = 0
    to_port = 65535
    protocol = "tcp"
    cidr_blocks = [195.1.1.8/32"]
    description = "KV TEST"
}

outbound internet access

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

}

resource "aws_instance" "bastion" {
ami = "${var.ami}"
availability_zone = "${var.az-1}"
instance_type = "${var.bastion_instance_type}"
key_name = "${var.key_name}"
vpc_security_group_ids = ["${aws_security_group.sg-caci-all-ip.id}"]
subnet_id = "${var.subnet-az-1-public_id}"
associate_public_ip_address = true

tags = "${merge(
local.default_tags,
map(
   "Name", "coop-bastion",
)

)}"
}

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jan 5, 2018
@radeksimko radeksimko added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 28, 2018
@dmusci-reancloud
Copy link

I encountered this as well. As a workaround, I recreated the security group but omitted the descriptions and that resolved the problem.

@neekz0r
Copy link

neekz0r commented Apr 30, 2018

I too have encountered this. It would seem as though the descriptions are a part of it, as we had one.

@bflad
Copy link
Contributor

bflad commented May 10, 2018

Hi folks 👋 Sorry this has been a longstanding issue with the AWS provider. The fix for this should be contained in #4416 which will be released with v1.19.0 of the AWS provider, likely middle of next week.

Shout outs to @loivis (and @svanharmelen who submitted an earlier, likely correct PR, which I admittedly should have reviewed and merged sooner: #3628)

Given there were so many various issues surrounding this bug, I will be locking this issue (amongst all the others) to encourage any lingering issues/discussion to be fully described in new issue(s) for consolidation. Thanks for your understanding.

@hashicorp hashicorp locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants