Skip to content

Commit

Permalink
Migrate GCP Wif
Browse files Browse the repository at this point in the history
  • Loading branch information
Neill Turner committed Dec 11, 2024
1 parent adfb54e commit c9c037b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/initializers/dfe_analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
config.queue = :analytics
config.environment = HostingEnvironment.environment_name
config.entity_table_checks_enabled = true
config.azure_federated_auth = ENV.include? "GOOGLE_CLOUD_CREDENTIALS"

config.enable_analytics =
proc do
disabled_by_default = Rails.env.development?
ENV.fetch("BIGQUERY_DISABLE", disabled_by_default.to_s) != "true"
end
config.azure_federated_auth = ENV.include? "GOOGLE_CLOUD_CREDENTIALS"
end
4 changes: 2 additions & 2 deletions terraform/application/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module "application_configuration" {
AZURE_STORAGE_CONTAINER = azurerm_storage_container.uploads.name
GROVER_NO_SANDBOX = "true"
PUPPETEER_EXECUTABLE_PATH = "/usr/bin/chromium-browser"
BIGQUERY_DATASET = "events_${var.config}"
BIGQUERY_DATASET = var.dataset_name
BIGQUERY_PROJECT_ID = "refer-serious-misconduct"
BIGQUERY_TABLE_NAME = "events"
}
Expand Down Expand Up @@ -70,5 +70,5 @@ module "main_worker" {
command = ["/bin/sh", "-c", "bundle exec sidekiq -C config/sidekiq.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_logit = var.enable_logit
enable_gcp_wif = var.enable_dfe_analytics_federated_auth
enable_gcp_wif = true
}
8 changes: 2 additions & 6 deletions terraform/application/config/review.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"namespace": "tra-development",
"deploy_azure_backing_services": false,
"enable_postgres_ssl": false,
"enable_dfe_analytics_federated_auth": true,
"webapp_startup_command": [
"/bin/sh",
"-c",
"bundle exec rails db:schema_load_or_migrate && bundle exec rails runner \"%i(eligibility_screener referral_form).each {|flag| FeatureFlags::FeatureFlag.activate(flag)}\" && bundle exec rails server -b 0.0.0.0"
]
"dataset_name": "events_dev",
"enable_dfe_analytics_federated_auth": true
}
3 changes: 2 additions & 1 deletion terraform/application/config/test.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cluster": "test",
"namespace": "tra-test",
"enable_postgres_backup_storage": true
"enable_postgres_backup_storage": true,
"dataset_name": "events_test"
}
2 changes: 1 addition & 1 deletion terraform/application/dfe_analytics.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module "dfe_analytics" {
namespace = var.namespace
service_short = var.service_short
environment = var.environment
gcp_dataset = "events_${var.config}"
gcp_dataset = var.dataset_name
}

0 comments on commit c9c037b

Please sign in to comment.