security_groups.tf 711 B

1234567891011121314151617181920212223242526272829303132333435
  1. resource "aws_security_group" "allow_access" {
  2. name_prefix = local.unique_id
  3. description = "Allow inbound traffic"
  4. vpc_id = aws_vpc.main.id
  5. ingress {
  6. description = "Allow all inbound."
  7. from_port = 0
  8. to_port = 0
  9. protocol = "-1"
  10. cidr_blocks = [aws_vpc.main.cidr_block]
  11. }
  12. egress {
  13. description = "Allow all outbound."
  14. from_port = 0
  15. to_port = 0
  16. protocol = "-1"
  17. # tfsec:ignore:aws-ec2-no-public-egress-sgr For the lab, all outbound is fine.
  18. cidr_blocks = ["0.0.0.0/0"]
  19. }
  20. depends_on = [aws_subnet.main]
  21. lifecycle {
  22. ignore_changes = [
  23. ingress,
  24. egress,
  25. ]
  26. }
  27. tags = {
  28. project = "monkeybox_emr_lab"
  29. }
  30. }