hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.17k forks source link

Malforming an aws_security_group_rule resource returns ALL security groups and rules that exist on account in error response. #11899

Open mijdavis2 opened 4 years ago

mijdavis2 commented 4 years ago

Community Note

Terraform Version

Affected Resource(s)

Terraform Configuration Files

resource "aws_security_group_rule" "alb_egress_http_to_task" {
  type                     = "egress"
  from_port                = 80
  to_port                  = 80
  protocol                 = "tcp"
  source_security_group_id = "id-12345"
  security_group_id        = ""
  description              = "http_to_ecs_myservice"
}

Debug Output

https://gist.github.com/mijdavis2/15cda299f25ba1bc4047edb84f9f0f49

Panic Output

Expected Behavior

Tell the user that security_group_id should not be blank or an empty string.

Actual Behavior

Output every single security group and rule in the target region/account.

Steps to Reproduce

Use the above resource with valid inputs aside from security_group_id

  1. terraform apply

Important Factoids

References

justinretzolk commented 2 years ago

Hey @mijdavis2 👋 Thank you very much for taking the time to raise this issue. Given that there's been a number of AWS provide releases since you initially filed it, can you confirm whether you're still experiencing this behavior?

github-actions[bot] commented 1 month ago

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!