Skip to content

Commit

Permalink
rename production_type to operational_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Hernández committed May 31, 2024
1 parent cebcba2 commit 721ab75
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
locals {
# TFE Architecture
# ----------------
active_active = var.vm_node_count >= 2 || var.production_type == "active-active"
disk_mode = var.production_type == "disk"
active_active = var.vm_node_count >= 2 || var.operational_mode == "active-active"
disk_mode = var.operational_mode == "disk"

# Network
# -------
Expand Down
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module "network" {
resource_group_name = module.resource_groups.resource_group_name
location = var.location

active_active = var.production_type == "active-active"
active_active = var.operational_mode == "active-active"
enable_ssh = var.enable_ssh
is_replicated_deployment = var.is_replicated_deployment

Expand All @@ -85,7 +85,7 @@ module "network" {
# -----------------------------------------------------------------------------
module "redis" {
source = "./modules/redis"
count = var.production_type == "active-active" ? 1 : 0
count = var.operational_mode == "active-active" ? 1 : 0

resource_group_name = module.resource_groups.resource_group_name
location = var.location
Expand Down Expand Up @@ -143,8 +143,8 @@ module "tfe_init_fdo" {
cloud = "azurerm"
distribution = var.distribution
disk_path = var.disk_path
disk_device_name = var.production_type == "disk" ? "disk/azure/scsi1/lun${var.vm_data_disk_lun}" : null
operational_mode = var.production_type
disk_device_name = var.operational_mode == "disk" ? "disk/azure/scsi1/lun${var.vm_data_disk_lun}" : null
operational_mode = var.operational_mode
custom_image_tag = var.custom_image_tag
enable_monitoring = var.enable_monitoring

Expand Down Expand Up @@ -189,7 +189,7 @@ module "runtime_container_engine_config" {
disk_path = local.disk_mode ? var.disk_path : null
iact_subnets = join(",", var.iact_subnet_list)
iact_time_limit = var.iact_subnet_time_limit
operational_mode = var.production_type
operational_mode = var.operational_mode
run_pipeline_image = var.run_pipeline_image
tfe_image = var.tfe_image
tfe_license = var.hc_license
Expand Down Expand Up @@ -250,7 +250,7 @@ module "settings" {
hairpin_addressing = var.hairpin_addressing
iact_subnet_list = var.iact_subnet_list
pg_extra_params = var.pg_extra_params
production_type = var.production_type
production_type = var.operational_mode
release_sequence = var.release_sequence
trusted_proxies = local.trusted_proxies

Expand Down Expand Up @@ -298,7 +298,7 @@ module "tfe_init_replicated" {
cloud = "azurerm"
distribution = var.distribution
disk_path = var.disk_path
disk_device_name = var.production_type == "disk" ? "disk/azure/scsi1/lun${var.vm_data_disk_lun}" : null
disk_device_name = var.operational_mode == "disk" ? "disk/azure/scsi1/lun${var.vm_data_disk_lun}" : null
tfe_configuration = module.settings[0].tfe_configuration
replicated_configuration = module.settings[0].replicated_configuration
airgap_url = var.airgap_url
Expand Down Expand Up @@ -342,7 +342,7 @@ module "load_balancer" {
zones = var.zones

# General
active_active = var.production_type == "active-active"
active_active = var.operational_mode == "active-active"
domain_name = var.domain_name
is_replicated_deployment = var.is_replicated_deployment
tfe_subdomain = var.tfe_subdomain
Expand Down
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ output "tfe_console_password" {
# Redis
# -----
output "redis_hostname" {
value = var.production_type == "active-active" ? module.redis[0].redis_cache.hostname : null
value = var.operational_mode == "active-active" ? module.redis[0].redis_cache.hostname : null
description = "The Hostname of the Redis Instance"
}

output "redis_ssl_port" {
value = var.production_type == "active-active" ? module.redis[0].redis_cache.ssl_port : null
value = var.operational_mode == "active-active" ? module.redis[0].redis_cache.ssl_port : null
description = "The SSL Port of the Redis Instance"
}

output "redis_pass" {
value = var.production_type == "active-active" ? module.redis[0].redis_cache.primary_access_key : null
value = var.operational_mode == "active-active" ? module.redis[0].redis_cache.primary_access_key : null
description = "The Primary Access Key for the Redis Instance"
}

Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,13 @@ variable "tls_version" {
}
}

variable "production_type" {
variable "operational_mode" {
default = null
type = string
description = "Where Terraform Enterprise application data will be stored. Valid values are `external`, `disk`, `active-active` or `null`. Choose `external` when storing application data in an external object storage service and database. Choose `disk` when storing application data in a directory on the Terraform Enterprise instance itself. Chose `active-active` when deploying more than 1 node. Leave it `null` when you want Terraform Enterprise to use its own default."

validation {
condition = contains(["external", "disk", "active-active", null], var.production_type)
condition = contains(["external", "disk", "active-active", null], var.operational_mode)

error_message = "The production_type must be 'external', 'disk', `active-active` or omitted."
}
Expand Down

0 comments on commit 721ab75

Please sign in to comment.