Skip to content

Commit

Permalink
rename to is_replicated_deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
anniehedgpeth committed Sep 21, 2023
1 parent 02d9c32 commit 0acc5dc
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 84 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/handler-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
cloud: Azure
test_name: Public Active/Active
utility_test: false
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -32,7 +32,7 @@ jobs:
cloud: Azure
test_name: Private Active/Active
utility_test: false
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -49,7 +49,7 @@ jobs:
cloud: Azure
test_name: Private TCP Active/Active
utility_test: false
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -66,7 +66,7 @@ jobs:
cloud: Azure
test_name: Standalone External
utility_test: false
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -90,7 +90,7 @@ jobs:
cloud: Azure
test_name: Standalone Mounted Disk
utility_test: false
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -114,7 +114,7 @@ jobs:
cloud: Azure
test_name: Public Active/Active (Legacy)
utility_test: true
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -132,7 +132,7 @@ jobs:
cloud: Azure
test_name: Private Active/Active (Legacy)
utility_test: true
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -150,7 +150,7 @@ jobs:
cloud: Azure
test_name: Private TCP Active/Active (Legacy)
utility_test: true
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -168,7 +168,7 @@ jobs:
cloud: Azure
test_name: Standalone External (Legacy)
utility_test: true
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand All @@ -192,7 +192,7 @@ jobs:
cloud: Azure
test_name: Standalone Mounted Disk (Legacy)
utility_test: true
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
pull_request_repo_name: ${{ github.event.client_payload.github.payload.repository.full_name }}
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/handler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-external') }}
with:
test_name: Standalone External (FDO)
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/standalone-external
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -37,7 +37,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-mounted-disk') }}
with:
test_name: Standalone Mounted Disk (FDO)
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/standalone-mounted-disk
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -61,7 +61,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'public-active-active') }}
with:
test_name: Public Active/Active (FDO)
is_legacy_deployment: false
is_replicated_deployment: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/public-active-active
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -78,7 +78,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'private-active-active') }}
with:
test_name: Private Active/Active (FDO)
is_legacy_deployment: false
is_replicated_deployment: false
utility_test: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/private-active-active
Expand All @@ -96,7 +96,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'private-tcp-active-active') }}
with:
test_name: Private TCP Active/Active (FDO)
is_legacy_deployment: false
is_replicated_deployment: false
utility_test: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/private-tcp-active-active
Expand All @@ -114,7 +114,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-external-legacy') }}
with:
test_name: Standalone External
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/standalone-external
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -138,7 +138,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-mounted-disk-legacy') }}
with:
test_name: Standalone Mounted Disk
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/standalone-mounted-disk
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -162,7 +162,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'public-active-active-legacy') }}
with:
test_name: Public Active/Active
is_legacy_deployment: true
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/public-active-active
k6_work_dir: ./tests/tfe-load-test
Expand All @@ -180,7 +180,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'private-active-active-legacy') }}
with:
test_name: Private Active/Active
is_legacy_deployment: true
is_replicated_deployment: true
utility_test: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/private-active-active
Expand All @@ -199,7 +199,7 @@ jobs:
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'private-tcp-active-active-legacy') }}
with:
test_name: Private TCP Active/Active
is_legacy_deployment: true
is_replicated_deployment: true
utility_test: false
module_repository_id: hashicorp/terraform-azurerm-terraform-enterprise
work_dir: ./tests/private-tcp-active-active
Expand Down
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module "network" {

active_active = local.active_active
enable_ssh = var.enable_ssh
is_legacy_deployment = var.is_legacy_deployment
is_replicated_deployment = var.is_replicated_deployment

network_allow_range = var.network_allow_range
network_bastion_subnet_cidr = var.network_bastion_subnet_cidr
Expand Down Expand Up @@ -135,7 +135,7 @@ module "database" {
# ---------------------------------------------------------------------------------------------------------------
module "tfe_init_fdo" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init?ref=main"
count = var.is_legacy_deployment ? 0 : 1
count = var.is_replicated_deployment ? 0 : 1

cloud = "azurerm"
distribution = var.distribution
Expand Down Expand Up @@ -171,7 +171,7 @@ module "tfe_init_fdo" {
# ------------------------------------------------------------------------------------
module "docker_compose_config" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/docker_compose_config?ref=main"
count = var.is_legacy_deployment ? 0 : 1
count = var.is_replicated_deployment ? 0 : 1

hostname = module.load_balancer.fqdn
tfe_license = var.hc_license
Expand Down Expand Up @@ -220,7 +220,7 @@ module "docker_compose_config" {
# ---------------------------------------------------------------------------------------
module "settings" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/settings?ref=main"
count = var.is_legacy_deployment ? 1 : 0
count = var.is_replicated_deployment ? 1 : 0

# TFE Base Configuration
consolidated_services = var.consolidated_services
Expand Down Expand Up @@ -281,7 +281,7 @@ module "settings" {
# -----------------------------------------------------------------------------
module "tfe_init_legacy" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init_legacy?ref=main"
count = var.is_legacy_deployment ? 1 : 0
count = var.is_replicated_deployment ? 1 : 0

# TFE & Replicated Configuration data
cloud = "azurerm"
Expand Down Expand Up @@ -333,7 +333,7 @@ module "load_balancer" {
# General
active_active = local.active_active
domain_name = var.domain_name
is_legacy_deployment = var.is_legacy_deployment
is_replicated_deployment = var.is_replicated_deployment
tfe_subdomain = var.tfe_subdomain
resource_group_name_dns = module.resource_groups.resource_group_name_dns
dns_create_record = var.dns_create_record
Expand Down Expand Up @@ -400,7 +400,7 @@ module "vm" {
vm_subnet_id = local.network.private_subnet.id
vm_upgrade_mode = var.vm_upgrade_mode
vm_user = var.vm_user
vm_userdata_script = var.is_legacy_deployment ? module.tfe_init_legacy[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
vm_userdata_script = var.is_replicated_deployment ? module.tfe_init_legacy[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
vm_vmss_scale_in_rule = var.vm_vmss_scale_in_rule
vm_vmss_scale_in_force_deletion_enabled = var.vm_vmss_scale_in_force_deletion_enabled
vm_zone_balance = var.vm_zone_balance
Expand Down
12 changes: 6 additions & 6 deletions modules/load_balancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ resource "azurerm_application_gateway" "tfe_ag" {

# TFE Console
dynamic "frontend_port" {
for_each = !var.active_active && var.is_legacy_deployment ? [1] : []
for_each = !var.active_active && var.is_replicated_deployment ? [1] : []

content {
name = local.console_frontend_port_name
Expand All @@ -269,7 +269,7 @@ resource "azurerm_application_gateway" "tfe_ag" {
}

dynamic "http_listener" {
for_each = !var.active_active && var.is_legacy_deployment ? [1] : []
for_each = !var.active_active && var.is_replicated_deployment ? [1] : []

content {
name = local.console_frontend_http_listener_name
Expand All @@ -281,7 +281,7 @@ resource "azurerm_application_gateway" "tfe_ag" {
}

dynamic "backend_http_settings" {
for_each = !var.active_active && var.is_legacy_deployment ? [1] : []
for_each = !var.active_active && var.is_replicated_deployment ? [1] : []

content {
name = local.console_backend_http_settings_name
Expand All @@ -297,7 +297,7 @@ resource "azurerm_application_gateway" "tfe_ag" {
}

dynamic "request_routing_rule" {
for_each = !var.active_active && var.is_legacy_deployment ? [1] : []
for_each = !var.active_active && var.is_replicated_deployment ? [1] : []

content {
name = local.console_request_routing_rule_name
Expand Down Expand Up @@ -360,7 +360,7 @@ resource "azurerm_lb_backend_address_pool" "tfe_load_balancer_be" {
}

resource "azurerm_lb_probe" "tfe_load_balancer_probe_console" {
count = var.load_balancer_type == "load_balancer" && !var.active_active && var.is_legacy_deployment ? 1 : 0
count = var.load_balancer_type == "load_balancer" && !var.active_active && var.is_replicated_deployment ? 1 : 0

name = "${var.friendly_name_prefix}-lb-probe-console"

Expand All @@ -371,7 +371,7 @@ resource "azurerm_lb_probe" "tfe_load_balancer_probe_console" {
}

resource "azurerm_lb_rule" "tfe_load_balancer_rule_console" {
count = var.load_balancer_type == "load_balancer" && !var.active_active && var.is_legacy_deployment ? 1 : 0
count = var.load_balancer_type == "load_balancer" && !var.active_active && var.is_replicated_deployment ? 1 : 0

name = "${var.friendly_name_prefix}-lb-rule-console"

Expand Down
2 changes: 1 addition & 1 deletion modules/load_balancer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variable "domain_name" {
description = "(Required) Domain to create Terraform Enterprise subdomain within"
}

variable "is_legacy_deployment" {
variable "is_replicated_deployment" {
type = bool
description = "TFE will be installed using a Replicated license and deployment method."
}
Expand Down
2 changes: 1 addition & 1 deletion modules/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ resource "azurerm_network_security_group" "tfe_network_private_nsg" {

# Allow inbound between TFE instances on port 8201 for vault cluster
dynamic "security_rule" {
for_each = var.active_active && !var.is_legacy_deployment ? [1] : []
for_each = var.active_active && !var.is_replicated_deployment ? [1] : []

content {
name = "allow-private-inbound-vault-cluster"
Expand Down
2 changes: 1 addition & 1 deletion modules/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ variable "enable_ssh" {
description = "Enable SSH access on port 22 to the VM instance (standalone, load_balancer deployments only, not App GW). This is ***NOT RECOMMENDED*** for production deployments."
}

variable "is_legacy_deployment" {
variable "is_replicated_deployment" {
type = bool
description = "TFE will be installed using a Replicated license and deployment method."
}
Expand Down
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ output "tfe_application_url" {
}

output "login_url" {
value = var.is_legacy_deployment ? "https://${module.load_balancer.fqdn}/admin/account/new?token=${module.settings[0].tfe_configuration.user_token.value}" : "On the TFE instance, retrieve the IACT Token with `docker exec -t terraform-enterprise-tfe-1 /bin/bash -c /usr/local/bin/retrieve-iact` and then navigate to https://${module.load_balancer.fqdn}/admin/account/new?token=<IACT_TOKEN>."
value = var.is_replicated_deployment ? "https://${module.load_balancer.fqdn}/admin/account/new?token=${module.settings[0].tfe_configuration.user_token.value}" : "On the TFE instance, retrieve the IACT Token with `docker exec -t terraform-enterprise-tfe-1 /bin/bash -c /usr/local/bin/retrieve-iact` and then navigate to https://${module.load_balancer.fqdn}/admin/account/new?token=<IACT_TOKEN>."
description = "Login URL to setup the TFE instance once it is initialized"
}

output "tfe_console_url" {
value = var.is_legacy_deployment ? "https://${module.load_balancer.fqdn}:8800" : "This is only used for legacy deployments."
value = var.is_replicated_deployment ? "https://${module.load_balancer.fqdn}:8800" : "This is only used for legacy deployments."
description = "Terraform Enterprise Console URL"
}

Expand Down Expand Up @@ -80,12 +80,12 @@ output "bastion_host_dns_name" {
# User_data
# ---------
output "tfe_userdata_base64_encoded" {
value = var.is_legacy_deployment ? module.tfe_init_legacy[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
value = var.is_replicated_deployment ? module.tfe_init_legacy[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
description = "The Base64 encoded User Data script built from terraform-random-tfe-utility/modules/tfe_init"
}

output "tfe_console_password" {
value = var.is_legacy_deployment ? module.settings[0].replicated_configuration.DaemonAuthenticationPassword : "This is only for legacy deployments."
value = var.is_replicated_deployment ? module.settings[0].replicated_configuration.DaemonAuthenticationPassword : "This is only for legacy deployments."
description = "The password for the TFE console"
}

Expand Down
4 changes: 2 additions & 2 deletions tests/private-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module "private_active_active" {
load_balancer_type = "application_gateway"
load_balancer_sku_name = "WAF_v2"
load_balancer_sku_tier = "WAF_v2"
load_balancer_waf_rule_set_version = var.is_legacy_deployment ? "3.1" : "3.2"
load_balancer_waf_rule_set_version = var.is_replicated_deployment ? "3.1" : "3.2"
redis_use_password_auth = true
redis_use_tls = false
production_type = "external"
Expand All @@ -81,7 +81,7 @@ module "private_active_active" {
tags = local.common_tags

# FDO Specific Values
is_legacy_deployment = var.is_legacy_deployment
is_replicated_deployment = var.is_replicated_deployment
hc_license = var.hc_license
license_reporting_opt_out = true
registry_password = var.registry_password
Expand Down
Loading

0 comments on commit 0acc5dc

Please sign in to comment.