Skip to content

Conversation

evrtt
Copy link

@evrtt evrtt commented Jul 25, 2025

This PR resolves various issues with this ECS Template

  • Migrate template from deprecated aws_launch_configuration to aws_launch_template. Credit to @marks for this change (AWS docs on deprecation) (5b5f34)

  • Migrate EC2 launch type from network_mode=bridge to network_mode=awsvpc. Resolves issues with network_mode=bridge, establishes consistency with Cloudformation template and simplifies template. Credit to @marks for this change (ee7444)

  • Updates the template to set sane cpu and memory defaults for both the EC2 and Fargate launch types. Replaces non-functional cluster autoscaling policy with a dual-metric (cpu & memory) autoscaling policy to scale tasks (with a TargetTrackingScaling policy_type) and managed scaling of the EC2 instances (0895fe)

  • Correct environment variables logic to set environment variables required for local Temporal deploy on other services only when deploying Temporal locally (8562d0)

  • Update template to support setting environment variables from AWS Secrets Manager. The functionally necessary variables—POSTGRES_PASSWORD, JWT_SECRET,ENCRYPTION_KEY—will now be set on tasks using secrets from values stored in AWS Secrets Manager. The template now supports setting additional optional environment variables similarly with var.additional_secrets (9b8841)

  • Corrections to above changes (a3ca3b)

Successfully deployed with the following configuration with both launch_type = "FARGATE" & launch_type = "EC2":

aws_region = "<region>"
profile = "<profile>"
private_subnet_ids = [<Private Subnet #1 in AZ a>, <Private Subnet #2 in AZ b>]
public_subnet_ids = [<Public Subnet #1 in AZ a>, <Public Subnet #1 in AZ b>]
ssh_key_name = "<ssh key>"
instance_type = "t3.xlarge"
min_instance_count = 5
max_instance_count = 10
maximum_percent = 150
minimum_healthy_percent = 50
retool_license_key = "<license key>"
ecs_retool_image = "tryretool/backend:3.196.9-stable"
ecs_code_executor_image = "tryretool/code-executor-service:3.196.9-stable"
rds_instance_class = "db.t3.micro"
rds_storage_type = "gp3"
rds_allocated_storage = 20
vpc_id = "<vpc-d>"
launch_type = "FARGATE" | "EC2"
workflows_enabled = true
use_existing_temporal_cluster = true
code_executor_enabled = true
telemetry_enabled = false
additional_env_vars = [
        {
            name = "BASE_DOMAIN",
            value = "<base domain>"
        }
    ]

@evrtt evrtt requested a review from marks July 25, 2025 04:21
@evrtt evrtt changed the title Migrate from aws_launch_configuration to aws_launch_template Maintenance and various fixes July, 2025 Jul 25, 2025
@evrtt evrtt closed this Jul 25, 2025
@evrtt evrtt reopened this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant