From 79611d68c5c81b18c83855a56043e83fe79fcc88 Mon Sep 17 00:00:00 2001 From: Arseni Kalma Date: Thu, 19 Feb 2026 10:55:51 +0100 Subject: [PATCH] Add ECR and ECS for zebra swaps --- .../dev/account.hcl | 2 +- .../zsa/ecr-swaps/.terraform.lock.hcl | 24 ++++++ .../eu-central-1/zsa/ecr-swaps/terragrunt.hcl | 25 +++++++ .../zsa/ecs-swaps/.terraform.lock.hcl | 43 +++++++++++ .../eu-central-1/zsa/ecs-swaps/terragrunt.hcl | 73 +++++++++++++++++++ 5 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/.terraform.lock.hcl create mode 100644 testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/terragrunt.hcl create mode 100644 testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/.terraform.lock.hcl create mode 100644 testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl diff --git a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/account.hcl b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/account.hcl index 74054ea748e..726e4b81562 100644 --- a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/account.hcl +++ b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/account.hcl @@ -3,5 +3,5 @@ locals { account_name = "qed-it" aws_profile = "qed-it" - aws_account_id = run_cmd("--terragrunt-quiet", "aws", "sts", "get-caller-identity", "--profile", local.aws_profile, "--query", "Account", "--output", "text") + aws_account_id = "496038263219" } diff --git a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/.terraform.lock.hcl b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/.terraform.lock.hcl new file mode 100644 index 00000000000..04be6d5fa4c --- /dev/null +++ b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "6.33.0" + hashes = [ + "h1:wNrviem6bg9fq1bYvtGqH9QWO6iWbM1bBRLSqFJWqWM=", + "zh:207f3f9db05c11429a241b84deeecfbd4caa941792c2c49b09c8c85cd59474dd", + "zh:25c36ad1f4617aeb23f8cd18efc7856127db721f6cf3e2e474236af019ce9ad1", + "zh:2685af1f3eb9abfce3168777463eaaad9dba5687f9f84d8bb579cb878bcfa18b", + "zh:57e28457952cf43923533af0a9bb322164be5fc3d66c080b5c59ee81950e9ef6", + "zh:5b6cd074f9e3a8d91841e739d259fe11f181e69c4019e3321231b35c0dde08c8", + "zh:6e3251500cebf1effb9c68d49041268ea270f75b122b94d261af231a8ebfa981", + "zh:7eee56f52f4b94637793508f3e83f68855f5f884a77aed2bd2fe77480c89e33d", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9e228c92db1b9e36a0f899d6ab7446e6b8cf3183112d4f1c1613d6827a0ed3d6", + "zh:b34a84475e91715352ed1119b21e51a81d8ad12e93c86d4e78cd2d315d02dcab", + "zh:cdcc05a423a78a9b2c4e2844c58ecbf2ce6a3117cab353fa05197782d6f76667", + "zh:d0f5f6b1399cfa1b64f3e824bee9e39ff15d5a540ff197e9bfc157fe354a8426", + "zh:d9525dbb53468dee6b8e6d15669d25957e9872bf1cd386231dff93c8c659f1d7", + "zh:ed37db2df08b961a7fc390164273e602767ca6922f57560daa9678a2e1315fd0", + "zh:f6adc66b86e12041a2d3739600e6a153a1f5752dd363db11469f6f4dbd090080", + ] +} diff --git a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/terragrunt.hcl b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/terragrunt.hcl new file mode 100644 index 00000000000..16484752d15 --- /dev/null +++ b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecr-swaps/terragrunt.hcl @@ -0,0 +1,25 @@ +locals { + # Automatically load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) + + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl")) + # Extract out common variables for reuse + env = local.environment_vars.locals.environment +} + +# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the +# working directory, into a temporary folder, and execute your Terraform commands in that folder. +terraform { + source = "../../../../../terraform-aws-modules/ecr" +} + +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +inputs = { + env = local.env + name = "zebra-server-swaps" +} diff --git a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/.terraform.lock.hcl b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/.terraform.lock.hcl new file mode 100644 index 00000000000..43787401746 --- /dev/null +++ b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/.terraform.lock.hcl @@ -0,0 +1,43 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "6.31.0" + hashes = [ + "h1:pQvUqZS7sRQzYj06cmDoRL/AkRgGo16laRl2nDQC0hQ=", + "zh:0184b83f61dfb2f90f051d6a10e85d554809eb7dec13c49000bc884cfd1e956d", + "zh:16f76019ad67f0dfafea2c65b17bd1aa289cb5c275521df71337e23b08af6fec", + "zh:296ebaa261729b78159694e3ca709735c5c67913d6107c7e1abd4d1e9b05fc6b", + "zh:6b4c37bd7e8abca1b428903212de731b04695dcc59e2ba2acefc3d936b36c4dc", + "zh:6f49e2f7464dbb9d6911dd32951637f589d21a5c3c9a7c5056837701977ec803", + "zh:6fc4095e59286dd83e9528346390b0b07b3bffa1d46b50027c9e080352207626", + "zh:98816c0c5d1b956b564c2d2feb423fdf4eb3e476a6c5202668a285ff3b2d6910", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:a70b34fb8d5a7d3b3823046938f3c9b0527afa93d02086b3d87ffa668c9a350e", + "zh:c24c0a58a8301d13cb4c27738840c8e7e0f29563ccf8d6b5ca1c87fcf21bdf89", + "zh:c95d44b2baea56b03198acaaf50f9196504d0207118e1afca7d70b5840315dc4", + "zh:db5a7692e2bde721a37b83f89eb9886715dbd17eb45858b1b58b8f7903ce5144", + "zh:db706b23a652e06c6c3f5de1da70e55a20a4fc2f73c01c24f7b9cd39a9a35f56", + "zh:fb781119fa98d8b0318ffb26ef013d5e674637e8f6a36b4b9c2742f24c022538", + "zh:fc459573b260a5a295d5fed442bf4f44fe034a0702ca22a65d320bd3b3e70eb5", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.8.1" + hashes = [ + "h1:u8AKlWVDTH5r9YLSeswoVEjiY72Rt4/ch7U+61ZDkiQ=", + "zh:08dd03b918c7b55713026037c5400c48af5b9f468f483463321bd18e17b907b4", + "zh:0eee654a5542dc1d41920bbf2419032d6f0d5625b03bd81339e5b33394a3e0ae", + "zh:229665ddf060aa0ed315597908483eee5b818a17d09b6417a0f52fd9405c4f57", + "zh:2469d2e48f28076254a2a3fc327f184914566d9e40c5780b8d96ebf7205f8bc0", + "zh:37d7eb334d9561f335e748280f5535a384a88675af9a9eac439d4cfd663bcb66", + "zh:741101426a2f2c52dee37122f0f4a2f2d6af6d852cb1db634480a86398fa3511", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:a902473f08ef8df62cfe6116bd6c157070a93f66622384300de235a533e9d4a9", + "zh:b85c511a23e57a2147355932b3b6dce2a11e856b941165793a0c3d7578d94d05", + "zh:c5172226d18eaac95b1daac80172287b69d4ce32750c82ad77fa0768be4ea4b8", + "zh:dab4434dba34aad569b0bc243c2d3f3ff86dd7740def373f2a49816bd2ff819b", + "zh:f49fd62aa8c5525a5c17abd51e27ca5e213881d58882fd42fec4a545b53c9699", + ] +} diff --git a/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl new file mode 100644 index 00000000000..f6f3aab41ba --- /dev/null +++ b/testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl @@ -0,0 +1,73 @@ +locals { + # Automatically load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) + + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl")) + # Extract out common variables for reuse + env = local.environment_vars.locals.environment +} + +# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the +# working directory, into a temporary folder, and execute your Terraform commands in that folder. +terraform { + source = "../../../../../terraform-aws-modules/ecs" +} + +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +dependency "vpc" { + config_path = "../vpc" +} + +dependency "ecr" { + config_path = "../ecr" +} + +inputs = { + name = "zebra-swaps" + environment = local.env + region = local.region_vars.locals.aws_region + account_id = local.account_vars.locals.aws_account_id + + vpc_id = dependency.vpc.outputs.vpc_id + private_subnets = dependency.vpc.outputs.private_subnets + public_subnets = dependency.vpc.outputs.public_subnets + + image = "${dependency.ecr.outputs.ecr-url}:latest" + + task_memory=4096 + task_cpu=1024 + + enable_logging = true + enable_backup = false + + enable_domain = true + domain = "zebra-swaps.zsa-test.net" + zone_name = "zsa-test.net" + + persistent_volume_size = 40 + + port_mappings = [ + { + containerPort = 80 + hostPort = 80 + protocol = "tcp" + }, + { + containerPort = 443 + hostPort = 443 + protocol = "tcp" + }, + // Zebra ports are: + // TCP ports: + { // RPC PubSub + containerPort = 18232 + hostPort = 18232 + protocol = "tcp" + } + ] +}