fast2dev 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. f2dev/__init__.py +1 -0
  2. f2dev/__main__.py +5 -0
  3. f2dev/_bundle/platform/.dockerignore +80 -0
  4. f2dev/_bundle/platform/.gitignore +82 -0
  5. f2dev/_bundle/platform/LICENSE +202 -0
  6. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/template_values.yaml +1731 -0
  7. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/Chart.yaml +9 -0
  8. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-airflow-deploy.yaml +60 -0
  9. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-bi-sync.yaml +46 -0
  10. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-checkout.yaml +49 -0
  11. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-console-sync.yaml +41 -0
  12. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-label.yaml +48 -0
  13. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-run.yaml +43 -0
  14. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-e2e-teardown.yaml +47 -0
  15. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-governance.yaml +40 -0
  16. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-lint.yaml +37 -0
  17. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-notify.yaml +32 -0
  18. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-quality.yaml +38 -0
  19. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-refresh.yaml +36 -0
  20. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-supersede.yaml +30 -0
  21. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/block-tags.yaml +44 -0
  22. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-branch.yaml +138 -0
  23. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-main.yaml +150 -0
  24. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/files/pipeline-pr.yaml +184 -0
  25. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/NOTES.txt +18 -0
  26. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/settings-configmap.yaml +14 -0
  27. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/templates/workflowtemplates.yaml +31 -0
  28. f2dev/_bundle/platform/charts/data_services_charts/argo_workflows/workflow_templates/values.yaml +41 -0
  29. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values.yaml +436 -0
  30. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/github/template_github_values_extra.yaml +49 -0
  31. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values.yaml +551 -0
  32. f2dev/_bundle/platform/charts/data_services_charts/cicd_workload_runner/gitlab/template_gitlab_values_extra.yaml +9 -0
  33. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/lightdash/template_values.yaml +359 -0
  34. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/metabase/template_values.yaml +384 -0
  35. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/superset/template_values.yaml +1562 -0
  36. f2dev/_bundle/platform/charts/data_services_charts/data_analysis/template_values.yaml +269 -0
  37. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/.helmignore +15 -0
  38. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/Chart.yaml +20 -0
  39. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/template_values.yaml.j2 +175 -0
  40. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/NOTES.txt +19 -0
  41. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/_helpers.tpl +50 -0
  42. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/cicd-rbac.yaml +30 -0
  43. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/configmap.yaml +142 -0
  44. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/extras.yaml +14 -0
  45. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/ingress.yaml +69 -0
  46. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/promtail-configmap.yaml +68 -0
  47. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/secret.yaml +31 -0
  48. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/service.yaml +15 -0
  49. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/serviceaccount.yaml +12 -0
  50. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/statefulset.yaml +276 -0
  51. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/valkey.yaml +113 -0
  52. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/templates/warehouse-stats-cronjob.yaml +107 -0
  53. f2dev/_bundle/platform/charts/data_services_charts/data_control_plane/values.yaml +828 -0
  54. f2dev/_bundle/platform/charts/data_services_charts/data_dbt_server/template_values.yaml +385 -0
  55. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_prerequisites_values.yaml +118 -0
  56. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_dh_values.yaml +1671 -0
  57. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_kafka_values.yaml +112 -0
  58. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_opensearch_values.yaml +662 -0
  59. f2dev/_bundle/platform/charts/data_services_charts/data_governance/template_values.yaml +738 -0
  60. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/Chart.yaml +6 -0
  61. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/files/argo-openapi.json +681 -0
  62. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/_helpers.tpl +17 -0
  63. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/argo-rbac.yaml +35 -0
  64. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/backends.yaml +327 -0
  65. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/templates/gateway.yaml +150 -0
  66. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/hub/values.yaml +91 -0
  67. f2dev/_bundle/platform/charts/data_services_charts/data_mcp_hub/template_values.yaml +142 -0
  68. f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values.yaml +1167 -0
  69. f2dev/_bundle/platform/charts/data_services_charts/data_modeling/template_values_extra.yaml +99 -0
  70. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/Dockerfile +10 -0
  71. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/build.sh +38 -0
  72. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/cleanup.py +452 -0
  73. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/airflow-cleanup/requirements.txt +3 -0
  74. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/docs/keycloak-oidc-setup.md +106 -0
  75. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values.yaml +5536 -0
  76. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/template_values_extra.yaml +379 -0
  77. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/configmap.yaml +459 -0
  78. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_auth.py +285 -0
  79. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/fast2dev_mcp_plugin.py +24 -0
  80. f2dev/_bundle/platform/charts/data_services_charts/data_orchestration/webserver-config/webserver_config.py +130 -0
  81. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/Dockerfile +10 -0
  82. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/build.sh +38 -0
  83. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/cleanup.py +749 -0
  84. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/configmap.yaml +24 -0
  85. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/k8s/cronjob.yaml +137 -0
  86. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte-cleanup/requirements.txt +3 -0
  87. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/.helmignore +26 -0
  88. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.lock +3 -0
  89. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/Chart.yaml +15 -0
  90. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/README.md +243 -0
  91. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/NOTES.txt +31 -0
  92. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_helpers.tpl +245 -0
  93. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/_images.tpl +17 -0
  94. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-auth-secret.yaml +35 -0
  95. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/bootloader-secrets.yaml +19 -0
  96. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-bootloader/pod.yaml +126 -0
  97. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-connector-rollout-worker/deployment.yaml +171 -0
  98. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/cron-secrets.yaml +19 -0
  99. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-cron/deployment.yaml +149 -0
  100. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-db.yaml +88 -0
  101. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/_helpers.tpl +111 -0
  102. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/deployment.yaml +169 -0
  103. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/hpa.yaml +23 -0
  104. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/pdb.yaml +17 -0
  105. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/service.yaml +25 -0
  106. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-direct-job-runner/serviceaccount.yaml +10 -0
  107. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/deployment.yaml +161 -0
  108. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-featureflag-server/service.yaml +25 -0
  109. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/service.yaml +62 -0
  110. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-keycloak/statefulset.yaml +182 -0
  111. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/_helpers.tpl +54 -0
  112. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/deployment.yaml +152 -0
  113. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/service.yaml +23 -0
  114. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-manifest-server/serviceaccount.yaml +10 -0
  115. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-metrics/deployment.yaml +124 -0
  116. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/deployment.yaml +227 -0
  117. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-server/service.yaml +29 -0
  118. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/deployment.yaml +184 -0
  119. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-stigg-sidecar/service.yaml +21 -0
  120. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/configmap.yaml +55 -0
  121. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/deployment.yaml +220 -0
  122. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal/service.yaml +21 -0
  123. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/deployment.yaml +122 -0
  124. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-temporal-ui/service.yaml +23 -0
  125. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/deployment.yaml +146 -0
  126. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/ingress.yaml +63 -0
  127. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-webapp/service.yaml +32 -0
  128. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-worker/deployment.yaml +229 -0
  129. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/deployment.yaml +191 -0
  130. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-api-server/service.yaml +25 -0
  131. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/deployment.yaml +232 -0
  132. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/airbyte-workload-launcher/jobs-secrets.yaml +21 -0
  133. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_auth.tpl +944 -0
  134. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_aws.tpl +109 -0
  135. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cluster.tpl +82 -0
  136. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_common.tpl +370 -0
  137. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connector.tpl +58 -0
  138. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRollout.tpl +141 -0
  139. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_connectorRolloutWorker.tpl +56 -0
  140. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_cron.tpl +62 -0
  141. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_customerio.tpl +56 -0
  142. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_database.tpl +375 -0
  143. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_dataplaneGroups.tpl +38 -0
  144. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_directJobRunner.tpl +122 -0
  145. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_featureFlags.tpl +126 -0
  146. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_java.tpl +38 -0
  147. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_jobs.tpl +422 -0
  148. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_keycloak.tpl +542 -0
  149. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_logging.tpl +38 -0
  150. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_metrics.tpl +214 -0
  151. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_micronaut.tpl +43 -0
  152. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_minio.tpl +64 -0
  153. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_secretsManager.tpl +628 -0
  154. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_server.tpl +533 -0
  155. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_shopify.tpl +83 -0
  156. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_stigg.tpl +157 -0
  157. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_storage.tpl +468 -0
  158. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_temporal.tpl +943 -0
  159. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_topology.tpl +98 -0
  160. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_tracking.tpl +82 -0
  161. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_webapp.tpl +38 -0
  162. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_worker.tpl +366 -0
  163. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadApiServer.tpl +62 -0
  164. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloadLauncher.tpl +395 -0
  165. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/config/_workloads.tpl +770 -0
  166. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/env-configmap.yaml +62 -0
  167. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/gcs-log-creds-secret.yaml +19 -0
  168. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/ingress.yaml +69 -0
  169. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/minio.yaml +161 -0
  170. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/secret.yaml +31 -0
  171. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/serviceaccount.yaml +50 -0
  172. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/telemetry-configmap.yaml +32 -0
  173. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/templates/tests/test-webapp.yaml +34 -0
  174. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte/values.yaml +3158 -0
  175. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/.helmignore +12 -0
  176. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/Chart.yaml +16 -0
  177. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/README.md +172 -0
  178. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/_helpers.tpl +42 -0
  179. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/deployment.yaml +105 -0
  180. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/externalsecret.yaml +23 -0
  181. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/pdb.yaml +15 -0
  182. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/templates/service.yaml +18 -0
  183. f2dev/_bundle/platform/charts/data_services_charts/data_replication/airbyte_chart/airbyte-metrics-fast2dev-ddp/values.yaml +97 -0
  184. f2dev/_bundle/platform/charts/data_services_charts/data_replication/feature-flags-configmap.yaml +16 -0
  185. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_metrics_values.yaml +13 -0
  186. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_oauth2proxy_values.yaml +1200 -0
  187. f2dev/_bundle/platform/charts/data_services_charts/data_replication/template_values.yaml +3255 -0
  188. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/Chart.yaml +7 -0
  189. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-client.yaml +27 -0
  190. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-master.yaml +38 -0
  191. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/hazelcast-worker.yaml +29 -0
  192. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_client_options +24 -0
  193. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_master_options +6 -0
  194. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/jvm_worker_options +6 -0
  195. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/log4j2.properties +109 -0
  196. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/conf/seatunnel.yaml +36 -0
  197. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/_helpers.tpl +70 -0
  198. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/configmap.yaml +11 -0
  199. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-master.yaml +120 -0
  200. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/deployment-worker.yaml +118 -0
  201. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/rbac.yaml +32 -0
  202. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/templates/services.yaml +33 -0
  203. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/seatunnel/values.yaml +101 -0
  204. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_oauth2proxy_values.yaml +196 -0
  205. f2dev/_bundle/platform/charts/data_services_charts/data_streaming/template_values.yaml +75 -0
  206. f2dev/_bundle/platform/charts/data_services_charts/object_storage_operator/template_values.yaml +506 -0
  207. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/csi_driver_values.yaml +193 -0
  208. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_pdns_webhook_values.yaml +91 -0
  209. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values.yaml +1777 -0
  210. f2dev/_bundle/platform/charts/infra_services_charts/cert_manager/template_values_extra.yaml +253 -0
  211. f2dev/_bundle/platform/charts/infra_services_charts/cluster_cleaner/template_values.yaml +57 -0
  212. f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values.yaml +476 -0
  213. f2dev/_bundle/platform/charts/infra_services_charts/external_dns/template_values_extra.yaml +131 -0
  214. f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/realm_template.json +4785 -0
  215. f2dev/_bundle/platform/charts/infra_services_charts/idp_sso_manager/template_values.yaml +657 -0
  216. f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values.yaml +36 -0
  217. f2dev/_bundle/platform/charts/infra_services_charts/pvc_autoscaller/template_values_extra.yaml +352 -0
  218. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values.yaml +1218 -0
  219. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager/template_values_extra.yaml +845 -0
  220. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values.yaml +561 -0
  221. f2dev/_bundle/platform/charts/infra_services_charts/secret_manager_operator/template_values_extra.yaml +23 -0
  222. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_events_values.yaml +59 -0
  223. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_alloy_values.yaml +185 -0
  224. f2dev/_bundle/platform/charts/infra_services_charts/services_logs/template_loki_values.yaml +108 -0
  225. f2dev/_bundle/platform/charts/infra_services_charts/services_metrics/template_values.yaml +1530 -0
  226. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/.gitkeep +0 -0
  227. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/00-main/f2d-main.json +2871 -0
  228. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/.gitkeep +0 -0
  229. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-k8s-cluster.json +1751 -0
  230. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-microservices.json +1682 -0
  231. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-pvc-storage.json +1320 -0
  232. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/01-platform/f2d-service.json +1193 -0
  233. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/.gitkeep +0 -0
  234. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-cert-manager.json +755 -0
  235. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-keycloak.json +746 -0
  236. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-object-storage.json +881 -0
  237. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-postgresql.json +1590 -0
  238. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/02-infrastructure/f2d-traefik.json +1375 -0
  239. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/.gitkeep +0 -0
  240. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows-trends.json +1916 -0
  241. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-cicd-workflows.json +1330 -0
  242. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-analysis.json +631 -0
  243. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-freshness.json +1362 -0
  244. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-governance.json +1958 -0
  245. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-modeling.json +764 -0
  246. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration-trends.json +2352 -0
  247. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-orchestration.json +1506 -0
  248. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-quality.json +1549 -0
  249. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication-trends.json +2799 -0
  250. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-replication.json +2153 -0
  251. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming-trends.json +1536 -0
  252. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/03-data-services/f2d-data-streaming.json +1209 -0
  253. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse/.gitkeep +0 -0
  254. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/.gitkeep +0 -0
  255. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/04-data-warehouse-bigquery/f2d-bigquery.json +990 -0
  256. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/.gitkeep +0 -0
  257. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/05-logs/f2d-logs.json +630 -0
  258. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/folders.yaml +17 -0
  259. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/dashboards/requirements.yaml +8 -0
  260. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_alerts_cm.yaml +2031 -0
  261. f2dev/_bundle/platform/charts/infra_services_charts/services_monitoring/template_values.yaml +1315 -0
  262. f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values.yaml +550 -0
  263. f2dev/_bundle/platform/charts/infra_services_charts/stackgres_postgres_db/template_values_extra.yaml +742 -0
  264. f2dev/_bundle/platform/charts/infra_services_charts/traefik_lb/template_values.yaml +1758 -0
  265. f2dev/_bundle/platform/cli/README.md +866 -0
  266. f2dev/_bundle/platform/cli/__init__.py +42 -0
  267. f2dev/_bundle/platform/cli/__main__.py +17 -0
  268. f2dev/_bundle/platform/cli/cert_providers.py +369 -0
  269. f2dev/_bundle/platform/cli/command_record.py +144 -0
  270. f2dev/_bundle/platform/cli/config/data_services_config.json +217 -0
  271. f2dev/_bundle/platform/cli/config/environment_profiles.yaml +183 -0
  272. f2dev/_bundle/platform/cli/config/images.json +129 -0
  273. f2dev/_bundle/platform/cli/config/infrastructure_services_config.json +141 -0
  274. f2dev/_bundle/platform/cli/config.py +252 -0
  275. f2dev/_bundle/platform/cli/deployment_configuration_aws_example.yaml +117 -0
  276. f2dev/_bundle/platform/cli/deployment_configuration_gcp_example.yaml +130 -0
  277. f2dev/_bundle/platform/cli/deployment_configuration_onprem_example.yaml +71 -0
  278. f2dev/_bundle/platform/cli/destroy.py +677 -0
  279. f2dev/_bundle/platform/cli/dns_check.py +27 -0
  280. f2dev/_bundle/platform/cli/dns_providers.py +405 -0
  281. f2dev/_bundle/platform/cli/exit_codes.py +32 -0
  282. f2dev/_bundle/platform/cli/fixers.py +56 -0
  283. f2dev/_bundle/platform/cli/generate_only.py +336 -0
  284. f2dev/_bundle/platform/cli/health_report.py +114 -0
  285. f2dev/_bundle/platform/cli/logging.py +206 -0
  286. f2dev/_bundle/platform/cli/main.py +5293 -0
  287. f2dev/_bundle/platform/cli/precheck.py +1523 -0
  288. f2dev/_bundle/platform/cli/prerequisites/README.md +208 -0
  289. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.bat +107 -0
  290. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.ps1 +343 -0
  291. f2dev/_bundle/platform/cli/prerequisites/install-prerequisites.sh +207 -0
  292. f2dev/_bundle/platform/cli/prerequisites/linux/install-linux.sh +775 -0
  293. f2dev/_bundle/platform/cli/prerequisites/macos/install-macos.sh +634 -0
  294. f2dev/_bundle/platform/cli/prerequisites/requirements.txt +41 -0
  295. f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.ps1 +150 -0
  296. f2dev/_bundle/platform/cli/prerequisites/verify-prerequisites.sh +418 -0
  297. f2dev/_bundle/platform/cli/prerequisites/versions.yaml +43 -0
  298. f2dev/_bundle/platform/cli/prerequisites/windows/install-windows.ps1 +1005 -0
  299. f2dev/_bundle/platform/cli/restore.py +179 -0
  300. f2dev/_bundle/platform/cli/service_gates.py +160 -0
  301. f2dev/_bundle/platform/cli/state.py +332 -0
  302. f2dev/_bundle/platform/cli/wizard.py +782 -0
  303. f2dev/_bundle/platform/cli.py +235 -0
  304. f2dev/_bundle/platform/deployers/__init__.py +4 -0
  305. f2dev/_bundle/platform/deployers/base_deployer.py +8 -0
  306. f2dev/_bundle/platform/deployers/clouds/__init__.py +0 -0
  307. f2dev/_bundle/platform/deployers/clouds/aws_cloud.py +619 -0
  308. f2dev/_bundle/platform/deployers/clouds/azure_cloud.py +0 -0
  309. f2dev/_bundle/platform/deployers/clouds/google_cloud.py +785 -0
  310. f2dev/_bundle/platform/deployers/clouds/terragrunt_progress.py +56 -0
  311. f2dev/_bundle/platform/deployers/services/data_services/1.0_cicd_workload_runner.py +644 -0
  312. f2dev/_bundle/platform/deployers/services/data_services/12.0_control_plane.py +321 -0
  313. f2dev/_bundle/platform/deployers/services/data_services/13.0_data_mcp_hub.py +362 -0
  314. f2dev/_bundle/platform/deployers/services/data_services/2.0_object_storage_operator.py +416 -0
  315. f2dev/_bundle/platform/deployers/services/data_services/2.5_services_logs.py +482 -0
  316. f2dev/_bundle/platform/deployers/services/data_services/3.0_data_cicd_workflows.py +361 -0
  317. f2dev/_bundle/platform/deployers/services/data_services/4.0_data_replication.py +534 -0
  318. f2dev/_bundle/platform/deployers/services/data_services/4.5_data_streaming.py +303 -0
  319. f2dev/_bundle/platform/deployers/services/data_services/5.0_data_orchestration.py +760 -0
  320. f2dev/_bundle/platform/deployers/services/data_services/6.0_data_modeling.py +753 -0
  321. f2dev/_bundle/platform/deployers/services/data_services/7.0_data_governance.py +795 -0
  322. f2dev/_bundle/platform/deployers/services/data_services/8.0_data_analysis.py +587 -0
  323. f2dev/_bundle/platform/deployers/services/infra_services/1.0_secret_operator.py +467 -0
  324. f2dev/_bundle/platform/deployers/services/infra_services/10.0_cluster_pvc_autoscaller.py +500 -0
  325. f2dev/_bundle/platform/deployers/services/infra_services/2.0_cert_manager.py +963 -0
  326. f2dev/_bundle/platform/deployers/services/infra_services/3.0_external_dns.py +823 -0
  327. f2dev/_bundle/platform/deployers/services/infra_services/4.0_traefik_lb.py +604 -0
  328. f2dev/_bundle/platform/deployers/services/infra_services/5.0_stackgres_postgresql.py +652 -0
  329. f2dev/_bundle/platform/deployers/services/infra_services/6.0_services_metrics.py +515 -0
  330. f2dev/_bundle/platform/deployers/services/infra_services/7.0_services_monitoring.py +787 -0
  331. f2dev/_bundle/platform/deployers/services/infra_services/8.0_cluster_cleaner.py +439 -0
  332. f2dev/_bundle/platform/deployers/services/infra_services/9.0_idp_sso_manager.py +790 -0
  333. f2dev/_bundle/platform/readme.md +47 -0
  334. f2dev/_bundle/platform/requirements.txt +14 -0
  335. f2dev/_bundle/platform/terraform/aws_cloud/templates/backend.tf_template +10 -0
  336. f2dev/_bundle/platform/terraform/aws_cloud/templates/defaults.yaml_template +11 -0
  337. f2dev/_bundle/platform/terraform/aws_cloud/templates/env.yaml_template +2 -0
  338. f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_advanced_template +134 -0
  339. f2dev/_bundle/platform/terraform/aws_cloud/templates/root.hcl_basic_template +134 -0
  340. f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_advanced_template +134 -0
  341. f2dev/_bundle/platform/terraform/aws_cloud/templates/terragrunt.hcl_basic_template +134 -0
  342. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/01-apps-vpc/terragrunt.hcl +26 -0
  343. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/02-create-dns-ns-record/terragrunt.hcl +16 -0
  344. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/03-eks-cluster/terragrunt.hcl +21 -0
  345. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/04-external_dns_sa/terragrunt.hcl +28 -0
  346. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/01-apps-vpc/terragrunt.hcl +25 -0
  347. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/02-eks-cluster/terragrunt.hcl +32 -0
  348. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/03-external-dns-irsa/terragrunt.hcl +34 -0
  349. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/04-cert-manager-irsa/terragrunt.hcl +34 -0
  350. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +22 -0
  351. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +44 -0
  352. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/bi-platform/empty.yaml +1 -0
  353. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/empty.yaml +1 -0
  354. f2dev/_bundle/platform/terraform/aws_cloud/terragrunt/env.hcl +2 -0
  355. f2dev/_bundle/platform/terraform/azure_cloud/README.md +3 -0
  356. f2dev/_bundle/platform/terraform/azure_cloud/templates/_keep_structure.txt +0 -0
  357. f2dev/_bundle/platform/terraform/google_cloud/README.md +20 -0
  358. f2dev/_bundle/platform/terraform/google_cloud/templates/backend.tf_template +7 -0
  359. f2dev/_bundle/platform/terraform/google_cloud/templates/defaults.yaml_template +12 -0
  360. f2dev/_bundle/platform/terraform/google_cloud/templates/env.yaml_template +2 -0
  361. f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_advanced_template +114 -0
  362. f2dev/_bundle/platform/terraform/google_cloud/templates/root.hcl_basic_template +116 -0
  363. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/.gitignore +3 -0
  364. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/00-create-ou-folder/terragrunt.hcl +15 -0
  365. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/01-create-project/terragrunt.hcl +30 -0
  366. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/02-enable-apis/terragrunt.hcl +25 -0
  367. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/03-0-apps-vpc/terragrunt.hcl +134 -0
  368. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/04-external-ip-traefik/terragrunt.hcl +29 -0
  369. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/05-create-dns-zone/terragrunt.hcl +25 -0
  370. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/06-create-dns-ns-record/terragrunt.hcl +43 -0
  371. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/07-gke-cluster/terragrunt.hcl +103 -0
  372. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/08-dbt_deploy_sa/terragrunt.hcl +36 -0
  373. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/09-dbt_sa/terragrunt.hcl +40 -0
  374. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/10-cert_manager_sa/terragrunt.hcl +34 -0
  375. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/11-external_dns_sa/terragrunt.hcl +30 -0
  376. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/12-monitoring_sa/terragrunt.hcl +52 -0
  377. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/13-data_replication_sa/terragrunt.hcl +35 -0
  378. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/14-data_orchestration_sa/terragrunt.hcl +35 -0
  379. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/15-bi_data_sa/terragrunt.hcl +43 -0
  380. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/16-whitelist-external-ip-on-common/terragrunt.hcl +30 -0
  381. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/17-kubeconfig/terragrunt.hcl +23 -0
  382. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/bi-platform/18-data_streaming_sa/terragrunt.hcl +24 -0
  383. f2dev/_bundle/platform/terraform/google_cloud/terragrunt/empty.yaml +1 -0
  384. f2dev/_bundle/platform/utils/__init__.py +0 -0
  385. f2dev/_bundle/platform/utils/customer_data_platform_repository_operator.py +1098 -0
  386. f2dev/_bundle/platform/utils/customer_secret_manager_operations.py +1635 -0
  387. f2dev/_bundle/platform/utils/environment_profiles.py +58 -0
  388. f2dev/_bundle/platform/utils/helm_utils.py +215 -0
  389. f2dev/_bundle/platform/utils/infrastructure_deployment_operator.py +1532 -0
  390. f2dev/_bundle/platform/utils/keycloak_realm_reconcile.py +320 -0
  391. f2dev/_bundle/platform/utils/kubeconfig_fixer.py +265 -0
  392. f2dev/_bundle/platform/utils/raw_extras.py +34 -0
  393. f2dev/_bundle/platform/utils/readiness.py +330 -0
  394. f2dev/_bundle/platform/utils/secret_structure_upgrade.py +194 -0
  395. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/.gitignore +7 -0
  396. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/README.md +33 -0
  397. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/analyses/.gitkeep +0 -0
  398. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/dbt_project.yml +52 -0
  399. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/.gitkeep +0 -0
  400. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_bq_time_zones.sql +12 -0
  401. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/macros/fast2dev_monitoring_grain.sql +23 -0
  402. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.sql +19 -0
  403. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_daily_spend.yml +25 -0
  404. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.sql +16 -0
  405. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_model_costs_daily.yml +24 -0
  406. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.sql +12 -0
  407. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_storage_by_dataset.yml +21 -0
  408. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.sql +14 -0
  409. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_user_costs_daily.yml +22 -0
  410. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.sql +52 -0
  411. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_kpi.yml +42 -0
  412. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.sql +74 -0
  413. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/marts/fast2dev_bq_weekly_spend.yml +49 -0
  414. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/sources/billing_export.yml +9 -0
  415. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.sql +9 -0
  416. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/models/staging/fast2dev_bq_billing_export.yml +4 -0
  417. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/packages.yml +5 -0
  418. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/profiles.yml +15 -0
  419. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/scripts/run_monitoring.py +201 -0
  420. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/seeds/.gitkeep +0 -0
  421. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/snapshots/.gitkeep +0 -0
  422. f2dev/_bundle/platform/utils/templates/control_plane_warehouse_stats_template/bigquery_usage/tests/.gitkeep +0 -0
  423. f2dev/_bundle/platform/utils/templates/dry_run/gcp_sa.json +12 -0
  424. f2dev/_bundle/platform/utils/templates/dry_run/kubeconfig.yaml +18 -0
  425. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/README.MD +50 -0
  426. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/dbt/README.MD +47 -0
  427. f2dev/_bundle/platform/utils/templates/git_repo_templates/data_orchestrator/repository_structure/dags/fast2dev_healthcheck.py_template_airflow_3.x +158 -0
  428. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/bitbucket/bitbucket-pipelines.yml_template +144 -0
  429. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/PR_VALIDATION.md +52 -0
  430. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/pull_request_template.md +48 -0
  431. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/argo-workflows.yml_template +143 -0
  432. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/pr-agent.yml +30 -0
  433. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitea/.gitea/workflows/validate-pr-description.yml +38 -0
  434. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/PR_VALIDATION.md +52 -0
  435. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/pull_request_template.md +48 -0
  436. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/argo-workflows.yml_template +143 -0
  437. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/pr-agent.yml +37 -0
  438. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/github/.github/workflows/validate-pr-description.yml +157 -0
  439. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/PR_VALIDATION.md +43 -0
  440. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab/merge_request_templates/Default.md +48 -0
  441. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/gitlab/.gitlab-ci.yml_template +181 -0
  442. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.gitignore +21 -0
  443. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/.pr_agent.toml +82 -0
  444. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/AGENTS.md +126 -0
  445. f2dev/_bundle/platform/utils/templates/git_repo_templates/dbt_data_model/repository_structure/README.MD +101 -0
  446. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/DR.md +341 -0
  447. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/README.md.j2 +81 -0
  448. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/decrypt_files.py +331 -0
  449. f2dev/_bundle/platform/utils/templates/git_repo_templates/infrastructure_deployment_files/encrypt_files.py +321 -0
  450. f2dev/_bundle/platform/utils/templates/secret_structure_template/customer_vault_structure.json +502 -0
  451. f2dev/_bundle/platform/utils/vault_structure_sync.py +96 -0
  452. f2dev/_bundle/terraform-modules/README.md +12 -0
  453. f2dev/_bundle/terraform-modules/aws_cloud/README.md +7 -0
  454. f2dev/_bundle/terraform-modules/aws_cloud/eks/addons-roles.tf +298 -0
  455. f2dev/_bundle/terraform-modules/aws_cloud/eks/main.tf +313 -0
  456. f2dev/_bundle/terraform-modules/aws_cloud/eks/outputs.tf +3 -0
  457. f2dev/_bundle/terraform-modules/aws_cloud/eks/policies/lb-controller-policy.json +219 -0
  458. f2dev/_bundle/terraform-modules/aws_cloud/eks/provider.tf +36 -0
  459. f2dev/_bundle/terraform-modules/aws_cloud/eks/variables.tf +107 -0
  460. f2dev/_bundle/terraform-modules/aws_cloud/eks/versions.tf +10 -0
  461. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/main.tf +25 -0
  462. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/provider.tf +17 -0
  463. f2dev/_bundle/terraform-modules/aws_cloud/gcp_aws_zone/variables.tf +41 -0
  464. f2dev/_bundle/terraform-modules/aws_cloud/vpc/main.tf +34 -0
  465. f2dev/_bundle/terraform-modules/aws_cloud/vpc/outputs.tf +44 -0
  466. f2dev/_bundle/terraform-modules/aws_cloud/vpc/provider.tf +12 -0
  467. f2dev/_bundle/terraform-modules/aws_cloud/vpc/variables.tf +118 -0
  468. f2dev/_bundle/terraform-modules/aws_cloud/vpc/versions.tf +10 -0
  469. f2dev/_bundle/terraform-modules/azure_cloud/README.md +3 -0
  470. f2dev/_bundle/terraform-modules/google_cloud/README.md +17 -0
  471. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/main.tf +8 -0
  472. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/providers.tf +6 -0
  473. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/variables.tf +17 -0
  474. f2dev/_bundle/terraform-modules/google_cloud/artifact-registry/versions.tf +8 -0
  475. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/main.tf +24 -0
  476. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/outputs.tf +25 -0
  477. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/providers.tf +7 -0
  478. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/variables.tf +17 -0
  479. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns/versions.tf +9 -0
  480. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/main.tf +38 -0
  481. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/variables.tf +73 -0
  482. f2dev/_bundle/terraform-modules/google_cloud/cloud-dns-recordset/versions.tf +39 -0
  483. f2dev/_bundle/terraform-modules/google_cloud/composer/main.tf +213 -0
  484. f2dev/_bundle/terraform-modules/google_cloud/composer/outputs.tf +31 -0
  485. f2dev/_bundle/terraform-modules/google_cloud/composer/provider.tf +4 -0
  486. f2dev/_bundle/terraform-modules/google_cloud/composer/variables.tf +192 -0
  487. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/main.tf +29 -0
  488. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/output.tf +4 -0
  489. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/providers.tf +6 -0
  490. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/variables.tf +40 -0
  491. f2dev/_bundle/terraform-modules/google_cloud/create-ou-folder/versions.tf +8 -0
  492. f2dev/_bundle/terraform-modules/google_cloud/create-project/main.tf +18 -0
  493. f2dev/_bundle/terraform-modules/google_cloud/create-project/output.tf +8 -0
  494. f2dev/_bundle/terraform-modules/google_cloud/create-project/providers.tf +6 -0
  495. f2dev/_bundle/terraform-modules/google_cloud/create-project/variables.tf +27 -0
  496. f2dev/_bundle/terraform-modules/google_cloud/create-project/versions.tf +9 -0
  497. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/README.md +188 -0
  498. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/main.tf +135 -0
  499. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/output.tf +16 -0
  500. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/providers.tf +6 -0
  501. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/variables.tf +54 -0
  502. f2dev/_bundle/terraform-modules/google_cloud/deploy_sa/versions.tf +17 -0
  503. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/main.tf +14 -0
  504. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/provider.tf +7 -0
  505. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/variables.tf +13 -0
  506. f2dev/_bundle/terraform-modules/google_cloud/enable_apis/versions.tf +10 -0
  507. f2dev/_bundle/terraform-modules/google_cloud/external-ip/README.md +89 -0
  508. f2dev/_bundle/terraform-modules/google_cloud/external-ip/main.tf +17 -0
  509. f2dev/_bundle/terraform-modules/google_cloud/external-ip/outputs.tf +19 -0
  510. f2dev/_bundle/terraform-modules/google_cloud/external-ip/variables.tf +43 -0
  511. f2dev/_bundle/terraform-modules/google_cloud/fw-add/main.tf +24 -0
  512. f2dev/_bundle/terraform-modules/google_cloud/fw-add/providers.tf +6 -0
  513. f2dev/_bundle/terraform-modules/google_cloud/fw-add/variables.tf +37 -0
  514. f2dev/_bundle/terraform-modules/google_cloud/fw-add/versions.tf +9 -0
  515. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/README.md +10 -0
  516. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/main.tf +459 -0
  517. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/outputs.tf +44 -0
  518. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/provider.tf +19 -0
  519. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/variables.tf +354 -0
  520. f2dev/_bundle/terraform-modules/google_cloud/gke-cluster/versions.tf +22 -0
  521. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/README.md +40 -0
  522. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/main.tf +54 -0
  523. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/outputs.tf +10 -0
  524. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/variables.tf +24 -0
  525. f2dev/_bundle/terraform-modules/google_cloud/kubeconfig/versions.tf +10 -0
  526. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/README.md +47 -0
  527. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/main.tf +51 -0
  528. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/README.md +103 -0
  529. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/main.tf +71 -0
  530. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/outputs.tf +71 -0
  531. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/variables.tf +82 -0
  532. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/net-address/versions.tf +27 -0
  533. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/outputs.tf +35 -0
  534. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/provider.tf +4 -0
  535. f2dev/_bundle/terraform-modules/google_cloud/shared-vpc/variables.tf +237 -0
  536. f2dev/_bundle/terraform-modules/oracle_cloud/README.md +3 -0
  537. f2dev/launcher.py +153 -0
  538. fast2dev-1.0.0.dist-info/METADATA +201 -0
  539. fast2dev-1.0.0.dist-info/RECORD +543 -0
  540. fast2dev-1.0.0.dist-info/WHEEL +4 -0
  541. fast2dev-1.0.0.dist-info/entry_points.txt +2 -0
  542. fast2dev-1.0.0.dist-info/licenses/LICENSE +202 -0
  543. fast2dev-1.0.0.dist-info/licenses/NOTICE +6 -0
@@ -0,0 +1,785 @@
1
+ import subprocess
2
+ import os
3
+ import shutil
4
+ import json
5
+ import sys
6
+ import argparse
7
+ from jinja2 import Environment, FileSystemLoader
8
+ import logging
9
+
10
+ class Config:
11
+ CLIENT_ID = os.environ.get('GOOGLE_CLIENT_ID', '')
12
+ CLIENT_SECRET = os.environ.get('GOOGLE_CLIENT_SECRET', '')
13
+
14
+ from google.oauth2.credentials import Credentials
15
+ from google.auth.transport.requests import Request
16
+ import time
17
+ import datetime
18
+ from deployers.clouds.terragrunt_progress import run_with_progress
19
+
20
+ # Configure logging - only set up when explicitly called
21
+ def setup_logging(log_file="gcp_deployment.log", debug=False):
22
+ """Setup logging configuration to avoid duplication"""
23
+ # Clear any existing handlers to prevent duplication
24
+ root_logger = logging.getLogger()
25
+ for handler in root_logger.handlers[:]:
26
+ root_logger.removeHandler(handler)
27
+
28
+ # Set log level
29
+ log_level = logging.DEBUG if debug else logging.INFO
30
+
31
+ # Create formatter
32
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
33
+
34
+ # Create file handler
35
+ file_handler = logging.FileHandler(log_file)
36
+ file_handler.setFormatter(formatter)
37
+ file_handler.setLevel(log_level)
38
+
39
+ # Create console handler
40
+ console_handler = logging.StreamHandler()
41
+ console_handler.setFormatter(formatter)
42
+ console_handler.setLevel(log_level)
43
+
44
+ # Configure root logger
45
+ root_logger.setLevel(log_level)
46
+ root_logger.addHandler(file_handler)
47
+ root_logger.addHandler(console_handler)
48
+
49
+ return logging.getLogger('gcp_deployer')
50
+
51
+ # Initialize logger as None - will be set up when needed
52
+ logger = None
53
+
54
+ class GoogleCloudManager:
55
+ def __init__(self, deployment, billing_account_id, parent_folder, customer, domain_name, admin_email, whitelisted_ips, region, project_id=None, cloud_provider=None,
56
+ cidr_block=None, cluster_ipv4_cidr_block=None, services_ipv4_cidr_block=None, private_service_connect_cidr=None,
57
+ lb_subnet_cidr=None, shared_host=None, kubernetes_version=None, gke_machine_type=None, gke_spot=None, k8s_master_ipv4_cidr_block=None,
58
+ terraform_state=None, state_project=None, state_location=None, state_bucket=None, gke_deployment_type=None,
59
+ service_account_key=None, access_token=None, refresh_token=None, token_expiry=None, token_key=None, metadata_collector=None, logger=None, dry_run=False):
60
+ # Add these new attributes
61
+ self.service_account_key = service_account_key
62
+ self.access_token = access_token
63
+ self.refresh_token = refresh_token
64
+ self.token_expiry = token_expiry
65
+ self.token_key = token_key
66
+ self.metadata_collector = metadata_collector
67
+ self.logger = logger or logging.getLogger(__name__)
68
+ self.dry_run = dry_run
69
+ #Service specific tf - Basic
70
+ self.cloud_provider = cloud_provider if cloud_provider else "gcp"
71
+ self.deployment_environemnt = deployment
72
+ self.billing_account_id = billing_account_id
73
+ self.parent_folder = parent_folder
74
+ self.customer = customer
75
+ self.domain_name = domain_name
76
+ self.region = region
77
+ self.project_id = project_id if project_id else f"fast2dev-{customer}"
78
+ self.admin_email = admin_email
79
+ self.whitelisted_environment_ips = [whitelisted_ips] if isinstance(whitelisted_ips, str) else whitelisted_ips
80
+ #Service specific tf - Advanced
81
+ self.cidr_block = cidr_block
82
+ self.cluster_ipv4_cidr_block = cluster_ipv4_cidr_block
83
+ self.services_ipv4_cidr_block = services_ipv4_cidr_block
84
+ self.private_service_connect_cidr = private_service_connect_cidr
85
+ self.lb_subnet_cidr = lb_subnet_cidr
86
+ self.shared_host = shared_host
87
+ self.kubernetes_version = kubernetes_version
88
+ self.gke_machine_type = gke_machine_type
89
+ self.gke_spot = gke_spot
90
+ self.k8s_master_ipv4_cidr_block = k8s_master_ipv4_cidr_block
91
+ # New state management and GKE deployment type parameters
92
+ self.terraform_state = terraform_state if terraform_state else "local"
93
+ self.state_project = state_project
94
+ self.state_location = state_location
95
+ self.state_bucket = state_bucket
96
+ self.gke_deployment_type = gke_deployment_type if gke_deployment_type else "zonal"
97
+ #Service specific
98
+ self.terragrunt_dir = os.path.abspath("terraform/google_cloud/terragrunt")
99
+ self.backend_tf_template_path = "terraform/google_cloud/templates/backend.tf_template"
100
+ self.backend_tf_path = "terraform/google_cloud/terragrunt/bi-platform/backend.tf"
101
+ self.default_yaml_template_path = "terraform/google_cloud/templates/defaults.yaml_template"
102
+ self.default_yaml_path = "terraform/google_cloud/terragrunt/defaults.yaml"
103
+ self.env_yaml_template_path = "terraform/google_cloud/templates/env.yaml_template"
104
+ self.env_yaml_path = "terraform/google_cloud/terragrunt/bi-platform/env.yaml"
105
+ if self.deployment_environemnt == "basic":
106
+ self.terragrunt_hcl_template_path = "terraform/google_cloud/templates/root.hcl_basic_template"
107
+ elif self.deployment_environemnt == "advanced":
108
+ self.terragrunt_hcl_template_path = "terraform/google_cloud/templates/root.hcl_advanced_template"
109
+ else:
110
+ raise Exception("Deployment environment is not supported")
111
+ self.terragrunt_hcl_path = "terraform/google_cloud/terragrunt/bi-platform/root.hcl"
112
+ #MetadataCollection
113
+
114
+ def render_template(self, template_path, output_path, context):
115
+ env = Environment(loader=FileSystemLoader(os.path.dirname(template_path)))
116
+ template = env.get_template(os.path.basename(template_path))
117
+ output = template.render(context)
118
+ with open(output_path, 'w') as f:
119
+ f.write(output)
120
+
121
+ def render_backend_tf(self):
122
+ context = {
123
+ 'customer': self.customer,
124
+ 'state_bucket': self.state_bucket
125
+ }
126
+ self.render_template(self.backend_tf_template_path, self.backend_tf_path, context)
127
+
128
+ def render_defaults_yaml(self):
129
+ context = {
130
+ 'customer': self.customer,
131
+ 'project_id': self.project_id,
132
+ 'region': self.region
133
+ }
134
+ self.render_template(self.default_yaml_template_path, self.default_yaml_path, context)
135
+
136
+ def render_env_yaml(self):
137
+ context = {
138
+ 'project_id': self.project_id
139
+ }
140
+ self.render_template(self.env_yaml_template_path, self.env_yaml_path, context)
141
+
142
+ def render_terragrunt_hcl(self):
143
+ # Get GitLab access token from environment variables
144
+ gitlab_access_token = os.environ.get('PUBLIC_ACCESS_TOKEN', '')
145
+ if not gitlab_access_token:
146
+ self.logger.warning("PUBLIC_ACCESS_TOKEN environment variable not set. GitLab module downloads may fail.")
147
+
148
+ context = {
149
+ 'customer': self.customer,
150
+ 'domain_name': self.domain_name,
151
+ 'billing_account_id': self.billing_account_id,
152
+ 'region': self.region,
153
+ 'parent_folder': self.parent_folder,
154
+ 'project_id': self.project_id,
155
+ 'admin_email': self.admin_email,
156
+ 'whitelisted_ips': self.whitelisted_environment_ips,
157
+ 'cidr_block': self.cidr_block,
158
+ 'cluster_ipv4_cidr_block': self.cluster_ipv4_cidr_block,
159
+ 'services_ipv4_cidr_block': self.services_ipv4_cidr_block,
160
+ 'private_service_connect_cidr': self.private_service_connect_cidr,
161
+ 'lb_subnet_cidr': self.lb_subnet_cidr,
162
+ 'shared_host': self.shared_host,
163
+ 'kubernetes_version': self.kubernetes_version,
164
+ 'gke_machine_type': self.gke_machine_type,
165
+ 'gke_spot': self.gke_spot,
166
+ 'k8s_master_ipv4_cidr_block': self.k8s_master_ipv4_cidr_block,
167
+ 'terraform_state': self.terraform_state,
168
+ 'state_project': self.state_project,
169
+ 'state_location': self.state_location,
170
+ 'state_bucket': self.state_bucket,
171
+ 'gke_deployment_type': self.gke_deployment_type,
172
+ 'gitlab_access_token': gitlab_access_token
173
+ }
174
+ self.render_template(self.terragrunt_hcl_template_path, self.terragrunt_hcl_path, context)
175
+
176
+ def refresh_access_token_if_needed(self):
177
+ """Handle token refresh for API/website usage when tokens are provided"""
178
+ if self.access_token and self.refresh_token:
179
+ if self.is_token_expired():
180
+ self.logger.info("Token is expired, attempting to refresh")
181
+ try:
182
+ creds = Credentials.from_authorized_user_info(
183
+ {"refresh_token": self.refresh_token, "client_id": Config.CLIENT_ID, "client_secret": Config.CLIENT_SECRET},
184
+ scopes=['https://www.googleapis.com/auth/cloud-platform']
185
+ )
186
+ creds.refresh(Request())
187
+ self.logger.info("Token refreshed successfully")
188
+ self.access_token = creds.token
189
+
190
+ # Calculate new expiry
191
+ if creds.expiry:
192
+ self.token_expiry = creds.expiry.timestamp()
193
+ else:
194
+ # If expiry is not set, default to 1 hour from now
195
+ self.token_expiry = (datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(hours=1)).timestamp()
196
+
197
+ self.logger.info(f"New token expiry set to: {self.token_expiry}")
198
+
199
+ # Update the token in the database if metadata_collector is available
200
+ if self.metadata_collector and hasattr(self.metadata_collector, 'save_token'):
201
+ self.metadata_collector.save_token(self.token_key, self.access_token, self.refresh_token, self.token_expiry)
202
+ self.logger.info("Token updated in database")
203
+ except Exception as e:
204
+ self.logger.error(f"Error refreshing token: {str(e)}")
205
+ else:
206
+ self.logger.info("Token is still valid, no refresh needed")
207
+ else:
208
+ self.logger.info("No access token or refresh token provided, will use local gcloud authentication")
209
+
210
+ def is_token_expired(self):
211
+ if self.token_expiry is None:
212
+ self.logger.info("Token expiry is None, considering as expired")
213
+ return True
214
+ current_time = time.time()
215
+ is_expired = self.token_expiry <= current_time + 300
216
+ self.logger.info(f"Token expiry: {datetime.datetime.fromtimestamp(self.token_expiry)}, "
217
+ f"Current time: {datetime.datetime.fromtimestamp(current_time)}, "
218
+ f"Is expired: {is_expired}")
219
+ return is_expired
220
+
221
+ def execute_command(self, command):
222
+ cmd_str = ' '.join(command) if isinstance(command, list) else command
223
+
224
+ # Dry-run mode: show command without executing
225
+ if self.dry_run:
226
+ self.logger.info("[DRY-RUN] Would execute: %s", cmd_str)
227
+ print(f"[DRY-RUN] Would execute: {cmd_str}")
228
+ return "", None # Return mock success
229
+
230
+ self.refresh_access_token_if_needed()
231
+ output_file_path = f"{self.customer}_deployment.log"
232
+ original_dir = os.getcwd() # Save the current directory
233
+ try:
234
+ # Change to the Terragrunt directory
235
+ os.chdir(self.terragrunt_dir)
236
+ self.logger.info("Changed directory to: %s", os.getcwd())
237
+ self.logger.info("Executing command: %s", ' '.join(command))
238
+
239
+ env = os.environ.copy()
240
+ if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ:
241
+ env['GOOGLE_APPLICATION_CREDENTIALS'] = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
242
+
243
+ # Use shell=True only for commands that need it (like terragrunt)
244
+ if command[0] == "terragrunt" and "--all" in command:
245
+ result = run_with_progress(command, env=env)
246
+ elif command[0] in ["terragrunt", "terraform"]:
247
+ # Convert command list to string for shell=True
248
+ command_str = ' '.join(command)
249
+ result = subprocess.run(command_str, env=env, check=True, capture_output=True, text=True, shell=True)
250
+ else:
251
+ result = subprocess.run(command, env=env, check=True, capture_output=True, text=True)
252
+
253
+ # Save the result to a file
254
+ with open(output_file_path, 'w') as f:
255
+ f.write(result.stdout)
256
+ f.write(result.stderr)
257
+
258
+ return result.stdout + result.stderr, None
259
+ except subprocess.CalledProcessError as e:
260
+ self.logger.error("Command failed: %s", e.cmd)
261
+ self.logger.error("Status code: %s", e.returncode)
262
+ self.logger.error("Output: %s", e.stdout)
263
+ self.logger.error("Error: %s", e.stderr)
264
+ return e.stdout + e.stderr, e
265
+ finally:
266
+ # Change back to the original directory
267
+ os.chdir(original_dir)
268
+ self.logger.info("Returned to original directory: %s", os.getcwd())
269
+
270
+
271
+ def cleanup_terraform_states(self):
272
+ # Path where terragrunt and terraform files are located
273
+ base_dir = self.terragrunt_dir
274
+
275
+ # Walk through all directories and files in the base directory
276
+ for root, dirs, files in os.walk(base_dir, topdown=False):
277
+ # Remove .terragrunt-cache directories
278
+ for name in dirs:
279
+ if name == ".terragrunt-cache":
280
+ full_path = os.path.join(root, name)
281
+ shutil.rmtree(full_path)
282
+ self.logger.info(f"Removed .terragrunt-cache: {full_path}")
283
+ elif name == ".terraform":
284
+ # For .terraform directories, check if they contain state files
285
+ terraform_dir = os.path.join(root, name)
286
+ customer_state_dir = os.path.join(terraform_dir, self.customer)
287
+
288
+ # If this .terraform directory contains customer state files, preserve it
289
+ if os.path.exists(customer_state_dir):
290
+ self.logger.info(f"Preserving .terraform directory with state files: {terraform_dir}")
291
+ continue
292
+ else:
293
+ # This .terraform directory doesn't contain our customer's state files, safe to remove
294
+ shutil.rmtree(terraform_dir)
295
+ self.logger.info(f"Removed .terraform directory without state files: {terraform_dir}")
296
+
297
+ # Remove .terraform.lock.hcl files (these are safe to remove and will be regenerated)
298
+ for name in files:
299
+ if name == ".terraform.lock.hcl":
300
+ full_path = os.path.join(root, name)
301
+ os.remove(full_path)
302
+ self.logger.info(f"Removed .terraform.lock.hcl: {full_path}")
303
+
304
+ self.logger.info("Cleanup completed successfully.")
305
+
306
+ def is_wsl_environment(self):
307
+ """Check if we're running in WSL environment"""
308
+ try:
309
+ # Check for WSL-specific environment variables
310
+ if os.environ.get('WSL_DISTRO_NAME') or os.environ.get('WSLENV'):
311
+ return True
312
+ # Check for WSL in uname
313
+ result = subprocess.run(['uname', '-r'], capture_output=True, text=True)
314
+ if result.returncode == 0 and 'microsoft' in result.stdout.lower():
315
+ return True
316
+ return False
317
+ except BaseException:
318
+ return False
319
+
320
+ def check_gcloud_auth(self):
321
+ """Check if gcloud authentication is properly configured"""
322
+ try:
323
+ # Try without shell=True first (better for WSL2)
324
+ result = subprocess.run(["gcloud", "auth", "list", "--filter=status:ACTIVE", "--format=value(account)"],
325
+ capture_output=True, text=True, check=True)
326
+ if result.stdout.strip():
327
+ self.logger.info(f"gcloud authentication found for account: {result.stdout.strip()}")
328
+ return True
329
+ else:
330
+ self.logger.warning("No active gcloud authentication found")
331
+ return False
332
+ except subprocess.CalledProcessError as e:
333
+ self.logger.error(f"gcloud command failed with return code {e.returncode}")
334
+ self.logger.error(f"Error output: {e.stderr}")
335
+ return False
336
+ except FileNotFoundError:
337
+ if self.is_wsl_environment():
338
+ self.logger.error("gcloud CLI not found in WSL2 environment")
339
+ self.logger.error("Please install Google Cloud SDK in your WSL2 environment:")
340
+ self.logger.error(" curl https://sdk.cloud.google.com | bash")
341
+ self.logger.error(" exec -l $SHELL")
342
+ self.logger.error(" gcloud init")
343
+ else:
344
+ self.logger.error("gcloud CLI not found - please install Google Cloud SDK")
345
+ return False
346
+ except Exception as e:
347
+ self.logger.error(f"Unexpected error checking gcloud auth: {str(e)}")
348
+ return False
349
+
350
+ def deploy_gcp_terragrunt(self, max_retries=3):
351
+ if self.dry_run:
352
+ self.logger.info("[DRY-RUN] Terragrunt inputs rendered in %s; apply skipped", self.terragrunt_dir)
353
+ print(f"[DRY-RUN] Terragrunt inputs rendered in {self.terragrunt_dir}; apply skipped")
354
+ return {"output": "", "status": "success"}
355
+ self.refresh_access_token_if_needed()
356
+ retry_count = 0
357
+ while True:
358
+ try:
359
+ self.cleanup_terraform_states()
360
+
361
+ # Handle different authentication methods
362
+ if self.access_token and self.refresh_token:
363
+ self.logger.info("Using OAuth2 access token for authentication (API/Website mode)")
364
+ # Create a temporary credentials file for OAuth2 tokens
365
+ creds_file = os.path.join(self.terragrunt_dir, 'temp_creds.json')
366
+ with open(creds_file, 'w') as f:
367
+ json.dump({
368
+ "type": "authorized_user",
369
+ "client_id": Config.CLIENT_ID,
370
+ "client_secret": Config.CLIENT_SECRET,
371
+ "refresh_token": self.refresh_token,
372
+ "access_token": self.access_token
373
+ }, f)
374
+ os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = creds_file
375
+ elif self.service_account_key:
376
+ self.logger.info("Using service account key for authentication")
377
+ os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = self.service_account_key
378
+ else:
379
+ self.logger.info("Using local gcloud authentication (CLI mode)")
380
+ # Check if user is authenticated with gcloud
381
+ try:
382
+ result = subprocess.run(["gcloud", "auth", "list", "--filter=status:ACTIVE", "--format=value(account)"],
383
+ capture_output=True, text=True, check=True)
384
+ if result.stdout.strip():
385
+ self.logger.info(f"Using gcloud authentication for account: {result.stdout.strip()}")
386
+ else:
387
+ raise Exception("No active gcloud authentication found. Please run 'gcloud auth login' first.")
388
+ except subprocess.CalledProcessError as e:
389
+ self.logger.error(f"gcloud command failed with return code {e.returncode}")
390
+ self.logger.error(f"Error output: {e.stderr}")
391
+ raise Exception(f"gcloud command failed. Please ensure gcloud CLI is installed and run 'gcloud auth login' first. Error: {e.stderr}")
392
+ except FileNotFoundError:
393
+ if self.is_wsl_environment():
394
+ raise Exception("gcloud CLI not found in WSL2 environment. Please install Google Cloud SDK in WSL2:\n curl https://sdk.cloud.google.com | bash\n exec -l $SHELL\n gcloud init")
395
+ else:
396
+ raise Exception("gcloud CLI not found. Please install Google Cloud SDK and run 'gcloud auth login' first.")
397
+
398
+ # Run Terragrunt
399
+ output_message, exc = self.execute_command([
400
+ "terragrunt", "apply", "--all",
401
+ "--parallelism=1",
402
+ "--non-interactive",
403
+ "--no-color",
404
+ "--log-format=json",
405
+ "--log-level=info"
406
+ ])
407
+ if exc:
408
+ raise exc
409
+ return {
410
+ "output": output_message,
411
+ "status": "success"
412
+ }
413
+ except Exception as e:
414
+ retry_count += 1
415
+ if retry_count >= max_retries:
416
+ return {
417
+ "output": str(e),
418
+ "status": "failure"
419
+ }
420
+ self.logger.warning("Retry %s/%s after error: %s", retry_count, max_retries, e)
421
+ time.sleep(5) # wait for 5 seconds before retrying
422
+ finally:
423
+ self.cleanup_terraform_states()
424
+ # Remove the temporary credentials file if it was created
425
+ if os.path.exists(os.path.join(self.terragrunt_dir, 'temp_creds.json')):
426
+ os.remove(os.path.join(self.terragrunt_dir, 'temp_creds.json'))
427
+
428
+ def run(self):
429
+ """Main execution method"""
430
+ self.logger.info("Starting GCP infrastructure deployment for customer: %s", self.customer)
431
+ try:
432
+ # Render all template files
433
+ self.logger.info("Rendering Terraform template files")
434
+ if self.terraform_state == "remote":
435
+ self.render_backend_tf()
436
+ self.render_defaults_yaml()
437
+ self.render_env_yaml()
438
+ self.render_terragrunt_hcl()
439
+
440
+ # Deploy infrastructure
441
+ self.logger.info("Deploying GCP infrastructure using Terragrunt")
442
+ result = self.deploy_gcp_terragrunt()
443
+
444
+ if result["status"] == "success":
445
+ self.logger.info("GCP infrastructure deployment completed successfully")
446
+
447
+ # Add deployment record to metadata collector if available
448
+ if self.metadata_collector:
449
+ deployment_record = {
450
+ "customer": self.customer,
451
+ "deployment_environment": self.deployment_environemnt,
452
+ "cloud_provider": self.cloud_provider,
453
+ "project_id": self.project_id,
454
+ "region": self.region,
455
+ "deploy_date": datetime.datetime.now().strftime("%Y-%m-%d"),
456
+ "status": "success"
457
+ }
458
+ self.metadata_collector.add_deployment_record(deployment_record)
459
+ self.logger.info("Deployment record added to metadata collector")
460
+
461
+ return "GCP infrastructure deployed successfully"
462
+ else:
463
+ self.logger.error("GCP infrastructure deployment failed")
464
+ return f"GCP infrastructure deployment failed: {result['output']}"
465
+
466
+ except Exception as e:
467
+ self.logger.error("Deployment failed: %s", str(e))
468
+ raise
469
+
470
+ @classmethod
471
+ def from_cli_args(cls, args, logger=None):
472
+ """Create a GoogleCloudManager instance from CLI arguments"""
473
+ if logger:
474
+ logger.info("Creating GoogleCloudManager instance from CLI arguments")
475
+ return cls(
476
+ deployment=args.deployment,
477
+ billing_account_id=args.billing_account_id,
478
+ parent_folder=args.parent_folder,
479
+ customer=args.customer,
480
+ domain_name=args.domain_name,
481
+ admin_email=args.admin_email,
482
+ whitelisted_ips=args.whitelisted_ips,
483
+ region=args.region,
484
+ project_id=args.project_id,
485
+ cloud_provider=args.cloud_provider,
486
+ cidr_block=args.cidr_block,
487
+ cluster_ipv4_cidr_block=args.cluster_ipv4_cidr_block,
488
+ services_ipv4_cidr_block=args.services_ipv4_cidr_block,
489
+ private_service_connect_cidr=args.private_service_connect_cidr,
490
+ lb_subnet_cidr=args.lb_subnet_cidr,
491
+ shared_host=args.shared_host,
492
+ kubernetes_version=args.kubernetes_version,
493
+ gke_machine_type=args.gke_machine_type,
494
+ gke_spot=args.gke_spot,
495
+ k8s_master_ipv4_cidr_block=args.k8s_master_ipv4_cidr_block,
496
+ terraform_state=args.terraform_state,
497
+ state_project=args.state_project,
498
+ state_location=args.state_location,
499
+ state_bucket=args.state_bucket,
500
+ gke_deployment_type=args.gke_deployment_type,
501
+ service_account_key=args.service_account_key,
502
+ access_token=args.access_token,
503
+ refresh_token=args.refresh_token,
504
+ token_expiry=args.token_expiry,
505
+ token_key=args.token_key,
506
+ metadata_collector=args.metadata_collector,
507
+ logger=logger
508
+ )
509
+
510
+
511
+ if __name__ == "__main__":
512
+ # Parse arguments first to check for debug flag
513
+ parser = argparse.ArgumentParser(
514
+ description="GCP Infrastructure Deployment Tool",
515
+ formatter_class=argparse.RawDescriptionHelpFormatter
516
+ )
517
+
518
+ # Add debug argument early so we can use it for logging setup
519
+ parser.add_argument('--debug', action='store_true', help='Enable debug logging')
520
+
521
+ # Parse only the debug argument for now
522
+ args, _ = parser.parse_known_args()
523
+
524
+ # Setup logging with debug flag if provided
525
+ logger = setup_logging(debug=args.debug)
526
+ logger.info("Starting GCP deployment script")
527
+
528
+ # Required core arguments
529
+ required_args = parser.add_argument_group('required core arguments')
530
+ required_args.add_argument(
531
+ '--deployment',
532
+ required=True,
533
+ choices=['basic', 'advanced'],
534
+ help='Deployment environment (basic or advanced)'
535
+ )
536
+ required_args.add_argument(
537
+ '--billing_account_id',
538
+ required=True,
539
+ help='GCP billing account ID'
540
+ )
541
+ required_args.add_argument(
542
+ '--parent_folder',
543
+ required=True,
544
+ help='GCP parent folder ID'
545
+ )
546
+ required_args.add_argument(
547
+ '--customer',
548
+ required=True,
549
+ help='Customer tenant name (lowercase letters, numbers, and hyphens only)'
550
+ )
551
+ required_args.add_argument(
552
+ '--domain_name',
553
+ required=True,
554
+ help='Domain name for the customer (e.g., fast2.dev)'
555
+ )
556
+ required_args.add_argument(
557
+ '--admin_email',
558
+ required=True,
559
+ help='Admin email address'
560
+ )
561
+ required_args.add_argument(
562
+ '--whitelisted_ips',
563
+ required=True,
564
+ help='Comma-separated list of whitelisted IP addresses'
565
+ )
566
+ required_args.add_argument(
567
+ '--region',
568
+ required=True,
569
+ help='GCP region for deployment'
570
+ )
571
+
572
+ # Optional arguments
573
+ optional_args = parser.add_argument_group('optional arguments')
574
+ optional_args.add_argument(
575
+ '--project_id',
576
+ help='GCP project ID (default: fast2dev-{customer})'
577
+ )
578
+ optional_args.add_argument(
579
+ '--cloud_provider',
580
+ default='gcp',
581
+ help='Cloud provider (default: gcp)'
582
+ )
583
+ optional_args.add_argument(
584
+ '--cidr_block',
585
+ help='CIDR block for VPC'
586
+ )
587
+ optional_args.add_argument(
588
+ '--cluster_ipv4_cidr_block',
589
+ help='Cluster IPv4 CIDR block'
590
+ )
591
+ optional_args.add_argument(
592
+ '--services_ipv4_cidr_block',
593
+ help='Services IPv4 CIDR block'
594
+ )
595
+ optional_args.add_argument(
596
+ '--private_service_connect_cidr',
597
+ help='Private service connect CIDR'
598
+ )
599
+ optional_args.add_argument(
600
+ '--lb_subnet_cidr',
601
+ help='Load balancer subnet CIDR'
602
+ )
603
+ optional_args.add_argument(
604
+ '--shared_host',
605
+ help='Shared host configuration'
606
+ )
607
+ optional_args.add_argument(
608
+ '--kubernetes_version',
609
+ help='Kubernetes version'
610
+ )
611
+ optional_args.add_argument(
612
+ '--gke_machine_type',
613
+ help='GKE machine type'
614
+ )
615
+ optional_args.add_argument(
616
+ '--gke_spot',
617
+ help='GKE spot instance configuration'
618
+ )
619
+ optional_args.add_argument(
620
+ '--k8s_master_ipv4_cidr_block',
621
+ help='Kubernetes master IPv4 CIDR block'
622
+ )
623
+ optional_args.add_argument(
624
+ '--terraform_state',
625
+ choices=['local', 'remote'],
626
+ default='local',
627
+ help='Terraform state backend type (default: local)'
628
+ )
629
+ optional_args.add_argument(
630
+ '--state_project',
631
+ help='GCP project ID for remote state bucket (required if terraform_state=remote)'
632
+ )
633
+ optional_args.add_argument(
634
+ '--state_location',
635
+ help='GCS bucket location for remote state (required if terraform_state=remote)'
636
+ )
637
+ optional_args.add_argument(
638
+ '--state_bucket',
639
+ help='GCS bucket name for remote state (required if terraform_state=remote)'
640
+ )
641
+ optional_args.add_argument(
642
+ '--gke_deployment_type',
643
+ choices=['zonal', 'multizone'],
644
+ default='zonal',
645
+ help='GKE deployment type: zonal for free tier, multizone for production (default: zonal)'
646
+ )
647
+
648
+ # Authentication arguments
649
+ auth_args = parser.add_argument_group('authentication')
650
+ auth_args.add_argument(
651
+ '--service_account_key',
652
+ help='Path to service account key file (for service account authentication)'
653
+ )
654
+ auth_args.add_argument(
655
+ '--access_token',
656
+ help='OAuth2 access token (for API/website authentication - use with refresh_token)'
657
+ )
658
+ auth_args.add_argument(
659
+ '--refresh_token',
660
+ help='OAuth2 refresh token (for API/website authentication - use with access_token)'
661
+ )
662
+ auth_args.add_argument(
663
+ '--token_expiry',
664
+ type=float,
665
+ help='Token expiry timestamp (for API/website authentication)'
666
+ )
667
+ auth_args.add_argument(
668
+ '--token_key',
669
+ help='Token key for database storage (for API/website authentication)'
670
+ )
671
+ auth_args.add_argument(
672
+ '--use_gcloud_auth',
673
+ action='store_true',
674
+ help='Use local gcloud authentication (run "gcloud auth login" first)'
675
+ )
676
+
677
+ # Metadata arguments
678
+ metadata_args = parser.add_argument_group('metadata')
679
+ metadata_args.add_argument(
680
+ '--metadata_file',
681
+ default='deployment_metadata.json',
682
+ help='Path to metadata file (default: deployment_metadata.json)'
683
+ )
684
+ metadata_args.add_argument(
685
+ '--skip_metadata',
686
+ action='store_true',
687
+ help='Skip metadata collection (for CLI usage)'
688
+ )
689
+ # Parse arguments
690
+ args = parser.parse_args()
691
+
692
+ try:
693
+ logger.info("Deploying GCP infrastructure for customer: %s", args.customer)
694
+ logger.info("Deployment environment: %s", args.deployment)
695
+
696
+ # Check authentication method
697
+ auth_methods = []
698
+ if args.service_account_key:
699
+ auth_methods.append("service account key")
700
+ if args.access_token and args.refresh_token:
701
+ auth_methods.append("OAuth2 tokens")
702
+ if args.use_gcloud_auth or (not args.service_account_key and not args.access_token):
703
+ auth_methods.append("gcloud CLI")
704
+
705
+ if len(auth_methods) > 1:
706
+ logger.warning("Multiple authentication methods specified: %s. Using priority order.", ", ".join(auth_methods))
707
+
708
+ # If using gcloud auth, check if it's properly configured
709
+ if args.use_gcloud_auth or (not args.service_account_key and not args.access_token):
710
+ logger.info("Checking gcloud authentication...")
711
+ # Note: We'll check this again in the deployment method, but provide early feedback
712
+ logger.info("Make sure you have run 'gcloud auth login' and 'gcloud config set project %s'",
713
+ args.project_id if args.project_id else f"fast2dev-{args.customer}")
714
+
715
+ # Create a simple metadata collector for CLI usage
716
+ class SimpleMetadataCollector:
717
+ def __init__(self, metadata_file):
718
+ self.metadata_file = metadata_file
719
+ self.deployment_records = []
720
+ if os.path.exists(metadata_file):
721
+ try:
722
+ with open(metadata_file, 'r') as f:
723
+ self.deployment_records = json.load(f)
724
+ logger.info("Loaded %s existing deployment records", len(self.deployment_records))
725
+ except json.JSONDecodeError:
726
+ logger.warning("Could not parse %s, starting with empty records", metadata_file)
727
+ self.deployment_records = []
728
+ else:
729
+ logger.info("Metadata file %s not found, will create new file", metadata_file)
730
+
731
+ def add_deployment_record(self, record):
732
+ self.deployment_records.append(record)
733
+ try:
734
+ # Ensure directory exists
735
+ os.makedirs(os.path.dirname(os.path.abspath(self.metadata_file)), exist_ok=True)
736
+ with open(self.metadata_file, 'w') as f:
737
+ json.dump(self.deployment_records, f, indent=2)
738
+ logger.info("Deployment record added to %s", self.metadata_file)
739
+ except Exception as e:
740
+ logger.error("Failed to write metadata to %s: %s", self.metadata_file, str(e))
741
+
742
+ # Use the appropriate metadata collector
743
+ if args.skip_metadata:
744
+ logger.info("Metadata collection is disabled")
745
+ class DummyMetadataCollector:
746
+ def add_deployment_record(self, record):
747
+ logger.info("Metadata collection skipped")
748
+ metadata_collector = DummyMetadataCollector()
749
+ else:
750
+ logger.info("Using metadata file: %s", args.metadata_file)
751
+ metadata_collector = SimpleMetadataCollector(args.metadata_file)
752
+
753
+ # Add metadata collector to args for from_cli_args method
754
+ args.metadata_collector = metadata_collector
755
+
756
+ # Create deployer instance using the CLI factory method
757
+ logger.info("Creating GoogleCloudManager instance")
758
+ deployer = GoogleCloudManager.from_cli_args(args)
759
+
760
+ # Run the deployment
761
+ logger.info("Starting deployment process")
762
+ result = deployer.run()
763
+
764
+ logger.info("Execution Result: %s", str(result))
765
+ print("Execution Result:")
766
+ print(result)
767
+
768
+ except FileNotFoundError as e:
769
+ logger.error("File not found error: %s", str(e))
770
+ print(f"File not found error: {str(e)}")
771
+ sys.exit(1)
772
+ except ValueError as e:
773
+ logger.error("Invalid value error: %s", str(e))
774
+ print(f"Invalid value error: {str(e)}")
775
+ sys.exit(1)
776
+ except subprocess.CalledProcessError as e:
777
+ logger.error("Command execution failed: %s", str(e))
778
+ print(f"Command execution failed: {str(e)}")
779
+ sys.exit(1)
780
+ except Exception as e:
781
+ logger.error("An unexpected error occurred: %s", str(e), exc_info=True)
782
+ print(f"An unexpected error occurred: {str(e)}")
783
+ sys.exit(1)
784
+ finally:
785
+ logger.info("GCP deployment script completed")