security.tf 798 B

12345678910111213141516171819202122232425262728293031323334
  1. # Create Security Group for Keycloak VM
  2. resource "yandex_vpc_security_group" "kc_sg" {
  3. name = "kc_sg"
  4. description = "Security group for Keycloak"
  5. folder_id = var.values.folder_id
  6. network_id = var.values.vpc_id
  7. egress {
  8. description = "Permit ALL"
  9. protocol = "ANY"
  10. v4_cidr_blocks = ["0.0.0.0/0"]
  11. }
  12. ingress {
  13. description = "icmp"
  14. protocol = "ICMP"
  15. v4_cidr_blocks = var.values.trusted_ip_for_mgmt
  16. }
  17. ingress {
  18. description = "ssh"
  19. protocol = "TCP"
  20. port = 22
  21. v4_cidr_blocks = var.values.trusted_ip_for_mgmt
  22. }
  23. ingress {
  24. description = "https"
  25. protocol = "TCP"
  26. port = var.values.keycloak.port
  27. v4_cidr_blocks = ["0.0.0.0/0"]
  28. }
  29. }