-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: Ingress and Egress define "security groups" as optional but if not mentioned it fails as required #20484
Comments
|
That's exactly my point. The documentation, however, indicates them as optional: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group |
I have a similar issue - I am defining a security group ingress rule with security_group argument but validation is failing. It does not think security_groups is valid instead of cidr_blocks...... when according to docs it is
|
Relates: #20428. |
I reported exactly the same in #20599, this arguments are only required if you use the cidr_block argument in your ingress ,what I did to solve it was this, I had to use the resource aws_security_group_rule to add the ingress
|
Working code. resource "aws_security_group" "this" { ingress { ingress { egress { |
also hitting this issue while having copy/paste a snippet from terraform doc. However, it worked for me when I define
Is the first one (with ``egress = [] I'm a little bit confused about that. |
This continues to be a problem on provider 3.58.0. The omission of what should be optional attributes results in:
and the conversion to a single object mentioned as working above results in:
The only way I could make this rule work was supplying empty/false values for the attributes which should be optional. |
@paulgear
Instead of
You need to remove the equal sign to get it work. But still it is a bug... |
@giom-l Thanks - my eyes must need checking! :-) |
This functionality has been released in v3.65.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform: V1.0.4
registry.terraform.io/hashicorp/aws: v3.51.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Terraform Log
Panic Output
Expected Behavior
I should be able to declare ingress and egress for aws_security_group without security_groups
Actual Behavior
Terraform asked for security_groups to be specified as required
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: