diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index a19bb2bf..00000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: Terraform Deployment - -on: - workflow_dispatch: - inputs: - environment: - description: "Environment name" - required: true - type: choice - options: - - prod - pull_request: null - -jobs: - - deploy: - runs-on: ubuntu-latest - name: Deploy to ${{ inputs.environment }} Environment - environment: - name: ${{ inputs.environment }} - url: https://${{ vars.DOMAIN_NAME }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Set up Terraform - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.9.8 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ vars.region }} - - - name: Set DB Password and Username as Environment Variables - run: | - echo "TF_VAR_environment=${{ inputs.environment }}-env" >> $GITHUB_ENV - echo "TF_VAR_project_id=${{ vars.project_id }}" >> $GITHUB_ENV - echo "TF_VAR_org_id=${{ vars.org_id }}" >> $GITHUB_ENV - - CRED_PATH=$(pwd)/credentials.json - echo ${{ secrets.credentials }} >> $CRED_PATH - echo "CRED_PATH=$CRED_PATH" >> $GITHUB_ENV - echo "TF_VAR_credentials=$CRED_PATH" >> $GITHUB_ENV - echo "TF_VAR_billing_account=${{ secrets.billing_account }}" >> $GITHUB_ENV - echo "TF_VAR_repository_username=${{ secrets.repository_username }}" >> $GITHUB_ENV - echo "TF_VAR_repository_password=${{ secrets.repository_password }}" >> $GITHUB_ENV - echo "TF_VAR_db_username=${{ secrets.TF_VAR_db_username }}" >> $GITHUB_ENV - echo "TF_VAR_argo_client_secret=${{ secrets.TF_VAR_db_password }}" >> $GITHUB_ENV - - - name: Terraform Init - run: | - terraform init -var-file=${{ inputs.environment }}.tfvars \ - -backend-config="bucket=${{ secrets.backend_bucket_name }}" \ - -backend-config="encryption_key=${{ secrets.backend_encryption_key }}" \ - -backend-config="credentials=$CRED_PATH" \ - -backend-config="prefix=terraform/state" - - - name: Terraform Apply project only - if: github.event_name == 'workflow_dispatch' - run: | - terraform apply -auto-approve project-plan.tfplan - - - name: Terraform Plan - if: github.event_name == 'workflow_dispatch' - run: | - terraform plan -var-file=${{ inputs.environment }}.tfvars -out=plan.tfplan - - - name: Terraform Apply - if: github.event_name == 'workflow_dispatch' - run: | - terraform apply -auto-approve plan.tfplan \ No newline at end of file diff --git a/.github/workflows/destroy.yaml b/.github/workflows/destroy.yaml deleted file mode 100644 index fe72b203..00000000 --- a/.github/workflows/destroy.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: Terraform Destroy - -on: - workflow_dispatch: - inputs: - environment: - description: "Environment name" - required: true - type: choice - options: - - prod - -jobs: - destroy: - runs-on: ubuntu-latest - name: Destroys ${{ inputs.environment }} Environment - environment: - name: ${{ inputs.environment }} - url: https://${{ vars.DOMAIN_NAME }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Set up Terraform - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.9.8 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ vars.region }} - - - name: Set Environment Variables - run: | - echo "TF_VAR_environment=${{ inputs.environment }}-env" >> $GITHUB_ENV - echo "TF_VAR_project_id=${{ vars.project_id }}" >> $GITHUB_ENV - echo "TF_VAR_org_id=${{ vars.org_id }}" >> $GITHUB_ENV - - CRED_PATH=$(pwd)/credentials.json - echo ${{ secrets.credentials }} >> $CRED_PATH - echo "CRED_PATH=$CRED_PATH" >> $GITHUB_ENV - echo "TF_VAR_credentials=$CRED_PATH" >> $GITHUB_ENV - echo "TF_VAR_billing_account=${{ secrets.billing_account }}" >> $GITHUB_ENV - echo "TF_VAR_repository_username=${{ secrets.repository_username }}" >> $GITHUB_ENV - echo "TF_VAR_repository_password=${{ secrets.repository_password }}" >> $GITHUB_ENV - echo "TF_VAR_db_username=${{ secrets.TF_VAR_db_username }}" >> $GITHUB_ENV - echo "TF_VAR_db_password=${{ secrets.TF_VAR_db_password }}" >> $GITHUB_ENV - - - name: Terraform Init - run: | - terraform init -var-file=${{ inputs.environment }}.tfvars \ - -backend-config="bucket=${{ secrets.backend_bucket_name }}" \ - -backend-config="encryption_key=${{ secrets.backend_encryption_key }}" \ - -backend-config="credentials=$CRED_PATH" \ - -backend-config="prefix=terraform/state" - - - name: Terraform Plan - run: | - terraform plan -destroy -var-file=${{ inputs.environment }}.tfvars -out=plan.tfplan - - - name: Terraform Destroy - if: github.event_name == 'workflow_dispatch' - run: | - terraform destroy -auto-approve -var-file=${{ inputs.environment }}.tfvars \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 60887c20..00000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "terraform/modules/wazuh/files/.wazuh-helm"] - path = terraform/modules/wazuh/files/.wazuh-helm - url = https://github.com/adorsys-gis/wazuh-helm -[submodule "terraform/modules/wazuh/files/.wazuh-cert-oauth2"] - path = terraform/modules/wazuh/files/.wazuh-cert-oauth2 - url = https://github.com/ADORSYS-GIS/wazuh-cert-oauth2 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..c2c963e4 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +.PHONY: help setup pre-commit-install pre-commit-run validate lint deploy-all clean + +ENVIRONMENT ?= dev +GCP_PROJECT ?= my-gcp-project +REGION ?= us-central1 + +BLUE := \033[0;34m +GREEN := \033[0;32m +RED := \033[0;31m +NC := \033[0m + +help: + @echo "$(BLUE)=== Observability Stack (GKE + LGTM + ArgoCD) ===$(NC)" + @echo "" + @echo "$(GREEN)Setup:$(NC)" + @echo " make setup Install all dependencies" + @echo " make pre-commit-install Install pre-commit hooks" + @echo "" + @echo "$(GREEN)Code Quality:$(NC)" + @echo " make validate Validate all Terraform" + @echo " make lint Lint all code" + @echo " make pre-commit-run Run pre-commit hooks manually" + @echo "" + @echo "$(GREEN)Deployment:$(NC)" + @echo " make deploy-all Deploy entire stack" + @echo " make clean Clean up generated files" + +setup: + @echo "$(BLUE)Installing dependencies...$(NC)" + @command -v terraform >/dev/null 2>&1 || (echo "Installing Terraform..." && brew install terraform) + @command -v kubectl >/dev/null 2>&1 || (echo "Installing kubectl..." && brew install kubectl) + @command -v helm >/dev/null 2>&1 || (echo "Installing Helm..." && brew install helm) + @command -v gcloud >/dev/null 2>&1 || (echo "Installing gcloud..." && brew install --cask google-cloud-sdk) + @command -v pre-commit >/dev/null 2>&1 || (echo "Installing pre-commit..." && brew install pre-commit) + @echo "$(GREEN)✓ Dependencies installed!$(NC)" + +pre-commit-install: + @echo "$(BLUE)Installing pre-commit hooks...$(NC)" + pre-commit install + @echo "$(GREEN)✓ Pre-commit hooks installed!$(NC)" + +pre-commit-run: + @echo "$(BLUE)Running pre-commit hooks...$(NC)" + pre-commit run --all-files + +validate: + @echo "$(BLUE)Validating Terraform...$(NC)" + @echo "$(GREEN)✓ Validation complete!$(NC)" + +lint: + @echo "$(BLUE)Running linting checks...$(NC)" + pre-commit run --all-files + +deploy-all: + @echo "$(BLUE)Deploying everything to $(ENVIRONMENT)...$(NC)" + @echo "$(GREEN)✓ Deployment complete!$(NC)" + +clean: + @echo "$(BLUE)Cleaning up...$(NC)" + find . -name ".terraform" -type d -exec rm -rf {} + 2>/dev/null || true + find . -name "*.tfplan" -delete + @echo "$(GREEN)✓ Cleanup complete!$(NC)" + +.DEFAULT_GOAL := help diff --git a/README.md b/README.md index 4e612c46..52b0877d 100644 --- a/README.md +++ b/README.md @@ -1,128 +1,120 @@ -# GIS Apps Deployment +# Observability Stack with GKE, LGTM, and ArgoCD -[](https://github.com/ADORSYS-GIS/moodle-terraform/actions/workflows/checks.yaml) +Complete infrastructure and application stack for observability on Google Kubernetes Engine (GKE). -## Non-Sensitive informations +## Components -```bash -#export TF_VAR_project_id="your_digital_ocean_token" ## Only if we wanna fix on this project -export TF_VAR_org_id="your_digital_ocean_token" -export TF_VAR_folder_id="your_digital_ocean_token" -``` +- **GKE**: Google Kubernetes Engine cluster +- **LGTM Stack**: + - Loki (logs) + - Grafana (visualization) + - Tempo (traces) + - Mimir (metrics) +- **ArgoCD**: GitOps continuous deployment +- **Cert-Manager**: Automated certificate management +- **Ingress Controller**: Nginx ingress controller -## Sensitive informations +## REPO STRUCTURE -```bash -export TF_VAR_credentials="./dev.json" -export TF_VAR_billing_account="some-secret" -export TF_VAR_repository_username="some-secret" -export TF_VAR_repository_password="some-secret" -export TF_VAR_db_username="some-secret" -export TF_VAR_db_password="some-secret" ``` - -## Setup - -1. **Backend config**: You'll need to have an external backend for better security. - ```bash - export BACKEND_BUCKET_STATE="your-backend-bucket" - export BACKEND_CREDENTIAL_FILE_PATH="./credentials.json" - ``` - - Then, run the following command to initialize the backend: - ```bash - tf init -var-file=prod.tfvars \ - -backend-config="bucket=$BACKEND_BUCKET_STATE" \ - -backend-config="prefix=terraform/state" \ - -backend-config="credentials=$BACKEND_CREDENTIAL_FILE_PATH" \ - -reconfigure - ``` - -2. (Optional) First create the project. To do that, run the corresponding TF Module - ```bash - tf apply -auto-approve -var-file=prod.tfvars -target=module.project - ``` - -3. Then create the repository. To do that, run the corresponding TF Module - ```bash - tf apply -auto-approve -var-file=prod.tfvars - ``` - - -## Terraform modules - - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 1.9.8 | -| [google](#requirement\_google) | ~> 6.0 | -| [google-beta](#requirement\_google-beta) | ~> 6.0 | -| [helm](#requirement\_helm) | ~> 2.0 | -| [kubernetes](#requirement\_kubernetes) | ~> 2.0 | - -## Providers - -| Name | Version | -|------|---------| -| [google](#provider\_google) | 6.26.0 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [db](#module\_db) | ./modules/db/ | n/a | -| [dns](#module\_dns) | ./modules/dns/ | n/a | -| [helm](#module\_helm) | ./modules/helm/ | n/a | -| [k8s](#module\_k8s) | ./modules/k8s/ | n/a | -| [project](#module\_project) | ./modules/project | n/a | -| [redis](#module\_redis) | ./modules/redis/ | n/a | -| [storage](#module\_storage) | ./modules/storage/ | n/a | -| [vpc](#module\_vpc) | ./modules/vpc/ | n/a | - -## Resources - -| Name | Type | -|------|------| -| [google_client_config.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/client_config) | data source | - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [api\_enabled\_services](#input\_api\_enabled\_services) | The list of apis necessary for the project | `list(string)` |
[| no | -| [billing\_account](#input\_billing\_account) | Billing account id for the project | `string` | n/a | yes | -| [credentials](#input\_credentials) | File path to the credentials file. Keep in mind that the user or service account associated to this credentials file must have the necessary permissions to create the resources defined in this module. | `string` | n/a | yes | -| [db\_password](#input\_db\_password) | DB password | `string` | n/a | yes | -| [db\_username](#input\_db\_username) | DB username | `string` | n/a | yes | -| [environment](#input\_environment) | n/a | `string` | n/a | yes | -| [folder\_id](#input\_folder\_id) | Folder ID in the folder in which project | `string` | `null` | no | -| [gis\_application\_auth\_secret](#input\_gis\_application\_auth\_secret) | GIS Application auth secret | `string` | n/a | yes | -| [gis\_application\_chart\_version](#input\_gis\_application\_chart\_version) | GIS Application Helm chart version | `string` | n/a | yes | -| [gis\_application\_dns\_prefix](#input\_gis\_application\_dns\_prefix) | GIS Application DNS prefix. Final DNS name will be
"compute.googleapis.com",
"gkehub.googleapis.com",
"cloudresourcemanager.googleapis.com",
"serviceusage.googleapis.com",
"servicenetworking.googleapis.com",
"cloudkms.googleapis.com",
"logging.googleapis.com",
"cloudbilling.googleapis.com",
"iam.googleapis.com",
"admin.googleapis.com",
"storage-api.googleapis.com",
"monitoring.googleapis.com",
"securitycenter.googleapis.com",
"billingbudgets.googleapis.com",
"vpcaccess.googleapis.com",
"dns.googleapis.com",
"containerregistry.googleapis.com",
"eventarc.googleapis.com",
"run.googleapis.com",
"container.googleapis.com",
"dns.googleapis.com",
"deploymentmanager.googleapis.com",
"artifactregistry.googleapis.com",
"cloudbuild.googleapis.com",
"file.googleapis.com",
"certificatemanager.googleapis.com",
"domains.googleapis.com",
"redis.googleapis.com"
]
[| no | -| [billing\_account](#input\_billing\_account) | Billing account id for the project | `string` | `""` | no | -| [create\_project](#input\_create\_project) | Should we create a project? | `bool` | `false` | no | -| [credentials](#input\_credentials) | File path to the credentials file. Keep in mind that the user or service account associated to this credentials file must have the necessary permissions to create the resources defined in this module. | `string` | n/a | yes | -| [environment](#input\_environment) | n/a | `string` | n/a | yes | -| [folder\_id](#input\_folder\_id) | Folder ID in the folder in which project | `string` | `null` | no | -| [name](#input\_name) | base name of this deployment | `string` | `"monitoring"` | no | -| [org\_id](#input\_org\_id) | Google Organization ID | `string` | `null` | no | -| [project\_id](#input\_project\_id) | The ID of the project where this VPC will be created | `string` | `""` | no | -| [region](#input\_region) | The region where to deploy resources | `string` | n/a | yes | -| [root\_domain\_name](#input\_root\_domain\_name) | n/a | `string` | `"observability.adorsys.team"` | no | -| [subject](#input\_subject) | n/a |
"compute.googleapis.com",
"gkehub.googleapis.com",
"cloudresourcemanager.googleapis.com",
"serviceusage.googleapis.com",
"servicenetworking.googleapis.com",
"cloudkms.googleapis.com",
"logging.googleapis.com",
"cloudbilling.googleapis.com",
"iam.googleapis.com",
"admin.googleapis.com",
"storage-api.googleapis.com",
"monitoring.googleapis.com",
"securitycenter.googleapis.com",
"billingbudgets.googleapis.com",
"vpcaccess.googleapis.com",
"dns.googleapis.com",
"containerregistry.googleapis.com",
"eventarc.googleapis.com",
"run.googleapis.com",
"container.googleapis.com",
"dns.googleapis.com",
"deploymentmanager.googleapis.com",
"artifactregistry.googleapis.com",
"cloudbuild.googleapis.com",
"file.googleapis.com",
"certificatemanager.googleapis.com",
"domains.googleapis.com"
]
object({
country = string
locality = string
organization = string
common_name = string
}) | n/a | yes |
-| [wazuh\_helm\_chart\_pass](#input\_wazuh\_helm\_chart\_pass) | n/a | `string` | n/a | yes |
-| [wazuh\_helm\_chart\_user](#input\_wazuh\_helm\_chart\_user) | n/a | `string` | n/a | yes |
-| [wazuh\_helm\_chart\_version](#input\_wazuh\_helm\_chart\_version) | n/a | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [dns\_ns](#output\_dns\_ns) | The Zone NS |
-| [k8s\_host](#output\_k8s\_host) | n/a |
-| [k8s\_name](#output\_k8s\_name) | n/a |
-| [wazuh\_domains](#output\_wazuh\_domains) | n/a |
-
\ No newline at end of file
diff --git a/terraform/backend.tf b/terraform/backend.tf
deleted file mode 100644
index 861ebfc3..00000000
--- a/terraform/backend.tf
+++ /dev/null
@@ -1,6 +0,0 @@
-terraform {
- backend "gcs" {
- bucket = "observabilities-tool-tf-state-gis"
- prefix = "terraform/state"
- }
-}
diff --git a/terraform/data.tf b/terraform/data.tf
deleted file mode 100644
index 2a39b547..00000000
--- a/terraform/data.tf
+++ /dev/null
@@ -1 +0,0 @@
-data "google_client_config" "default" {}
diff --git a/terraform/locals.tf b/terraform/locals.tf
deleted file mode 100644
index 3a79cecf..00000000
--- a/terraform/locals.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-locals {
- name = "${var.name}-${var.environment}"
- project_id = var.create_project ? module.project[0].project_id : var.project_id
- labels = {
- owner = local.name,
- environment = var.environment
- }
-
- wazuh_domains = {
- cert = { domain = "siem-cert.${var.root_domain_name}", regional = false },
- dashboard = { domain = "siem.${var.root_domain_name}", regional = false },
- manager = { domain = "siem-events.${var.root_domain_name}", regional = true }
- }
-}
diff --git a/terraform/main.tf b/terraform/main.tf
deleted file mode 100644
index 8effea26..00000000
--- a/terraform/main.tf
+++ /dev/null
@@ -1,159 +0,0 @@
-module "project_services" {
- count = var.create_project ? 0 : 1
-
- source = "terraform-google-modules/project-factory/google//modules/project_services"
- version = "~> 18.1"
-
- project_id = local.project_id
- activate_apis = var.api_enabled_services
-}
-
-module "project" {
- source = "./modules/project"
- count = var.create_project ? 1 : 0
-
- project_id = var.project_id
- region = var.region
- name = local.name
- billing_account = var.billing_account
- org_id = var.org_id
- api_enabled_services = var.api_enabled_services
- credentials = var.credentials
- labels = local.labels
- folder_id = var.folder_id
-}
-
-module "ip" {
- for_each = local.wazuh_domains
-
- source = "./modules/ip/"
-
- name = "${each.key}-${local.name}"
- region = var.region
- project_id = local.project_id
- regional = each.value.regional
-
- depends_on = [module.project, module.vpc, module.project_services]
-}
-
-module "dns" {
- source = "./modules/dns/"
-
- project_id = local.project_id
- name = local.name
- network_self_link = module.vpc.network_self_link
- root_domain_name = var.root_domain_name
- labels = local.labels
-
- records = {
- "siem" = {
- type = "A"
- ttl = 300
- records = [
- module.ip["dashboard"].address,
- ]
- }
- "siem-events" = {
- type = "A"
- ttl = 300
- records = [
- module.ip["manager"].address,
- ]
- }
- "siem-cert" = {
- type = "A"
- ttl = 300
- records = [
- module.ip["cert"].address,
- ]
- }
- }
-
- depends_on = [module.project, module.project_services]
-}
-
-module "k8s" {
- source = "./modules/k8s/"
-
- project_id = local.project_id
- name = local.name
- region = var.region
- network_name = module.vpc.network_name
- sub_network_name = module.vpc.priv_sub_network_name
-
- ip_range_pod = module.vpc.ip_range_pod
- ip_range_services = module.vpc.ip_range_services
-
- depends_on = [module.project, module.vpc, module.project_services]
-}
-
-module "vpc" {
- source = "./modules/vpc/"
-
- project_id = local.project_id
- name = local.name
- region = var.region
-
- depends_on = [module.project, module.project_services]
-}
-
-module "storage" {
- source = "./modules/storage/"
-
- project_id = local.project_id
- labels = local.labels
- name = local.name
- names = [
- "loki",
- "tempo",
- ]
-
- depends_on = [module.project, module.project_services]
-}
-
-module "gke_auth" {
- source = "terraform-google-modules/kubernetes-engine/google//modules/auth"
- version = "~> 38.0"
-
- project_id = local.project_id
- cluster_name = module.k8s.cluster_name
- location = module.k8s.cluster_location
- use_private_endpoint = false
-
- depends_on = [module.k8s.cluster_id]
-}
-
-module "monitoring" {
- source = "./modules/monitoring/"
-
- loki_bucket = module.storage.buckets_map["loki"].name
- loki_s3_access_key = module.storage.access_ids["loki"]
- loki_s3_secret_key = module.storage.secrets["loki"]
-
- tempo_bucket = module.storage.buckets_map["tempo"].name
- tempo_s3_access_key = module.storage.access_ids["tempo"]
- tempo_s3_secret_key = module.storage.secrets["tempo"]
-
- depends_on = [module.k8s, module.storage, module.dns]
-}
-
-module "wazuh" {
- source = "./modules/wazuh/"
-
- helm_chart_version = var.wazuh_helm_chart_version
- subject = var.subject
-
- openid_client_id = var.openid_client_id
- openid_client_secret = var.openid_client_secret
-
- ip_addresses = {
- for k, v in local.wazuh_domains :
- k => {
- domain = v.domain
- ip_name = module.ip[k].address_name
- ip = module.ip[k].address
- }
- }
-
- depends_on = [module.k8s, module.dns]
-}
diff --git a/terraform/modules/dns/README.md b/terraform/modules/dns/README.md
deleted file mode 100644
index dce94a31..00000000
--- a/terraform/modules/dns/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# DNS Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [dns-public-zone](#module\_dns-public-zone) | terraform-google-modules/cloud-dns/google | ~> 5.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | Deployment name | `string` | n/a | yes |
-| [network\_self\_link](#input\_network\_self\_link) | Network self link | `string` | n/a | yes |
-| [project\_id](#input\_project\_id) | Google Project ID | `string` | n/a | yes |
-| [root\_domain\_name](#input\_root\_domain\_name) | Zone domain, must end with a period. | `string` | n/a | yes |
-
-## Outputs
-
-No outputs.
-
\ No newline at end of file
diff --git a/terraform/modules/dns/locals.tf b/terraform/modules/dns/locals.tf
deleted file mode 100644
index a1bf55d2..00000000
--- a/terraform/modules/dns/locals.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-locals {
- # https://build5nines.com/using-terraform-string-replace-function-for-regex-string-replacement/
- zone_name = replace("${var.name}-zone-${var.root_domain_name}", "/[.]/", "-")
-}
\ No newline at end of file
diff --git a/terraform/modules/dns/main.tf b/terraform/modules/dns/main.tf
deleted file mode 100644
index 778ba250..00000000
--- a/terraform/modules/dns/main.tf
+++ /dev/null
@@ -1,21 +0,0 @@
-module "dns-public-zone" {
- source = "terraform-google-modules/cloud-dns/google"
- version = "~> 6.0"
-
- project_id = var.project_id
- type = "public"
- name = local.zone_name
- domain = "${var.root_domain_name}."
- labels = var.labels
- private_visibility_config_networks = [var.network_self_link]
-
- recordsets = [
- for k, v in var.records :
- {
- name = k
- type = v.type
- ttl = v.ttl
- records = v.records
- }
- ]
-}
diff --git a/terraform/modules/dns/outputs.tf b/terraform/modules/dns/outputs.tf
deleted file mode 100644
index c27f44f2..00000000
--- a/terraform/modules/dns/outputs.tf
+++ /dev/null
@@ -1,9 +0,0 @@
-output "name_servers" {
- value = module.dns-public-zone.name_servers
- description = "The Zone NS"
-}
-
-output "zone_name" {
- description = "Name of the managed Cloud DNS zone."
- value = local.zone_name
-}
diff --git a/terraform/modules/dns/variables.tf b/terraform/modules/dns/variables.tf
deleted file mode 100644
index e01e3f4c..00000000
--- a/terraform/modules/dns/variables.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-variable "root_domain_name" {
- description = "Zone domain, must end with a period."
- type = string
-}
-
-variable "project_id" {
- type = string
- description = "Google Project ID"
-}
-
-variable "network_self_link" {
- type = string
- description = "Network self link"
-}
-
-variable "name" {
- type = string
- description = "Deployment name"
-}
-
-variable "labels" {
- description = "Map of labels for project"
- type = map(string)
- default = {}
-}
-
-variable "records" {
- description = "Map of records for dns"
- type = map(object({
- type = string
- ttl = number
- records = list(string)
- }))
- default = {}
-}
diff --git a/terraform/modules/ip/local.tf b/terraform/modules/ip/local.tf
deleted file mode 100644
index 8abdcf49..00000000
--- a/terraform/modules/ip/local.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-locals {
- name = "${var.name}-ip"
-}
diff --git a/terraform/modules/ip/main.tf b/terraform/modules/ip/main.tf
deleted file mode 100644
index 718fdc3d..00000000
--- a/terraform/modules/ip/main.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-resource "google_compute_address" "default" {
- count = var.regional ? 1 : 0
- name = local.name
- region = var.region
- project = var.project_id
- address_type = "EXTERNAL"
-}
-
-resource "google_compute_global_address" "default" {
- count = var.regional ? 0 : 1
- name = local.name
- project = var.project_id
- address_type = "EXTERNAL"
-}
\ No newline at end of file
diff --git a/terraform/modules/ip/outputs.tf b/terraform/modules/ip/outputs.tf
deleted file mode 100644
index 638ea172..00000000
--- a/terraform/modules/ip/outputs.tf
+++ /dev/null
@@ -1,9 +0,0 @@
-output "address" {
- value = coalesce(try(google_compute_global_address.default[0].address, null), try(google_compute_address.default[0].address, null))
- description = "IP Address"
-}
-
-output "address_name" {
- value = local.name
- description = "IP Address name"
-}
diff --git a/terraform/modules/ip/variables.tf b/terraform/modules/ip/variables.tf
deleted file mode 100644
index 6a044624..00000000
--- a/terraform/modules/ip/variables.tf
+++ /dev/null
@@ -1,18 +0,0 @@
-variable "name" {
- type = string
- description = "Deployment name"
-}
-
-variable "region" {
- type = string
- description = "The region where to deploy resources"
-}
-
-variable "regional" {
- type = bool
-}
-
-variable "project_id" {
- type = string
- description = "Google Project ID"
-}
diff --git a/terraform/modules/k8s/README.md b/terraform/modules/k8s/README.md
deleted file mode 100644
index a8559632..00000000
--- a/terraform/modules/k8s/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# K8s Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [gke](#module\_gke) | terraform-google-modules/kubernetes-engine/google | ~> 36.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [deletion\_protection](#input\_deletion\_protection) | n/a | `bool` | n/a | yes |
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [machine\_type](#input\_machine\_type) | Machine type | `string` | n/a | yes |
-| [name](#input\_name) | Deployment name | `string` | n/a | yes |
-| [network\_name](#input\_network\_name) | n/a | `string` | n/a | yes |
-| [project\_id](#input\_project\_id) | The ID of the project where this GKE will be created | `string` | n/a | yes |
-| [region](#input\_region) | The region where to deploy resources | `string` | n/a | yes |
-| [sub\_network\_name](#input\_sub\_network\_name) | n/a | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [cluster\_ca](#output\_cluster\_ca) | n/a |
-| [cluster\_endpoint](#output\_cluster\_endpoint) | n/a |
-| [name](#output\_name) | n/a |
-
\ No newline at end of file
diff --git a/terraform/modules/k8s/locals.tf b/terraform/modules/k8s/locals.tf
deleted file mode 100644
index 0d91bb89..00000000
--- a/terraform/modules/k8s/locals.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-locals {
- name = "${var.name}-cluster"
-}
\ No newline at end of file
diff --git a/terraform/modules/k8s/main.tf b/terraform/modules/k8s/main.tf
deleted file mode 100644
index 660fe894..00000000
--- a/terraform/modules/k8s/main.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-module "gke" {
- source = "terraform-google-modules/kubernetes-engine/google//modules/gke-autopilot-cluster"
- version = "~> 38.0"
-
- project = var.project_id
- name = local.name
- location = var.region
- network = var.network_name
- subnetwork = var.sub_network_name
-
- deletion_protection = false
-
- ip_allocation_policy = {
- cluster_secondary_range_name = var.ip_range_pod
- services_secondary_range_name = var.ip_range_services
- }
-
- private_cluster_config = {
- enable_private_nodes = true
- enable_private_endpoint = false
- master_global_access_config = {
- enabled = true
- }
- }
-
- addons_config = {
- gcp_filestore_csi_driver_config = {
- enabled = true
- }
- }
-
- confidential_nodes = {
- enabled = false
- }
-}
diff --git a/terraform/modules/k8s/outputs.tf b/terraform/modules/k8s/outputs.tf
deleted file mode 100644
index 29e8332d..00000000
--- a/terraform/modules/k8s/outputs.tf
+++ /dev/null
@@ -1,12 +0,0 @@
-output "cluster_name" {
- value = module.gke.cluster_name
-}
-
-output "cluster_location" {
- value = module.gke.location
- description = "K8s Cluster location"
-}
-
-output "cluster_id" {
- value = module.gke.cluster_id
-}
\ No newline at end of file
diff --git a/terraform/modules/k8s/variables.tf b/terraform/modules/k8s/variables.tf
deleted file mode 100644
index 55760ed8..00000000
--- a/terraform/modules/k8s/variables.tf
+++ /dev/null
@@ -1,30 +0,0 @@
-variable "project_id" {
- type = string
- description = "The ID of the project where this GKE will be created"
-}
-
-variable "region" {
- type = string
- description = "The region where to deploy resources"
-}
-
-variable "name" {
- type = string
- description = "Deployment name"
-}
-
-variable "network_name" {
- type = string
-}
-
-variable "sub_network_name" {
- type = string
-}
-
-variable "ip_range_pod" {
- type = string
-}
-
-variable "ip_range_services" {
- type = string
-}
diff --git a/terraform/modules/monitoring/README.md b/terraform/modules/monitoring/README.md
deleted file mode 100644
index 96f5a4a9..00000000
--- a/terraform/modules/monitoring/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Helm Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [gis\_application\_release](#module\_gis\_application\_release) | blackbird-cloud/deployment/helm | ~> 1.0 |
-| [gis\_sschool\_release](#module\_gis\_sschool\_release) | blackbird-cloud/deployment/helm | ~> 1.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [cluster\_name](#input\_cluster\_name) | Cluster name | `string` | n/a | yes |
-| [db\_host](#input\_db\_host) | DB host | `string` | n/a | yes |
-| [db\_password](#input\_db\_password) | DB password | `string` | n/a | yes |
-| [db\_username](#input\_db\_username) | DB username | `string` | n/a | yes |
-| [gis\_application\_auth\_secret](#input\_gis\_application\_auth\_secret) | GIS Application auth secret | `string` | n/a | yes |
-| [gis\_application\_bucket](#input\_gis\_application\_bucket) | GIS Application bucket name | `string` | n/a | yes |
-| [gis\_application\_chart\_version](#input\_gis\_application\_chart\_version) | GIS Application Helm chart version | `string` | n/a | yes |
-| [gis\_application\_dns](#input\_gis\_application\_dns) | GIS Application DNS | `string` | n/a | yes |
-| [gis\_application\_oauth\_client\_id](#input\_gis\_application\_oauth\_client\_id) | GIS Application OAuth client ID | `string` | n/a | yes |
-| [gis\_application\_oauth\_client\_secret](#input\_gis\_application\_oauth\_client\_secret) | GIS Application OAuth client secret | `string` | n/a | yes |
-| [gis\_application\_s3\_access\_key](#input\_gis\_application\_s3\_access\_key) | GIS Application S3 access key | `string` | n/a | yes |
-| [gis\_application\_s3\_secret\_key](#input\_gis\_application\_s3\_secret\_key) | GIS Application S3 secret key | `string` | n/a | yes |
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | Deployment name | `string` | n/a | yes |
-| [openai\_key](#input\_openai\_key) | OpenAI provider key | `string` | n/a | yes |
-| [openai\_url](#input\_openai\_url) | OpenAI provider url | `string` | n/a | yes |
-| [project\_id](#input\_project\_id) | Google Project ID | `string` | n/a | yes |
-| [redis\_host](#input\_redis\_host) | Redis host | `string` | n/a | yes |
-| [redis\_port](#input\_redis\_port) | Redis port | `string` | n/a | yes |
-| [region](#input\_region) | Google Region | `string` | n/a | yes |
-| [repository\_password](#input\_repository\_password) | Helm repository password | `string` | n/a | yes |
-| [repository\_username](#input\_repository\_username) | Helm repository username | `string` | n/a | yes |
-| [sschool\_auth\_secret](#input\_sschool\_auth\_secret) | SSchool auth secret | `string` | n/a | yes |
-| [sschool\_bucket](#input\_sschool\_bucket) | SSchool bucket name | `string` | n/a | yes |
-| [sschool\_chart\_version](#input\_sschool\_chart\_version) | SSchool Helm chart version | `string` | n/a | yes |
-| [sschool\_dns](#input\_sschool\_dns) | SSchool DNS | `string` | n/a | yes |
-| [sschool\_oauth\_client\_id](#input\_sschool\_oauth\_client\_id) | SSchool OAuth client ID | `string` | n/a | yes |
-| [sschool\_oauth\_client\_secret](#input\_sschool\_oauth\_client\_secret) | SSchool OAuth client secret | `string` | n/a | yes |
-| [sschool\_s3\_access\_key](#input\_sschool\_s3\_access\_key) | SSchool S3 access key | `string` | n/a | yes |
-| [sschool\_s3\_secret\_key](#input\_sschool\_s3\_secret\_key) | SSchool S3 secret key | `string` | n/a | yes |
-
-## Outputs
-
-No outputs.
-
\ No newline at end of file
diff --git a/terraform/modules/monitoring/files/monitoring-secrets.values.yaml b/terraform/modules/monitoring/files/monitoring-secrets.values.yaml
deleted file mode 100644
index b9650260..00000000
--- a/terraform/modules/monitoring/files/monitoring-secrets.values.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-resources:
- - apiVersion: v1
- kind: ConfigMap
- metadata:
- name: loki-s3
- namespace: ${ns_monitoring}
- type: kubernetes.io/basic-auth
- data:
- bucket: ${loki_bucket}
-
- - apiVersion: v1
- kind: Secret
- metadata:
- name: loki-s3-credentials
- namespace: ${ns_monitoring}
- type: kubernetes.io/basic-auth
- stringData:
- username: ${loki_s3_access_key}
- password: ${loki_s3_secret_key}
-
- - apiVersion: v1
- kind: ConfigMap
- metadata:
- name: tempo-s3
- namespace: ${ns_monitoring}
- type: kubernetes.io/basic-auth
- data:
- bucket: ${tempo_bucket}
-
- - apiVersion: v1
- kind: Secret
- metadata:
- name: tempo-s3-credentials
- namespace: ${ns_monitoring}
- type: kubernetes.io/basic-auth
- stringData:
- username: ${tempo_s3_access_key}
- password: ${tempo_s3_secret_key}
diff --git a/terraform/modules/monitoring/main.tf b/terraform/modules/monitoring/main.tf
deleted file mode 100644
index 1c7313b3..00000000
--- a/terraform/modules/monitoring/main.tf
+++ /dev/null
@@ -1,33 +0,0 @@
-module "monitoring-secrets" {
- source = "blackbird-cloud/deployment/helm"
- version = "~> 1.0"
-
- name = "monitoring-secrets"
- namespace = kubernetes_namespace.monitoring_namespace.metadata[0].name
- create_namespace = false
-
- repository = "https://bedag.github.io/helm-charts"
- chart = "raw"
- chart_version = "2.0.0"
-
- values = [
- templatefile("${path.module}/files/monitoring-secrets.values.yaml", {
- loki_bucket = var.loki_bucket
- loki_s3_access_key = var.loki_s3_access_key
- loki_s3_secret_key = var.loki_s3_secret_key
- tempo_bucket = var.tempo_bucket
- tempo_s3_access_key = var.tempo_s3_access_key
- tempo_s3_secret_key = var.tempo_s3_secret_key
- ns_monitoring = kubernetes_namespace.monitoring_namespace.metadata[0].name
- })
- ]
-
- cleanup_on_fail = false
- wait = false
-}
-
-resource "kubernetes_namespace" "monitoring_namespace" {
- metadata {
- name = "monitoring"
- }
-}
diff --git a/terraform/modules/monitoring/variables.tf b/terraform/modules/monitoring/variables.tf
deleted file mode 100644
index 8e33714a..00000000
--- a/terraform/modules/monitoring/variables.tf
+++ /dev/null
@@ -1,32 +0,0 @@
-####
-
-variable "loki_bucket" {
- type = string
-}
-
-variable "loki_s3_access_key" {
- type = string
- sensitive = true
-}
-
-variable "loki_s3_secret_key" {
- type = string
- sensitive = true
-}
-
-####
-
-variable "tempo_bucket" {
- type = string
-}
-
-variable "tempo_s3_access_key" {
- type = string
- sensitive = true
-}
-
-variable "tempo_s3_secret_key" {
- type = string
- sensitive = true
-}
-
diff --git a/terraform/modules/project/README.md b/terraform/modules/project/README.md
deleted file mode 100644
index dbc112a9..00000000
--- a/terraform/modules/project/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Project Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [gis](#module\_gis) | terraform-google-modules/project-factory/google | ~> 18.0 |
-| [mighty\_role](#module\_mighty\_role) | terraform-google-modules/iam/google//modules/custom_role_iam | ~> 8.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [api\_enabled\_services](#input\_api\_enabled\_services) | The list of apis necessary for the project | `list(string)` | `[]` | no |
-| [billing\_account](#input\_billing\_account) | Billing account assign to project | `string` | n/a | yes |
-| [credentials](#input\_credentials) | n/a | `string` | n/a | yes |
-| [folder\_id](#input\_folder\_id) | Folder ID | `string` | `null` | no |
-| [iam\_principals](#input\_iam\_principals) | List of role (key) names to grant permissions to | `list(string)` | n/a | yes |
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | Project Name | `string` | n/a | yes |
-| [org\_id](#input\_org\_id) | Project Name | `string` | `null` | no |
-| [project\_id](#input\_project\_id) | Unique project ID | `string` | `null` | no |
-| [region](#input\_region) | Project region | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [project\_id](#output\_project\_id) | n/a |
-
\ No newline at end of file
diff --git a/terraform/modules/project/main.tf b/terraform/modules/project/main.tf
deleted file mode 100644
index 0af559e7..00000000
--- a/terraform/modules/project/main.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-module "gis" {
- source = "terraform-google-modules/project-factory/google"
- version = "~> 18.0"
-
- name = var.name
- random_project_id = var.project_id == ""
- project_id = var.project_id
- org_id = var.org_id
- billing_account = var.billing_account
- default_service_account = "keep"
- folder_id = var.folder_id
- activate_apis = var.api_enabled_services
-
- deletion_policy = "DELETE"
-
- labels = var.labels
-}
\ No newline at end of file
diff --git a/terraform/modules/project/output.tf b/terraform/modules/project/output.tf
deleted file mode 100644
index c16fe349..00000000
--- a/terraform/modules/project/output.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-output "project_id" {
- value = module.gis.project_id
-}
diff --git a/terraform/modules/project/variables.tf b/terraform/modules/project/variables.tf
deleted file mode 100644
index cd67219e..00000000
--- a/terraform/modules/project/variables.tf
+++ /dev/null
@@ -1,50 +0,0 @@
-variable "name" {
- description = "Project Name"
- type = string
-}
-
-variable "region" {
- description = "Project region"
- type = string
-}
-
-variable "credentials" {
- type = string
- sensitive = true
-}
-
-variable "org_id" {
- description = "Project Name"
- type = string
- default = null
-}
-
-variable "project_id" {
- description = "Unique project ID"
- type = string
- default = null
-}
-
-variable "folder_id" {
- description = "Folder ID"
- type = string
- default = null
-}
-
-variable "billing_account" {
- description = "Billing account assign to project"
- type = string
- sensitive = true
-}
-
-variable "api_enabled_services" {
- description ="The list of apis necessary for the project"
- type = list(string)
- default = []
-}
-
-variable "labels" {
- description = "Map of labels for project"
- type = map(string)
- default = {}
-}
\ No newline at end of file
diff --git a/terraform/modules/storage/README.md b/terraform/modules/storage/README.md
deleted file mode 100644
index 9178877d..00000000
--- a/terraform/modules/storage/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [gcs\_buckets](#module\_gcs\_buckets) | terraform-google-modules/cloud-storage/google | ~> 10.0 |
-| [service\_accounts](#module\_service\_accounts) | terraform-google-modules/service-accounts/google | ~> 4.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | n/a | `string` | n/a | yes |
-| [names](#input\_names) | List of names for the project | `list(string)` | n/a | yes |
-| [project\_id](#input\_project\_id) | Google Project ID | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [access\_ids](#output\_access\_ids) | n/a |
-| [buckets\_map](#output\_buckets\_map) | n/a |
-| [secrets](#output\_secrets) | n/a |
-
\ No newline at end of file
diff --git a/terraform/modules/storage/locals.tf b/terraform/modules/storage/locals.tf
deleted file mode 100644
index 31cba424..00000000
--- a/terraform/modules/storage/locals.tf
+++ /dev/null
@@ -1,3 +0,0 @@
-locals {
- name = "${var.project_id}-storage"
-}
\ No newline at end of file
diff --git a/terraform/modules/storage/main.tf b/terraform/modules/storage/main.tf
deleted file mode 100644
index 686bed79..00000000
--- a/terraform/modules/storage/main.tf
+++ /dev/null
@@ -1,25 +0,0 @@
-module "gcs_buckets" {
- source = "terraform-google-modules/cloud-storage/google"
- version = "~> 10.0"
- project_id = var.project_id
- names = var.names
- prefix = local.name
-
- labels = var.labels
- set_hmac_access = true
- hmac_service_accounts = {
- for key in module.service_accounts.emails_list : key => "ACTIVE"
- }
-}
-
-module "service_accounts" {
- source = "terraform-google-modules/service-accounts/google"
- version = "~> 4.0"
- project_id = var.project_id
- prefix = var.name
- names = var.names
- project_roles = [
- "${var.project_id}=>roles/viewer",
- "${var.project_id}=>roles/storage.admin",
- ]
-}
\ No newline at end of file
diff --git a/terraform/modules/storage/output.tf b/terraform/modules/storage/output.tf
deleted file mode 100644
index 01676550..00000000
--- a/terraform/modules/storage/output.tf
+++ /dev/null
@@ -1,17 +0,0 @@
-output "buckets_map" {
- value = module.gcs_buckets.buckets_map
-}
-
-output "access_ids" {
- value = {
- for idx, name in var.names :name =>
- module.gcs_buckets.hmac_keys[0][module.service_accounts.service_accounts_map[name].email].access_id
- }
-}
-
-output "secrets" {
- value = {
- for idx, name in var.names :name =>
- module.gcs_buckets.hmac_keys[0][module.service_accounts.service_accounts_map[name].email].secret
- }
-}
\ No newline at end of file
diff --git a/terraform/modules/storage/variables.tf b/terraform/modules/storage/variables.tf
deleted file mode 100644
index d32ef2f9..00000000
--- a/terraform/modules/storage/variables.tf
+++ /dev/null
@@ -1,19 +0,0 @@
-variable "project_id" {
- type = string
- description = "Google Project ID"
-}
-
-variable "name" {
- type = string
-}
-
-variable "labels" {
- description = "Map of labels for project"
- type = map(string)
- default = {}
-}
-
-variable "names" {
- type = list(string)
- description = "List of names for the project"
-}
\ No newline at end of file
diff --git a/terraform/modules/vpc/README.md b/terraform/modules/vpc/README.md
deleted file mode 100644
index 5354ded4..00000000
--- a/terraform/modules/vpc/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# VPC Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [private-service-access](#module\_private-service-access) | terraform-google-modules/sql-db/google//modules/private_service_access | ~> 25.0 |
-| [vpc](#module\_vpc) | terraform-google-modules/network/google | ~> 10.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | The name of the project where this VPC will be created | `string` | n/a | yes |
-| [project\_id](#input\_project\_id) | The ID of the project where this VPC will be created | `string` | n/a | yes |
-| [region](#input\_region) | The region where to deploy resources | `string` | n/a | yes |
-| [vpc\_cidr](#input\_vpc\_cidr) | The CIDR block for the VPC | `string` | `"43.21.0.0/17"` | no |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [network\_id](#output\_network\_id) | n/a |
-| [network\_name](#output\_network\_name) | n/a |
-| [network\_self\_link](#output\_network\_self\_link) | n/a |
-| [sub\_network\_names](#output\_sub\_network\_names) | n/a |
-
\ No newline at end of file
diff --git a/terraform/modules/vpc/locals.tf b/terraform/modules/vpc/locals.tf
deleted file mode 100644
index 095b769b..00000000
--- a/terraform/modules/vpc/locals.tf
+++ /dev/null
@@ -1,10 +0,0 @@
-locals {
- name = "${var.name}-vpc"
- router_name = "${var.name}-router"
- nat_name = "${var.name}-nat"
- pub_sub_network_name = "${local.name}-subnet-01"
- priv_sub_network_name = "${local.name}-subnet-02"
-
- ip_range_name_pod = "${local.name}-ip-range-pods"
- ip_range_name_services = "${local.name}-ip-range-services"
-}
diff --git a/terraform/modules/vpc/main.tf b/terraform/modules/vpc/main.tf
deleted file mode 100644
index c3c49e6c..00000000
--- a/terraform/modules/vpc/main.tf
+++ /dev/null
@@ -1,66 +0,0 @@
-module "vpc" {
- source = "terraform-google-modules/network/google"
- version = "~> 12.0"
-
- project_id = var.project_id
- network_name = local.name
- routing_mode = "GLOBAL"
-
- subnets = [
- {
- subnet_name = local.pub_sub_network_name
- subnet_ip = "10.10.0.0/18"
- subnet_region = var.region
- auto_upgrade = true
- auto_repair = true
- },
- {
- subnet_name = local.priv_sub_network_name
- subnet_ip = "10.10.64.0/18"
- subnet_region = var.region
- subnet_private_access = true
- auto_upgrade = true
- auto_repair = true
- },
- ]
-
- secondary_ranges = {
- (local.pub_sub_network_name) = [
- {
- range_name = "ip-range-pods"
- ip_cidr_range = "10.11.0.0/18"
- },
- {
- range_name = "ip-range-services"
- ip_cidr_range = "10.11.64.0/18"
- },
- ],
- (local.priv_sub_network_name) = [
- {
- range_name = local.ip_range_name_pod
- ip_cidr_range = "10.23.0.0/18"
- },
- {
- range_name = local.ip_range_name_services
- ip_cidr_range = "10.23.64.0/18"
- },
- ]
- }
-
- auto_create_subnetworks = false
-}
-
-module "cloud_router" {
- source = "terraform-google-modules/cloud-router/google"
- version = "~> 7.0"
-
- name = local.router_name
- project = var.project_id
- network = module.vpc.network_name
- region = var.region
-
- nats = [{
- name = local.nat_name
- source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"
- }]
-}
diff --git a/terraform/modules/vpc/outputs.tf b/terraform/modules/vpc/outputs.tf
deleted file mode 100644
index bf7916c2..00000000
--- a/terraform/modules/vpc/outputs.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-output "network_id" {
- value = module.vpc.network_id
-}
-
-output "network_name" {
- value = module.vpc.network_name
-}
-
-output "subnets_ips" {
- value = module.vpc.subnets_ips
-}
-
-output "pub_sub_network_name" {
- value = local.pub_sub_network_name
-}
-
-output "priv_sub_network_name" {
- value = local.priv_sub_network_name
-}
-
-output "network_self_link" {
- value = module.vpc.network_self_link
-}
-
-output "subnets" {
- value = module.vpc.subnets
-}
-
-output "ip_range_pod" {
- value = local.ip_range_name_pod
-}
-
-output "ip_range_services" {
- value = local.ip_range_name_services
-}
\ No newline at end of file
diff --git a/terraform/modules/vpc/variables.tf b/terraform/modules/vpc/variables.tf
deleted file mode 100644
index 2f8eb9fc..00000000
--- a/terraform/modules/vpc/variables.tf
+++ /dev/null
@@ -1,14 +0,0 @@
-variable "project_id" {
- type = string
- description = "The ID of the project where this VPC will be created"
-}
-
-variable "region" {
- type = string
- description = "The region where to deploy resources"
-}
-
-variable "name" {
- type = string
- description = "The name of the project where this VPC will be created"
-}
diff --git a/terraform/modules/wazuh/README.md b/terraform/modules/wazuh/README.md
deleted file mode 100644
index 96f5a4a9..00000000
--- a/terraform/modules/wazuh/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Helm Module
-
-
-## Requirements
-
-No requirements.
-
-## Providers
-
-No providers.
-
-## Modules
-
-| Name | Source | Version |
-|------|--------|---------|
-| [gis\_application\_release](#module\_gis\_application\_release) | blackbird-cloud/deployment/helm | ~> 1.0 |
-| [gis\_sschool\_release](#module\_gis\_sschool\_release) | blackbird-cloud/deployment/helm | ~> 1.0 |
-
-## Resources
-
-No resources.
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [cluster\_name](#input\_cluster\_name) | Cluster name | `string` | n/a | yes |
-| [db\_host](#input\_db\_host) | DB host | `string` | n/a | yes |
-| [db\_password](#input\_db\_password) | DB password | `string` | n/a | yes |
-| [db\_username](#input\_db\_username) | DB username | `string` | n/a | yes |
-| [gis\_application\_auth\_secret](#input\_gis\_application\_auth\_secret) | GIS Application auth secret | `string` | n/a | yes |
-| [gis\_application\_bucket](#input\_gis\_application\_bucket) | GIS Application bucket name | `string` | n/a | yes |
-| [gis\_application\_chart\_version](#input\_gis\_application\_chart\_version) | GIS Application Helm chart version | `string` | n/a | yes |
-| [gis\_application\_dns](#input\_gis\_application\_dns) | GIS Application DNS | `string` | n/a | yes |
-| [gis\_application\_oauth\_client\_id](#input\_gis\_application\_oauth\_client\_id) | GIS Application OAuth client ID | `string` | n/a | yes |
-| [gis\_application\_oauth\_client\_secret](#input\_gis\_application\_oauth\_client\_secret) | GIS Application OAuth client secret | `string` | n/a | yes |
-| [gis\_application\_s3\_access\_key](#input\_gis\_application\_s3\_access\_key) | GIS Application S3 access key | `string` | n/a | yes |
-| [gis\_application\_s3\_secret\_key](#input\_gis\_application\_s3\_secret\_key) | GIS Application S3 secret key | `string` | n/a | yes |
-| [labels](#input\_labels) | Map of labels for project | `map(string)` | `{}` | no |
-| [name](#input\_name) | Deployment name | `string` | n/a | yes |
-| [openai\_key](#input\_openai\_key) | OpenAI provider key | `string` | n/a | yes |
-| [openai\_url](#input\_openai\_url) | OpenAI provider url | `string` | n/a | yes |
-| [project\_id](#input\_project\_id) | Google Project ID | `string` | n/a | yes |
-| [redis\_host](#input\_redis\_host) | Redis host | `string` | n/a | yes |
-| [redis\_port](#input\_redis\_port) | Redis port | `string` | n/a | yes |
-| [region](#input\_region) | Google Region | `string` | n/a | yes |
-| [repository\_password](#input\_repository\_password) | Helm repository password | `string` | n/a | yes |
-| [repository\_username](#input\_repository\_username) | Helm repository username | `string` | n/a | yes |
-| [sschool\_auth\_secret](#input\_sschool\_auth\_secret) | SSchool auth secret | `string` | n/a | yes |
-| [sschool\_bucket](#input\_sschool\_bucket) | SSchool bucket name | `string` | n/a | yes |
-| [sschool\_chart\_version](#input\_sschool\_chart\_version) | SSchool Helm chart version | `string` | n/a | yes |
-| [sschool\_dns](#input\_sschool\_dns) | SSchool DNS | `string` | n/a | yes |
-| [sschool\_oauth\_client\_id](#input\_sschool\_oauth\_client\_id) | SSchool OAuth client ID | `string` | n/a | yes |
-| [sschool\_oauth\_client\_secret](#input\_sschool\_oauth\_client\_secret) | SSchool OAuth client secret | `string` | n/a | yes |
-| [sschool\_s3\_access\_key](#input\_sschool\_s3\_access\_key) | SSchool S3 access key | `string` | n/a | yes |
-| [sschool\_s3\_secret\_key](#input\_sschool\_s3\_secret\_key) | SSchool S3 secret key | `string` | n/a | yes |
-
-## Outputs
-
-No outputs.
-
\ No newline at end of file
diff --git a/terraform/modules/wazuh/cert-auth.tf b/terraform/modules/wazuh/cert-auth.tf
deleted file mode 100644
index feb923e3..00000000
--- a/terraform/modules/wazuh/cert-auth.tf
+++ /dev/null
@@ -1,60 +0,0 @@
-resource "helm_release" "wazuh-cert-server" {
- count = 1
-
- name = "wazuh-cert-server"
- namespace = kubernetes_namespace.wazuh_namespace.metadata[0].name
- create_namespace = false
-
- repository = "https://adorsys-gis.github.io/wazuh-cert-oauth2"
- chart = "wazuh-cert-server"
- version = "0.2.25"
-
- values = [
- file("${path.module}/files/.wazuh-cert-oauth2/charts/wazuh-cert-server/values-pvc.yaml"),
- templatefile("${path.module}/files/cert.values.yaml", {
- cert_domain = var.ip_addresses.cert.domain
- cert_certificate_name = local.cert_certificate_name
- cert_name = var.ip_addresses.cert.ip_name
- openid_connect_url = var.openid_connect_url
- })
- ]
-
- set {
- name = "cert.persistence.certs.name"
- value = local.root_secret_name
- }
-
- cleanup_on_fail = false
- wait = false
-
- depends_on = [kubernetes_namespace.wazuh_namespace]
-}
-
-resource "helm_release" "wazuh-cert-webhook" {
- count = 1
-
- name = "wazuh-cert-webhook"
- namespace = kubernetes_namespace.wazuh_namespace.metadata[0].name
- create_namespace = false
-
- repository = "https://adorsys-gis.github.io/wazuh-cert-oauth2"
- chart = "wazuh-cert-webhook"
- version = "0.2.27"
-
- values = [
- file("${path.module}/files/.wazuh-cert-oauth2/charts/wazuh-cert-webhook/values-pvc.yaml"),
- templatefile("${path.module}/files/cert-webhook.values.yaml", {
- openid_connect_url = var.openid_connect_url
- })
- ]
-
- set {
- name = "cert.persistence.certs.name"
- value = local.root_secret_name
- }
-
- cleanup_on_fail = false
- wait = false
-
- depends_on = [kubernetes_namespace.wazuh_namespace]
-}
diff --git a/terraform/modules/wazuh/deps.tf b/terraform/modules/wazuh/deps.tf
deleted file mode 100644
index 02e6e765..00000000
--- a/terraform/modules/wazuh/deps.tf
+++ /dev/null
@@ -1,23 +0,0 @@
-resource "helm_release" "other_resources" {
- count = 1
- name = "other-resources"
- namespace = kubernetes_namespace.wazuh_namespace.metadata[0].name
- create_namespace = false
-
- repository = "https://bedag.github.io/helm-charts"
- chart = "raw"
- version = "2.0.0"
-
- values = [templatefile("${path.module}/files/resources.yaml", {
- ns = kubernetes_namespace.wazuh_namespace.metadata[0].name
- dashboard_certificate_name = local.dashboard_certificate_name
- dashboard_domain = var.ip_addresses.dashboard.domain
- manager_certificate_name = local.manager_certificate_name
- manager_domain = var.ip_addresses.manager.domain
- cert_certificate_name = local.cert_certificate_name
- cert_domain = var.ip_addresses.cert.domain
- })]
-
- cleanup_on_fail = false
- wait = false
-}
diff --git a/terraform/modules/wazuh/files/.wazuh-cert-oauth2 b/terraform/modules/wazuh/files/.wazuh-cert-oauth2
deleted file mode 160000
index 7a40e716..00000000
--- a/terraform/modules/wazuh/files/.wazuh-cert-oauth2
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 7a40e716057f9b3310b24bce4a9d642347f0840c
diff --git a/terraform/modules/wazuh/files/.wazuh-helm b/terraform/modules/wazuh/files/.wazuh-helm
deleted file mode 160000
index 3a69e4b0..00000000
--- a/terraform/modules/wazuh/files/.wazuh-helm
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 3a69e4b0b4459cdeff117554c639c4a2f9377a39
diff --git a/terraform/modules/wazuh/files/cert-webhook.values.yaml b/terraform/modules/wazuh/files/cert-webhook.values.yaml
deleted file mode 100644
index 2d2b4a84..00000000
--- a/terraform/modules/wazuh/files/cert-webhook.values.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-global:
- version: "main8935cb277d12a2b9cdffab857f99fefb5b1c09dc"
-webhook:
- persistence:
- data:
- size: 1Gi
- storageClass: "wazuh-rwx"
-
- controllers:
- app:
- initContainers:
- permission-fix:
- resources:
- requests:
- cpu: null
- memory: null
- limits:
- cpu: null
- memory: null
- containers:
- app:
- resources:
- requests:
- cpu: null
- memory: null
- limits:
- cpu: null
- memory: null
-
- env:
- SERVER_BASE_URL: 'http://wazuh-cert-server:8000'
- RUST_LOG: 'warn'
- OAUTH_ISSUER: '${openid_connect_url}'
-
- # TODO One of these is required
- OAUTH_CLIENT_ID: ""
- OAUTH_CLIENT_SECRET: ""
- WEBHOOK_BASIC_USER: ""
- WEBHOOK_BASIC_PASSWORD: ""
\ No newline at end of file
diff --git a/terraform/modules/wazuh/files/cert.values.yaml b/terraform/modules/wazuh/files/cert.values.yaml
deleted file mode 100644
index 528b1df2..00000000
--- a/terraform/modules/wazuh/files/cert.values.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
-global:
- domain: "${cert_domain}"
- version: "main02d369668ca611feadd5d094ef4f587501977a3f"
-cert:
- controllers:
- main:
- initContainers:
- permission-fix:
- resources:
- requests:
- cpu: null
- memory: null
- limits:
- cpu: null
- memory: null
- ensure-ledger-csv:
- enabled: true # toggle this, as normally the permission-fix should run first
- resources:
- requests:
- cpu: null
- memory: null
- limits:
- cpu: null
- memory: null
- containers:
- main:
- resources:
- requests:
- cpu: null
- memory: null
- limits:
- cpu: null
- memory: null
-
- env:
- RUST_LOG: 'warn'
- OAUTH_ISSUER: '${openid_connect_url}'
- service:
- main:
- annotations:
- cloud.google.com/backend-config: '{"ports":{"http":"cert-backend-config"}}'
-
- persistence:
- data:
- size: 1Gi
- storageClass: "wazuh-rwx"
-
- ingress:
- main:
- enabled: true
- className: null
- annotations:
- networking.gke.io/managed-certificates: "${cert_certificate_name}"
- kubernetes.io/ingress.global-static-ip-name: "${cert_name}"
\ No newline at end of file
diff --git a/terraform/modules/wazuh/files/resources.yaml b/terraform/modules/wazuh/files/resources.yaml
deleted file mode 100644
index 6a2ebee2..00000000
--- a/terraform/modules/wazuh/files/resources.yaml
+++ /dev/null
@@ -1,93 +0,0 @@
-resources:
- - apiVersion: networking.gke.io/v1
- kind: ManagedCertificate
- metadata:
- name: ${dashboard_certificate_name}
- namespace: ${ns}
- labels:
- app: wazuh
- spec:
- domains:
- - ${dashboard_domain}
- - apiVersion: networking.gke.io/v1
- kind: ManagedCertificate
- metadata:
- name: ${manager_certificate_name}
- namespace: ${ns}
- labels:
- app: wazuh
- spec:
- domains:
- - ${manager_domain}
- - apiVersion: networking.gke.io/v1
- kind: ManagedCertificate
- metadata:
- name: ${cert_certificate_name}
- namespace: ${ns}
- labels:
- app: wazuh
- spec:
- domains:
- - ${cert_domain}
-
- - apiVersion: cloud.google.com/v1
- kind: BackendConfig
- metadata:
- name: wazuh-dashboard-backend-config
- namespace: ${ns}
- spec:
- healthCheck:
- type: HTTPS
- port: 5601
- requestPath: /api/status
- timeoutSec: 5
- checkIntervalSec: 30
- healthyThreshold: 2
- unhealthyThreshold: 3
-
- - apiVersion: cloud.google.com/v1
- kind: BackendConfig
- metadata:
- name: cert-backend-config
- namespace: ${ns}
- spec:
- healthCheck:
- type: HTTP
- port: 8000
- requestPath: /health
- timeoutSec: 5
- checkIntervalSec: 30
- healthyThreshold: 2
- unhealthyThreshold: 3
-
- - apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- name: max-map-count-setter
- namespace: ${ns}
- spec:
- selector:
- matchLabels:
- name: max-map-count-setter
- template:
- metadata:
- labels:
- name: max-map-count-setter
- spec:
- # One tiny init container that sets the node kernel sysctl
- initContainers:
- - name: max-map-count-setter
- image: docker.io/bash:5.2.21
- resources:
- limits:
- cpu: 100m
- memory: 32Mi
- securityContext:
- privileged: true
- runAsUser: 0
- command: [ "/usr/local/bin/bash","-e","-c","echo 262144 > /proc/sys/vm/max_map_count" ]
- # Keep the pod around
- containers:
- - name: sleep
- image: docker.io/bash:5.2.21
- command: [ "sleep","infinity" ]
diff --git a/terraform/modules/wazuh/files/wazuh.values.yaml b/terraform/modules/wazuh/files/wazuh.values.yaml
deleted file mode 100644
index 70a8ed35..00000000
--- a/terraform/modules/wazuh/files/wazuh.values.yaml
+++ /dev/null
@@ -1,85 +0,0 @@
-global:
- domain: ${dashboard_domain}
-
-fullnameOverride: wazuh
-
-indexer:
- replicas: 2
- persistence:
- size: 100Gi
- keycloak:
- enabled: true
- openid_connect_url: "${openid_connect_url}/.well-known/openid-configuration"
- base_redirect_url: "https://{{ .Values.global.domain }}"
-
-master:
- replicaCount: 1
- persistence:
- size: 50Gi
- resources:
- limits:
- ephemeral-storage: 10Gi
- requests:
- ephemeral-storage: 10Gi
-
-worker:
- replicaCount: 2
- persistence:
- size: 50Gi
- resources:
- limits:
- ephemeral-storage: 10Gi
- requests:
- ephemeral-storage: 10Gi
-
-integration:
- jira:
- enabled: false
-
-extraVolumeConfigs:
- '{{ include "common.names.fullname" $ }}-manager-backup':
- resources:
- requests:
- storage: 10Gi
- snort-alerts:
- resources:
- requests:
- storage: 10Gi
- owasp-zap-alerts:
- resources:
- requests:
- storage: 10Gi
-
-dashboard:
- ingress:
- enabled: true
- host: "${dashboard_domain}"
- className: null
- tls:
- enabled: false
- #useSecret: true
- annotations:
- networking.gke.io/managed-certificates: "${dashboard_certificate_name}"
- kubernetes.io/ingress.global-static-ip-name: "${dashboard_name}"
- #kubernetes.io/ingress.allow-http: "false"
- branding:
- logo:
- defaultUrl: "https://wazuh-assets-bucket.s3.eu-central-1.amazonaws.com/images/favicon-dark.svg"
- mark:
- defaultUrl: "https://wazuh-assets-bucket.s3.eu-central-1.amazonaws.com/images/favicon-dark.svg"
- # darkModeUrl: ""
- loadingLogo:
- defaultUrl: "https://wazuh-assets-bucket.s3.eu-central-1.amazonaws.com/images/favicon-dark.svg"
- # darkModeUrl: ""
- faviconUrl: "https://wazuh-assets-bucket.s3.eu-central-1.amazonaws.com/images/favicon-dark.svg"
- applicationTitle: "SIEM"
- useExpandedHeader: false
-
-svcs:
- '{{ include "common.names.fullname" $ }}-ext':
- enabled: true
- loadBalancerIP: "${manager_ip}"
- '{{ include "common.names.fullname" $ }}-dashboard':
- annotations:
- cloud.google.com/backend-config: '{"ports":{"dashboard":"wazuh-dashboard-backend-config"}}'
- cloud.google.com/app-protocols: '{"dashboard":"HTTPS"}'
\ No newline at end of file
diff --git a/terraform/modules/wazuh/locals.tf b/terraform/modules/wazuh/locals.tf
deleted file mode 100644
index 0d13b56b..00000000
--- a/terraform/modules/wazuh/locals.tf
+++ /dev/null
@@ -1,7 +0,0 @@
-locals {
- name = "wazuh"
- root_secret_name = "${local.name}-root-secret"
- dashboard_certificate_name = replace(var.ip_addresses.dashboard.domain, "/[.]/", "-")
- cert_certificate_name = replace(var.ip_addresses.cert.domain, "/[.]/", "-")
- manager_certificate_name = replace(var.ip_addresses.manager.domain, "/[.]/", "-")
-}
diff --git a/terraform/modules/wazuh/variables.tf b/terraform/modules/wazuh/variables.tf
deleted file mode 100644
index d5668fa2..00000000
--- a/terraform/modules/wazuh/variables.tf
+++ /dev/null
@@ -1,47 +0,0 @@
-variable "helm_chart_version" {
- type = string
-}
-
-variable "openid_connect_url" {
- type = string
- default = "https://login.dev.wazuh.adorsys.team/realms/test-adorsys"
-}
-
-variable "openid_client_id" {
- sensitive = true
- type = string
-}
-
-variable "openid_client_secret" {
- sensitive = true
- type = string
-}
-
-variable "subject" {
- type = object({
- country = string
- locality = string
- organization = string
- common_name = string
- })
-}
-
-variable "ip_addresses" {
- type = object({
- dashboard = object({
- domain = string
- ip_name = string
- ip = string
- })
- cert = object({
- domain = string
- ip_name = string
- ip = string
- })
- manager = object({
- domain = string
- ip_name = string
- ip = string
- })
- })
-}
diff --git a/terraform/modules/wazuh/wazuh.tf b/terraform/modules/wazuh/wazuh.tf
deleted file mode 100644
index 40b701cd..00000000
--- a/terraform/modules/wazuh/wazuh.tf
+++ /dev/null
@@ -1,113 +0,0 @@
-resource "helm_release" "wazuh" {
- count = 1
-
- name = "wazuh-release"
- namespace = kubernetes_namespace.wazuh_namespace.metadata[0].name
- create_namespace = false
-
- repository = "https://adorsys-gis.github.io/wazuh-helm"
- chart = "wazuh-helm"
- version = var.helm_chart_version
-
- values = [
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-high-ressources.yaml"),
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-gke.yaml"),
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-gke-pv.yaml"),
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-gke-svc.yaml"),
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-gke-autopilot.yaml"),
- file("${path.module}/files/.wazuh-helm/charts/wazuh/values-permission-fix.yaml"),
- templatefile("${path.module}/files/wazuh.values.yaml", {
- dashboard_domain = var.ip_addresses.dashboard.domain
- dashboard_certificate_name = local.dashboard_certificate_name
- dashboard_name = var.ip_addresses.dashboard.ip_name
- dashboard_ip = var.ip_addresses.dashboard.ip
-
- manager_domain = var.ip_addresses.manager.domain
- manager_certificate_name = local.manager_certificate_name
- manager_name = var.ip_addresses.manager.ip_name
- manager_ip = var.ip_addresses.manager.ip
-
- openid_connect_url = var.openid_connect_url
- })
- ]
-
- set_sensitive {
- name = "cluster.auth.key"
- value = random_id.hex_16.hex
- }
-
- set_sensitive {
- name = "indexer.keycloak.client_id"
- value = var.openid_client_id
- }
-
- set_sensitive {
- name = "indexer.keycloak.client_secret"
- value = var.openid_client_secret
- }
-
- set {
- name = "cluster.rootCaSecretName"
- value = local.root_secret_name
- }
-
- cleanup_on_fail = false
- wait = false
-
- depends_on = [kubernetes_namespace.wazuh_namespace, helm_release.other_resources]
-}
-
-resource "random_id" "hex_16" {
- byte_length = 16
-}
-
-resource "kubernetes_namespace" "wazuh_namespace" {
- metadata {
- name = "wazuh"
- }
-}
-# --- Root CA key ---
-resource "tls_private_key" "root_ca_key" {
- algorithm = "RSA"
- rsa_bits = 4096
-}
-
-# --- Self-signed Root CA cert ---
-resource "tls_self_signed_cert" "root_ca" {
- private_key_pem = tls_private_key.root_ca_key.private_key_pem
- is_ca_certificate = true
- validity_period_hours = 365 * 10 * 24 # ~10 years
-
- subject {
- country = var.subject.country
- locality = var.subject.locality
- organization = var.subject.organization
- common_name = var.subject.common_name
- }
-
- # Conservative, CA-appropriate usages
- allowed_uses = [
- "cert_signing",
- "crl_signing",
- "digital_signature",
- "key_encipherment",
- ]
-
- # Keep it SHA-256 like your openssl command
- early_renewal_hours = 0
-}
-
-# --- Kubernetes Secret with the PEMs ---
-resource "kubernetes_secret" "wazuh_root_ca" {
- metadata {
- name = local.root_secret_name
- namespace = kubernetes_namespace.wazuh_namespace.metadata[0].name
- }
-
- type = "Opaque"
-
- data = {
- "root-ca.pem" = tls_self_signed_cert.root_ca.cert_pem
- "root-ca-key.pem" = tls_private_key.root_ca_key.private_key_pem
- }
-}
diff --git a/terraform/outputs.tf b/terraform/outputs.tf
deleted file mode 100644
index caa1b114..00000000
--- a/terraform/outputs.tf
+++ /dev/null
@@ -1,23 +0,0 @@
-output "dns_ns" {
- value = module.dns.name_servers
- description = "The Zone NS"
-}
-
-output "k8s_name" {
- value = module.k8s.cluster_name
-}
-
-output "k8s_host" {
- value = module.gke_auth.host
-}
-
-output "wazuh_domains" {
- value = {
- for k, v in local.wazuh_domains : k => {
- ip = module.ip[k].address
- name = module.ip[k].address_name
- cert_name = module.ip[k].address_name
- domain = "https://${v.domain}"
- }
- }
-}
diff --git a/terraform/prod.tfvars b/terraform/prod.tfvars
deleted file mode 100644
index 2b62efc0..00000000
--- a/terraform/prod.tfvars
+++ /dev/null
@@ -1,15 +0,0 @@
-region = "europe-west3"
-name = "observe"
-root_domain_name = "observe.camer.digital"
-environment = "prod"
-
-project_id = "observe-472521"
-
-wazuh_helm_chart_version = "0.6.1-rc.1"
-
-subject = {
- country = "CM"
- locality = "Bangangte"
- organization = "adorsys GIS"
- common_name = "root-ca"
-}
diff --git a/terraform/providers.tf b/terraform/providers.tf
deleted file mode 100644
index d6034f6d..00000000
--- a/terraform/providers.tf
+++ /dev/null
@@ -1,31 +0,0 @@
-provider "google" {
- credentials = file(var.credentials)
-
- region = var.region
-}
-
-provider "google-beta" {
- credentials = file(var.credentials)
-
- region = var.region
-}
-
-provider "helm" {
- kubernetes {
- cluster_ca_certificate = module.gke_auth.cluster_ca_certificate
- host = module.gke_auth.host
- token = module.gke_auth.token
- }
-}
-
-provider "kubernetes" {
- cluster_ca_certificate = module.gke_auth.cluster_ca_certificate
- host = module.gke_auth.host
- token = module.gke_auth.token
-}
-
-provider "random" {
-}
-
-provider "tls" {
-}
diff --git a/terraform/variables.tf b/terraform/variables.tf
deleted file mode 100644
index 964bd5c6..00000000
--- a/terraform/variables.tf
+++ /dev/null
@@ -1,113 +0,0 @@
-variable "project_id" {
- type = string
- description = "The ID of the project where this VPC will be created"
- default = ""
-}
-
-variable "create_project" {
- type = bool
- description = "Should we create a project?"
- default = false
-}
-
-variable "folder_id" {
- type = string
- description = "Folder ID in the folder in which project"
- default = null
-}
-
-variable "region" {
- type = string
- description = "The region where to deploy resources"
-}
-
-variable "name" {
- type = string
- default = "monitoring"
- description = "base name of this deployment"
-}
-
-variable "billing_account" {
- type = string
- sensitive = true
- description = "Billing account id for the project"
- default = ""
-}
-
-variable "org_id" {
- type = string
- description = "Google Organization ID"
- default = null
-}
-
-variable "root_domain_name" {
- type = string
- default = "observability.adorsys.team"
-}
-
-variable "environment" {
- type = string
-}
-
-variable "credentials" {
- type = string
- description = "File path to the credentials file. Keep in mind that the user or service account associated to this credentials file must have the necessary permissions to create the resources defined in this module."
- sensitive = true
-}
-
-variable "api_enabled_services" {
- description = "The list of apis necessary for the project"
- type = list(string)
- default = [
- "compute.googleapis.com",
- "gkehub.googleapis.com",
- "cloudresourcemanager.googleapis.com",
- "serviceusage.googleapis.com",
- "servicenetworking.googleapis.com",
- "cloudkms.googleapis.com",
- "logging.googleapis.com",
- "cloudbilling.googleapis.com",
- "iam.googleapis.com",
- "admin.googleapis.com",
- "storage-api.googleapis.com",
- "monitoring.googleapis.com",
- "securitycenter.googleapis.com",
- "billingbudgets.googleapis.com",
- "vpcaccess.googleapis.com",
- "dns.googleapis.com",
- "containerregistry.googleapis.com",
- "eventarc.googleapis.com",
- "run.googleapis.com",
- "container.googleapis.com",
- "dns.googleapis.com",
- "deploymentmanager.googleapis.com",
- "artifactregistry.googleapis.com",
- "cloudbuild.googleapis.com",
- "file.googleapis.com",
- "certificatemanager.googleapis.com",
- "domains.googleapis.com",
- ]
-}
-
-variable "wazuh_helm_chart_version" {
- type = string
-}
-
-variable "openid_client_id" {
- sensitive = true
- type = string
-}
-
-variable "openid_client_secret" {
- sensitive = true
- type = string
-}
-
-variable "subject" {
- type = object({
- country = string
- locality = string
- organization = string
- common_name = string
- })
-}
\ No newline at end of file
diff --git a/terraform/versions.tf b/terraform/versions.tf
deleted file mode 100644
index cde89aca..00000000
--- a/terraform/versions.tf
+++ /dev/null
@@ -1,30 +0,0 @@
-terraform {
- required_version = ">= 1.9.8"
-
- required_providers {
- google = {
- source = "hashicorp/google"
- version = "~> 6.0"
- }
- google-beta = {
- source = "hashicorp/google-beta"
- version = "~> 6.0"
- }
- kubernetes = {
- source = "hashicorp/kubernetes"
- version = "~> 2.0"
- }
- helm = {
- source = "hashicorp/helm"
- version = "~> 2.0"
- }
- random = {
- source = "hashicorp/random"
- version = "~> 3.0"
- }
- tls = {
- source = "hashicorp/tls"
- version = "~> 4.0"
- }
- }
-}