Skip to content

Commit

Permalink
feat: Terraform format
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheislamdfe committed Jan 20, 2025
1 parent 48d78a0 commit 50802cc
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion jmeter/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "app_name" { default = null }

variable "cf_sso_passcode" { }
variable "cf_sso_passcode" {}

variable "cf_space" { default = "bat-prod" }

Expand Down
62 changes: 31 additions & 31 deletions terraform/aks/application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "web_application" {
namespace = var.namespace
environment = local.app_name_suffix
service_name = var.service_name
is_web = true
is_web = true
docker_image = var.docker_image
replicas = var.webapp_replicas
max_memory = var.webapp_memory_max
Expand All @@ -49,44 +49,44 @@ module "main_worker" {
source = "./vendor/modules/aks//aks/application"
depends_on = [module.web_application]

namespace = var.namespace
environment = local.app_name_suffix
service_name = var.service_name
name = "worker"
is_web = false
docker_image = var.docker_image
replicas = var.worker_replicas
max_memory = var.worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["bundle", "exec", "sidekiq", "-c", "5", "-C", "config/sidekiq-main.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_gcp_wif = true
namespace = var.namespace
environment = local.app_name_suffix
service_name = var.service_name
name = "worker"
is_web = false
docker_image = var.docker_image
replicas = var.worker_replicas
max_memory = var.worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["bundle", "exec", "sidekiq", "-c", "5", "-C", "config/sidekiq-main.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_gcp_wif = true
enable_prometheus_monitoring = var.enable_prometheus_monitoring
enable_logit = var.enable_logit
enable_logit = var.enable_logit
}

module "secondary_worker" {
source = "./vendor/modules/aks//aks/application"
depends_on = [module.web_application]

is_web = false
namespace = var.namespace
environment = local.app_name_suffix
service_name = var.service_name
name = "secondary-worker"
docker_image = var.docker_image
replicas = var.secondary_worker_replicas
max_memory = var.secondary_worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["bundle", "exec", "sidekiq", "-c", "5", "-C", "config/sidekiq-secondary.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_gcp_wif = true
is_web = false
namespace = var.namespace
environment = local.app_name_suffix
service_name = var.service_name
name = "secondary-worker"
docker_image = var.docker_image
replicas = var.secondary_worker_replicas
max_memory = var.secondary_worker_memory_max
cluster_configuration_map = module.cluster_data.configuration_map
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name
command = ["bundle", "exec", "sidekiq", "-c", "5", "-C", "config/sidekiq-secondary.yml"]
probe_command = ["pgrep", "-f", "sidekiq"]
enable_gcp_wif = true
enable_prometheus_monitoring = var.enable_prometheus_monitoring
enable_logit = var.enable_logit
enable_logit = var.enable_logit
}

module "clock_worker" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/aks/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
version = "2.2.2"
}
kubernetes = {
source = "hashicorp/kubernetes"
source = "hashicorp/kubernetes"
version = "2.32.0"
}
}
Expand Down
22 changes: 11 additions & 11 deletions terraform/aks/storage_account.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resource "azurerm_storage_account" "data_exports_sa" {
count = var.create_storage_account ? 1 : 0
name = local.exp_storage_account_name
resource_group_name = local.app_resource_group_name
location = "UK South"
account_tier = "Standard"
account_replication_type = var.account_replication_type
allow_nested_items_to_be_public = false
count = var.create_storage_account ? 1 : 0
name = local.exp_storage_account_name
resource_group_name = local.app_resource_group_name
location = "UK South"
account_tier = "Standard"
account_replication_type = var.account_replication_type
allow_nested_items_to_be_public = false
cross_tenant_replication_enabled = false

dynamic "blob_properties" {
Expand All @@ -28,8 +28,8 @@ resource "azurerm_storage_account" "data_exports_sa" {
}

resource "azurerm_storage_container" "data_exports_container" {
count = var.create_storage_account ? 1 : 0
name = "storage"
storage_account_name = azurerm_storage_account.data_exports_sa[count.index].name
container_access_type = "private"
count = var.create_storage_account ? 1 : 0
name = "storage"
storage_account_name = azurerm_storage_account.data_exports_sa[count.index].name
container_access_type = "private"
}
6 changes: 3 additions & 3 deletions terraform/custom_domains/environment_domains/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data "azurerm_monitor_action_group" "main" {
}

data "azurerm_cdn_frontdoor_profile" "zone" {
for_each = local.alertable_zone
for_each = local.alertable_zone

name = var.hosted_zone[each.key].front_door_name
resource_group_name = var.hosted_zone[each.key].resource_group_name
Expand All @@ -21,7 +21,7 @@ data "azurerm_cdn_frontdoor_profile" "zone" {
# aggregated over the last 5 minutes

resource "azurerm_monitor_metric_alert" "fd_total_latency" {
for_each = local.alertable_zone
for_each = local.alertable_zone

name = "${var.hosted_zone[each.key].front_door_name}-${var.hosted_zone[each.key].domains[0]}-latency"
resource_group_name = var.hosted_zone[each.key].resource_group_name
Expand Down Expand Up @@ -55,7 +55,7 @@ resource "azurerm_monitor_metric_alert" "fd_total_latency" {
}

resource "azurerm_monitor_metric_alert" "fd_percent_5xx" {
for_each = local.alertable_zone
for_each = local.alertable_zone

name = "${var.hosted_zone[each.key].front_door_name}-${var.hosted_zone[each.key].domains[0]}-5xx"
resource_group_name = var.hosted_zone[each.key].resource_group_name
Expand Down
6 changes: 3 additions & 3 deletions terraform/custom_domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
variable hosted_zone {
type = map(any)
variable "hosted_zone" {
type = map(any)
default = {}
}

variable "multiple_hosted_zones" {
type = bool
type = bool
default = false
}

Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/statuscake/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ resource "statuscake_uptime_check" "alert" {
check_interval = each.value.check_rate
confirmation = 2
trigger_rate = 0
regions = [ "london", "dublin" ]
regions = ["london", "dublin"]
contact_groups = each.value.contact_group

http_check {
follow_redirects = true
timeout = 40
request_method = "HTTP"
status_codes = [
status_codes = [
"204",
"205",
"206",
Expand Down

0 comments on commit 50802cc

Please sign in to comment.