-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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_security_group_rule InvalidPermission.Duplicate - Should be additive #12450
Comments
Hey @chrisferry 👋 Thank you for taking the time to file this issue. Given that there's been quite a few AWS provider releases since you initially filed it, can you confirm whether you're still experiencing this behavior? |
Yes. Just tested on version 3.63.0. This is still an issue. |
Hey @ryan-omni3 👋 Thank you very much for the update! By chance, can you provide the Terraform configuration so that we can attempt to reproduce and look into this more as time allows? |
I get this error as well. When I rerun the same apply job though, it goes through. This is breaking some of our pipelines, would like to see this run successfully on the first run. |
Hey @joelleigh 👋 Thank you for the additional report! So that we have enough information to try to look into this, can you supply the version of Terraform and the version of the AWS Provider that you're running, along with a sample configuration that exhibits this behavior? |
@justinretzolk
Your version of Terraform is out of date! The latest version We have multiple beanstalk environments, each needing to add to the default vpc security group to allow ingress
|
Hey @joelleigh -- thanks for providing that additional info! With that in mind, I used the following sample configuration to attempt to reproduce this. Unfortunately, I've so far not been able to reproduce the errors you saw, using Terraform resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
resource "aws_security_group" "main" {
name = "jretzolk-test-sg-main"
vpc_id = aws_vpc.main.id
}
resource "aws_security_group" "secondary" {
count = 60 # the max number of ingress rules allowed for a given SG
name = "jretzolk-test-sg-secondary-${count.index}"
vpc_id = aws_vpc.main.id
}
# Note: Because of the `for_each` here, this resource must be either commented out and then uncommented
# on a second apply, or a targeted apply must be run against `aws_security_group.secondary`, followed by a
# subsequent apply.
resource "aws_security_group_rule" "main" {
for_each = toset(aws_security_group.secondary.*.id)
type = "ingress"
from_port = 80
to_port = 80
protocol = "tcp"
security_group_id = aws_security_group.main.id
source_security_group_id = each.key
} You mentioned that it seems to work on a second apply, so I recognize this is intermittent and may be difficult to catch, but does it happen consistently enough that it would be possible to reproduce the issue with debug logging turned on so that we can take a look at those debug logs? |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
This issue was originally opened by @chrisferry as hashicorp/terraform#1874. It was migrated here as a result of the provider split. The original body of the issue is below.
I have a module which creates an ASG tied to an ELB
Within that module there is:
I have several ASGs in the same APP-SG and several ELBs in the same ELB-SG
Some have overlapping listen ports which causes the following error when I try to apply:
I think that the resource should allow for additive rules due to how the modules work
The text was updated successfully, but these errors were encountered: