security-groups.tf 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. resource "aws_security_group" "vmray_sg" {
  2. name = "vmray_sg"
  3. description = "Security Rules Specific to VMRay"
  4. vpc_id = data.terraform_remote_state.standard_vpc.outputs.vpc_id
  5. tags = merge(var.standard_tags, var.tags)
  6. }
  7. resource "aws_security_group_rule" "vmray-ssh" {
  8. type = "ingress"
  9. from_port = 22
  10. to_port = 22
  11. protocol = "tcp"
  12. cidr_blocks = var.portal_test_whitelist
  13. security_group_id = aws_security_group.vmray_sg.id
  14. }
  15. resource "aws_security_group_rule" "vmray-https" {
  16. type = "ingress"
  17. from_port = 443
  18. to_port = 443
  19. protocol = "tcp"
  20. cidr_blocks = var.portal_test_whitelist
  21. security_group_id = aws_security_group.vmray_sg.id
  22. }
  23. resource "aws_security_group_rule" "vmray-egress" {
  24. type = "egress"
  25. from_port = 0 # all ports
  26. to_port = 0 # all ports
  27. protocol = "all"
  28. cidr_blocks = [ "0.0.0.0/0" ]
  29. security_group_id = aws_security_group.vmray_sg.id
  30. }