From ef37b1dda3ecb9550e7a964d5e9d51c2fe26122a Mon Sep 17 00:00:00 2001 From: preethamr Date: Wed, 28 Feb 2024 16:44:55 -0800 Subject: [PATCH 1/2] fix: resolve tf conflicts --- ops/testnet/staging/core/config.tf | 40 ----------------------------- ops/testnet/staging/core/main.tf | 6 ++--- ops/testnet/staging/core/outputs.tf | 8 ------ 3 files changed, 3 insertions(+), 51 deletions(-) diff --git a/ops/testnet/staging/core/config.tf b/ops/testnet/staging/core/config.tf index f851185ec2..6208ff19a0 100644 --- a/ops/testnet/staging/core/config.tf +++ b/ops/testnet/staging/core/config.tf @@ -74,20 +74,6 @@ locals { { name = "STAGE", value = var.stage }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] - watcher_env_vars = [ - { name = "WATCHER_CONFIG", value = local.local_watcher_config }, - { name = "ENVIRONMENT", value = var.environment }, - { name = "STAGE", value = var.stage }, - { name = "DD_PROFILING_ENABLED", value = "true" }, - { name = "DD_ENV", value = var.stage } - ] - watcher_web3signer_env_vars = [ - { name = "WEB3_SIGNER_PRIVATE_KEY", value = var.watcher_web3_signer_private_key }, - { name = "WEB3SIGNER_HTTP_HOST_ALLOWLIST", value = "*" }, - { name = "ENVIRONMENT", value = var.environment }, - { name = "STAGE", value = var.stage }, - { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, - ] } locals { @@ -317,30 +303,4 @@ locals { environment = var.stage web3SignerUrl = "https://${module.relayer_web3signer.service_endpoint}" }) - - local_watcher_config = jsonencode({ - server = { - adminToken = var.admin_token_watcher - } - logLevel = "debug" - environment = "staging" - chains = { - "1869640549" = { - providers = ["https://sepolia.optimism.io/"] - } - "1936027759" = { - providers = ["https://eth-sepolia.public.blastapi.io"] - } - "1633842021" = { - providers = ["https://sepolia-rollup.arbitrum.io/rpc"] - } - } - web3SignerUrl = "https://${module.watcher_web3signer.service_endpoint}" - environment = var.stage - discordHookUrl = "https://discord.com/api/webhooks/${var.discord_webhook_key}" - telegramApiKey = "${var.telegram_api_key}" - telegramChatId = "${var.telegram_chat_id}" - betterUptimeApiKey = "${var.betteruptime_api_key}" - betterUptimeRequesterEmail = "${var.betteruptime_requester_email}" - }) } diff --git a/ops/testnet/staging/core/main.tf b/ops/testnet/staging/core/main.tf index e4b6c1d9e7..1cdc6d0794 100755 --- a/ops/testnet/staging/core/main.tf +++ b/ops/testnet/staging/core/main.tf @@ -460,7 +460,7 @@ module "relayer" { ingress_ipv6_cdir_blocks = [] service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg]) cert_arn = var.certificate_arn_testnet - container_env_vars = merge(local.relayer_env_vars, { RELAYER_SERVICE = "poller" }) + container_env_vars = concat(local.relayer_env_vars, [{ name = "RELAYER_SERVICE", value = "poller" }]) } module "relayer_server" { @@ -488,8 +488,8 @@ module "relayer_server" { ingress_cdir_blocks = [module.network.vpc_cdir_block] ingress_ipv6_cdir_blocks = [] service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg]) - cert_arn = var.certificate_arn - container_env_vars = merge(local.relayer_env_vars, { RELAYER_SERVICE = "server" }) + cert_arn = var.certificate_arn_testnet + container_env_vars = concat(local.relayer_env_vars, [{ name = "RELAYER_SERVICE", value = "server" }]) } module "relayer_web3signer" { diff --git a/ops/testnet/staging/core/outputs.tf b/ops/testnet/staging/core/outputs.tf index 11387076ca..8e7ef3cc12 100755 --- a/ops/testnet/staging/core/outputs.tf +++ b/ops/testnet/staging/core/outputs.tf @@ -61,14 +61,6 @@ output "relayer-dns" { value = module.relayer.dns_name } -output "watcher-service-endpoint" { - value = module.watcher.service_endpoint -} - -output "watcher-dns" { - value = module.watcher.dns_name -} - output "rmq-management-endpoint" { value = module.centralised_message_queue.aws_mq_broker_console } From a2565701e724b401ae4fb1280a0580f1a7c26d4e Mon Sep 17 00:00:00 2001 From: preethamr Date: Wed, 28 Feb 2024 16:58:23 -0800 Subject: [PATCH 2/2] fix: deploy as testnet production --- ops/testnet/staging/backend/config.tf | 10 +++++----- ops/testnet/staging/core/config.tf | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ops/testnet/staging/backend/config.tf b/ops/testnet/staging/backend/config.tf index 3d678dc52e..3daa6c20a1 100644 --- a/ops/testnet/staging/backend/config.tf +++ b/ops/testnet/staging/backend/config.tf @@ -3,7 +3,7 @@ locals { cartographer_env_vars = { CARTOGRAPHER_CONFIG = local.local_cartographer_config, DATABASE_URL = "postgres://${var.postgres_user}:${var.postgres_password}@${module.cartographer_db.db_instance_endpoint}/connext", - ENVIRONMENT = var.environment, + ENVIRONMENT = "production", STAGE = var.stage, DD_ENV = "${var.environment}-${var.stage}", DD_LOGS_ENABLED = true, @@ -16,13 +16,13 @@ locals { { name = "PGRST_DB_URI", value = "postgres://${var.postgres_user}:${var.postgres_password}@${module.cartographer_db.db_instance_endpoint}/connext" }, { name = "PGRST_DB_SCHEMA", value = "public" }, { name = "PGRST_DB_ANON_ROLE", value = "query" }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage } ] sdk_server_env_vars = [ { name = "SDK_SERVER_CONFIG", value = local.local_sdk_server_config }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_PROFILING_ENABLED", value = "true" }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, @@ -44,7 +44,7 @@ locals { # The following are defined in variables.tf and don't map to the # definitions of environment and network in agent configs. - environment = var.stage + environment = "production" network = var.environment redis = { @@ -69,6 +69,6 @@ locals { "1936027759" = { confirmations = 10 } "1869640549" = { confirmations = 10 } } - environment = var.stage + environment = "production" }) } diff --git a/ops/testnet/staging/core/config.tf b/ops/testnet/staging/core/config.tf index 6208ff19a0..aefb19e688 100644 --- a/ops/testnet/staging/core/config.tf +++ b/ops/testnet/staging/core/config.tf @@ -7,14 +7,14 @@ locals { sequencer_env_vars = [ { name = "SEQ_CONFIG", value = local.local_sequencer_config }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_PROFILING_ENABLED", value = "true" }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] router_env_vars = [ { name = "NXTP_CONFIG", value = local.local_router_config }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_PROFILING_ENABLED", value = "true" }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, @@ -25,7 +25,7 @@ locals { ]) lighthouse_env_vars = { NXTP_CONFIG = local.local_lighthouse_config, - ENVIRONMENT = var.environment, + ENVIRONMENT = "production", STAGE = var.stage, DD_LOGS_ENABLED = true, DD_ENV = "${var.environment}-${var.stage}", @@ -34,7 +34,7 @@ locals { } lighthouse_prover_subscriber_env_vars = [ { name = "NXTP_CONFIG", value = local.local_lighthouse_config }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_PROFILING_ENABLED", value = "true" }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, @@ -42,27 +42,27 @@ locals { lighthouse_web3signer_env_vars = [ { name = "WEB3_SIGNER_PRIVATE_KEY", value = var.lighthouse_web3_signer_private_key }, { name = "WEB3SIGNER_HTTP_HOST_ALLOWLIST", value = "*" }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] router_web3signer_env_vars = [ { name = "WEB3_SIGNER_PRIVATE_KEY", value = var.router_web3_signer_private_key }, { name = "WEB3SIGNER_HTTP_HOST_ALLOWLIST", value = "*" }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] sequencer_web3signer_env_vars = [ { name = "WEB3_SIGNER_PRIVATE_KEY", value = var.sequencer_web3_signer_private_key }, { name = "WEB3SIGNER_HTTP_HOST_ALLOWLIST", value = "*" }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] relayer_env_vars = [ { name = "NXTP_CONFIG", value = local.local_relayer_config }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_PROFILING_ENABLED", value = "true" }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, @@ -70,7 +70,7 @@ locals { relayer_web3signer_env_vars = [ { name = "WEB3_SIGNER_PRIVATE_KEY", value = var.relayer_web3_signer_private_key }, { name = "WEB3SIGNER_HTTP_HOST_ALLOWLIST", value = "*" }, - { name = "ENVIRONMENT", value = var.environment }, + { name = "ENVIRONMENT", value = "production" }, { name = "STAGE", value = var.stage }, { name = "DD_ENV", value = "${var.environment}-${var.stage}" }, ] @@ -113,7 +113,7 @@ locals { url = "https://${module.relayer_server.service_endpoint}" } ] - environment = var.stage + environment = "production" database = { url = local.default_db_url } @@ -215,7 +215,7 @@ locals { } cartographerUrl = "https://postgrest.testnet.staging.connext.ninja" web3SignerUrl = "https://${module.router_web3signer.service_endpoint}" - environment = var.stage + environment = "production" messageQueue = { uri = "amqps://${var.rmq_mgt_user}:${var.rmq_mgt_password}@${module.centralised_message_queue.aws_mq_amqp_endpoint}" } @@ -251,7 +251,7 @@ locals { url = "https://${module.relayer_server.service_endpoint}" } ] - environment = var.stage + environment = "production" database = { url = local.default_db_url } @@ -300,7 +300,7 @@ locals { providers = ["https://sepolia-rollup.arbitrum.io/rpc"] } } - environment = var.stage + environment = "production" web3SignerUrl = "https://${module.relayer_web3signer.service_endpoint}" }) }