main.tf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # ==================================
  2. # Terraform & Provider Configuration
  3. # ==================================
  4. terraform {
  5. required_providers {
  6. yandex = {
  7. source = "yandex-cloud/yandex"
  8. version = "~> 0.84.0"
  9. }
  10. }
  11. }
  12. # ===========================
  13. # Call keycloak-deploy module
  14. # ===========================
  15. module "keycloak-deploy" {
  16. source = "git::https://github.com/yandex-cloud/yc-solution-library-for-security.git//auth_and_access/keycloak/keycloak-deploy"
  17. cloud_id = var.YC_CLOUD_ID
  18. labels = { tag = "keycloak-deploy" }
  19. # ==================
  20. # Keycloak VM values
  21. # ==================
  22. kc_image_folder_id = "standard-images"
  23. kc_image_name = "ubuntu-22-04-lts-v20221226"
  24. kc_folder_name = "infra"
  25. kc_zone_id = "ru-central1-b"
  26. kc_network_name = "infra-net"
  27. kc_subnet_name = "infra-subnet-b"
  28. kc_hostname = "kc1"
  29. kc_vm_sg_name = "kc-sg"
  30. kc_vm_username = "admin"
  31. kc_vm_ssh_key_file = "~/.ssh/id_rsa.pub"
  32. # KC FQDN --> kc1.mydom.net
  33. dns_zone_name = "mydom-net"
  34. kc_ver = "20.0.2"
  35. kc_port = "8443"
  36. kc_adm_user = "admin"
  37. kc_adm_pass = "Fr#dR3n48Ga-Mov"
  38. # =================
  39. # PostgreSQL values
  40. # =================
  41. pg_db_ver = "15"
  42. pg_db_name = "kc1-db"
  43. pg_db_user = "dbadmin"
  44. pg_db_pass = "My82Sup@paS98"
  45. # ===================
  46. # Certificates values
  47. # ===================
  48. kc_cert_path = "/usr/local/etc/certs"
  49. le_cert_name = "kc1"
  50. le_cert_descr = "LE Certificate for Keycloak VM"
  51. le_cert_pub_chain = "cert-pub-chain.pem"
  52. le_cert_priv_key = "cert-priv-key.pem"
  53. }
  54. output "kc_fqdn" {
  55. value = "${module.keycloak-deploy.kc_fqdn}"
  56. }