Skip to content

Commit

Permalink
legacy/replicated change
Browse files Browse the repository at this point in the history
  • Loading branch information
anniehedgpeth committed Sep 21, 2023
1 parent 1377b0c commit 9bebb95
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 74 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/handler-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,104 +108,104 @@ jobs:
}\n\
}\n/'

active_active_rhel7_proxy_legacy:
active_active_rhel7_proxy_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main
secrets: inherit
name: Destroy resources from AWS Active/Active RHEL7 Proxy (Legacy)
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'active-active-rhel7-proxy-legacy') }}
name: Destroy resources from AWS Active/Active RHEL7 Proxy (Replicated)
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'active-active-rhel7-proxy-replicated') }}
with:
cloud: AWS
test_name: Active/Active RHEL7 Proxy (Legacy)
test_name: Active/Active RHEL7 Proxy (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-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 }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/active-active-rhel7-proxy
TFC_token_secret_name: ACTIVE_ACTIVE_RHEL7_PROXY_LEGACY_TFC_TOKEN
TFC_token_secret_name: ACTIVE_ACTIVE_RHEL7_PROXY_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\
backend "remote" {\n\
organization = "terraform-enterprise-modules-test"\n\
workspaces {\n\
name = "aws-active-active-rhel7-proxy-legacy"\n\
name = "aws-active-active-rhel7-proxy-replicated"\n\
}\n\
}\n/'

public_active_active_legacy:
public_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main
secrets: inherit
name: Destroy resources from AWS Public Active/Active (Legacy)
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') }}
name: Destroy resources from AWS Public Active/Active (Replicated)
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-replicated') }}
with:
cloud: AWS
test_name: Public Active/Active (Legacy)
test_name: Public Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-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 }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/public-active-active
TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-public-active-active/aws-public-active-active-legacy/
TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-public-active-active/aws-public-active-active-replicated/

private_active_active_legacy:
private_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main
secrets: inherit
name: Destroy resources from AWS Private Active/Active (Legacy)
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') }}
name: Destroy resources from AWS Private Active/Active (Replicated)
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-replicated') }}
with:
cloud: AWS
test_name: Private Active/Active (Legacy)
test_name: Private Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-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 }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/private-active-active
TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-active-active/aws-private-active-active-legacy/
TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-active-active/aws-private-active-active-replicated/

private_tcp_active_active_legacy:
private_tcp_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main
secrets: inherit
name: Destroy resources from AWS Private TCP Active/Active (Legacy)
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') }}
name: Destroy resources from AWS Private TCP Active/Active (Replicated)
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-replicated') }}
with:
cloud: AWS
test_name: Private TCP Active/Active (Legacy)
test_name: Private TCP Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-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 }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/private-tcp-active-active
TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-tcp-active-active/aws-private-tcp-active-active-legacy/
TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-tcp-active-active/aws-private-tcp-active-active-replicated/

standalone_vault_legacy:
standalone_vault_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/destroy.yml@main
secrets: inherit
name: Destroy resources from AWS Standalone Vault (Legacy)
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') }}
name: Destroy resources from AWS Standalone Vault (Replicated)
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-replicated') }}
with:
cloud: AWS
test_name: Standalone Vault (Legacy)
test_name: Standalone Vault (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-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 }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/standalone-vault
TFC_token_secret_name: STANDALONE_VAULT_LEGACY_TFC_TOKEN
TFC_token_secret_name: STANDALONE_VAULT_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\
backend "remote" {\n\
organization = "terraform-enterprise-modules-test"\n\
workspaces {\n\
name = "aws-standalone-vault-legacy"\n\
name = "aws-standalone-vault-replicated"\n\
}\n\
}\n/'
12 changes: 6 additions & 6 deletions .github/workflows/handler-help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
* public-active-active
* standalone-vault
Legacy:
* active-active-rhel7-proxy-legacy
* private-active-active-legacy
* private-tcp-active-active-legacy
* public-active-active-legacy
* standalone-vault-legacy
Replicated:
* active-active-rhel7-proxy-replicated
* private-active-active-replicated
* private-tcp-active-active-replicated
* public-active-active-replicated
* standalone-vault-replicated
reaction-type: confused
60 changes: 30 additions & 30 deletions .github/workflows/handler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
}\n\
}\n/'

active_active_rhel7_proxy_legacy:
active_active_rhel7_proxy_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/aws-tests.yml@main
secrets: inherit
name: Test AWS Active/Active RHEL7 Proxy (Legacy) Scenario
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'active-active-rhel7-proxy-legacy') }}
name: Test AWS Active/Active RHEL7 Proxy (Replicated) Scenario
if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'active-active-rhel7-proxy-replicated') }}
with:
test_name: Active/Active RHEL7 Proxy (Legacy)
test_name: Active/Active RHEL7 Proxy (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-terraform-enterprise
Expand All @@ -124,22 +124,22 @@ jobs:
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/active-active-rhel7-proxy
TFC_token_secret_name: ACTIVE_ACTIVE_RHEL7_PROXY_LEGACY_TFC_TOKEN
TFC_token_secret_name: ACTIVE_ACTIVE_RHEL7_PROXY_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\
backend "remote" {\n\
organization = "terraform-enterprise-modules-test"\n\
workspaces {\n\
name = "aws-active-active-rhel7-proxy-legacy"\n\
name = "aws-active-active-rhel7-proxy-replicated"\n\
}\n\
}\n/'

public_active_active_legacy:
public_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/aws-tests.yml@main
secrets: inherit
name: Test AWS Public Active/Active (Legacy) Scenario
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') }}
name: Test AWS Public Active/Active (Replicated) Scenario
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-replicated') }}
with:
test_name: Public Active/Active (Legacy)
test_name: Public Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-terraform-enterprise
Expand All @@ -148,16 +148,16 @@ jobs:
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/public-active-active
TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-public-active-active/aws-public-active-active-legacy/
TFC_token_secret_name: PUBLIC_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-public-active-active/aws-public-active-active-replicated/

private_active_active_legacy:
private_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/aws-tests.yml@main
secrets: inherit
name: Test AWS Private Active/Active (Legacy) Scenario
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') }}
name: Test AWS Private Active/Active (Replicated) Scenario
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-replicated') }}
with:
test_name: Private Active/Active (Legacy)
test_name: Private Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-terraform-enterprise
Expand All @@ -166,16 +166,16 @@ jobs:
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/private-active-active
TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-active-active/aws-private-active-active-legacy/
TFC_token_secret_name: PRIVATE_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-active-active/aws-private-active-active-replicated/

private_tcp_active_active_legacy:
private_tcp_active_active_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/aws-tests.yml@main
secrets: inherit
name: Test AWS Private TCP Active/Active (Legacy) Scenario
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') }}
name: Test AWS Private TCP Active/Active (Replicated) Scenario
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-replicated') }}
with:
test_name: Private TCP Active/Active (Legacy)
test_name: Private TCP Active/Active (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-terraform-enterprise
Expand All @@ -184,16 +184,16 @@ jobs:
pull_request_ref: ${{ github.event.client_payload.pull_request.head.sha }}
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/private-tcp-active-active
TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_LEGACY_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-tcp-active-active/aws-private-tcp-active-active-legacy/
TFC_token_secret_name: PRIVATE_TCP_ACTIVE_ACTIVE_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: s/aws-private-tcp-active-active/aws-private-tcp-active-active-replicated/

standalone_vault_legacy:
standalone_vault_replicated:
uses: hashicorp/terraform-random-tfe-utility/.github/workflows/aws-tests.yml@main
secrets: inherit
name: Test AWS Standalone Vault (Legacy) Scenario
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') }}
name: Test AWS Standalone Vault (Replicated) Scenario
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-replicated') }}
with:
test_name: Standalone Vault (Legacy)
test_name: Standalone Vault (Replicated)
utility_test: false
is_replicated_deployment: true
module_repository_id: hashicorp/terraform-aws-terraform-enterprise
Expand All @@ -203,11 +203,11 @@ jobs:
pull_request_comment_id: ${{ github.event.client_payload.github.payload.comment.id }}
work_dir: ./tests/standalone-vault
first_apply_args: "-target=module.hcp_vault.hcp_vault_cluster.test -target=module.hcp_vault.hcp_vault_cluster_admin_token.test"
TFC_token_secret_name: STANDALONE_VAULT_LEGACY_TFC_TOKEN
TFC_token_secret_name: STANDALONE_VAULT_REPLICATED_TFC_TOKEN
TFC_workspace_substitution_pattern: 's/terraform {/terraform {\n\
backend "remote" {\n\
organization = "terraform-enterprise-modules-test"\n\
workspaces {\n\
name = "aws-standalone-vault-legacy"\n\
name = "aws-standalone-vault-replicated"\n\
}\n\
}\n/'
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ module "tfe_init_fdo" {
docker_compose_yaml = module.docker_compose_config[0].docker_compose_yaml
}

# ----------------------------------------------------------------------------------------
# TFE and Replicated settings to pass to the tfe_init_legacy module for legacy deployment
# ----------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# TFE and Replicated settings to pass to the tfe_init_replicated module for replicated deployment
# --------------------------------------------------------------------------------------------
module "settings" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/settings?ref=main"
count = var.is_replicated_deployment ? 1 : 0
Expand Down Expand Up @@ -273,8 +273,8 @@ module "settings" {
# -----------------------------------------------------------------------------
# AWS user data / cloud init used to install and configure TFE on instance(s)
# -----------------------------------------------------------------------------
module "tfe_init_legacy" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init_legacy?ref=main"
module "tfe_init_replicated" {
source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init_replicated?ref=main"
count = var.is_replicated_deployment ? 1 : 0

# TFE & Replicated Configuration data
Expand Down Expand Up @@ -354,5 +354,5 @@ module "vm" {
network_subnets_private = local.network_private_subnets
network_private_subnet_cidrs = local.network_private_subnet_cidrs
node_count = var.node_count
user_data_base64 = var.is_replicated_deployment ? module.tfe_init_legacy[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
user_data_base64 = var.is_replicated_deployment ? module.tfe_init_replicated[0].tfe_userdata_base64_encoded : module.tfe_init_fdo[0].tfe_userdata_base64_encoded
}
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ output "tfe_autoscaling_group" {
}

output "replicated_dashboard_password" {
value = var.is_replicated_deployment ? module.settings[0].replicated_configuration.DaemonAuthenticationPassword : "This is only used for legacy deployments."
value = var.is_replicated_deployment ? module.settings[0].replicated_configuration.DaemonAuthenticationPassword : "This is only used for replicated deployments."
description = "The password for the TFE console"
sensitive = true
}
Expand Down
Loading

0 comments on commit 9bebb95

Please sign in to comment.