Skip to content

Commit f5dcc84

Browse files
RomanNessactions-botGowiemcloudpossebot
authored
fix always dirty aws_security_group.default (#170)
Co-authored-by: actions-bot <[email protected]> Co-authored-by: Matt Gowie <[email protected]> Co-authored-by: cloudpossebot <[email protected]>
1 parent 13e082f commit f5dcc84

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<!-- markdownlint-disable -->
23
# terraform-aws-elastic-beanstalk-environment
34

@@ -39,7 +40,6 @@ The Cloud Posse team no longer utilizes Beanstalk all that much, but this module
3940

4041
If you're interested, reach out to us via the `#terraform` channel in [the SweetOps Slack](https://slack.sweetops.com/) or directly [via email @ [email protected]](mailto:[email protected])
4142

42-
4343
---
4444

4545
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
@@ -70,7 +70,6 @@ We literally have [*hundreds of terraform modules*][terraform_modules] that are
7070

7171

7272

73-
7473
## Security & Compliance [<img src="https://cloudposse.com/wp-content/uploads/2020/11/bridgecrew.svg" width="250" align="right" />](https://bridgecrew.io/)
7574

7675
Security scanning is graciously provided by Bridgecrew. Bridgecrew is the leading fully hosted, cloud-native solution providing continuous Terraform security and compliance.

main.tf

+8-5
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,14 @@ resource "aws_security_group" "default" {
302302

303303
vpc_id = var.vpc_id
304304

305-
ingress {
306-
from_port = 0
307-
to_port = 0
308-
protocol = -1
309-
security_groups = var.allowed_security_groups
305+
dynamic "ingress" {
306+
for_each = length(var.allowed_security_groups) == 0 ? [] : [1]
307+
content {
308+
from_port = 0
309+
to_port = 0
310+
protocol = -1
311+
security_groups = var.allowed_security_groups
312+
}
310313
}
311314

312315
egress {

0 commit comments

Comments
 (0)