rvn-ecs-nlb · Latest version: 0.2.2
Dependencies and consumers
Every dependency input can be specified manually to reference existing external infrastructure rather than a Ravion module.Readme
Network Load Balanced ECS service for running TCP, UDP, or TLS workloads behind an ECS cluster Network Load Balancer.Overview
The ECS Network Service module creates an ECS service in an existing Ravion ECS cluster and attaches it to a public or private Network Load Balancer. Select an ECS cluster, choose how the container image is built or supplied, configure the NLB listener and target group health checks, and Ravion provisions the service, target groups, listener, IAM roles, security group, ECR repository when needed, and autoscaling settings. The module is intentionally focused on Layer 4 services behind a Network Load Balancer. Use ECS Web Service for HTTP host and path routing through an Application Load Balancer. Terraform source: flightcontrolhq/modules/compute/ecs_serviceUse cases
Cluster and networking
An ECS cluster is required. The cluster reference supplies the cluster ARN, VPC ID, public and private subnet IDs, Network Load Balancer ARNs, NLB security groups, capacity provider names, AWS account, region, and execution environment. Use Public network service when the service should be reachable through the public Network Load Balancer. Turn it off for internal services that should use the private Network Load Balancer. Use Run in private subnets for most production services. Private subnets keep tasks off the public internet and route outbound traffic through NAT or equivalent egress. Turning it off runs tasks in public subnets and assigns public IPs. NLB ingress CIDRs controls which IPv4 CIDR blocks can reach the public listener. It defaults to0.0.0.0/0. Private NLB ingress CIDRs applies when Public network service is off and defaults to the RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
Build and image options
For Railpack and Dockerfile builds, provide Git repository, Git branch, and optionally Source base path. Ravion pushes built images to the service ECR repository and deploys by image digest.
Railpack settings let you optionally pin the Railpack version and override install, build, and start commands. Leave them blank to use Railpack defaults and autodetection.
For Pull from image registry, provide the image repository without the tag. At deploy time, provide the tag to use. Use Registry credentials secret ARN for private registries that require ECS repository credentials. Use Start command to override the image default CMD when the image needs a different service command.
Listener and target group
The service always creates an NLB listener and target group on the selected cluster Network Load Balancer. Configure Listener port for the port clients connect to and Container port for the port the app listens on inside the ECS task. Ravion also sets thePORT runtime environment variable from Container port.
TLS listeners require an ACM certificate module reference. TLS SSL policy defaults to
ELBSecurityPolicy-TLS13-1-2-2021-06. TLS ALPN policy is optional; leave it as None unless clients need a specific ALPN behavior. TLS target protocol controls traffic from the NLB to the ECS task: use TCP when the NLB terminates TLS, or TLS when the task should receive encrypted backend traffic.
Source IP stickiness is off by default. Enable it when repeat traffic from the same source IP should stay on the same task when possible.
Health checks
Health checks default to TCP, which is the safest default for generic Layer 4 workloads. Use HTTP or HTTPS only when the container exposes an HTTP-compatible health endpoint.
Increase the grace period for services with slow startup. Lower the deregistration delay only when fast replacement is more important than giving existing connections time to drain.
Capacity and runtime
Choose one primary Capacity provider:
You can add secondary providers with Also use Fargate, Also use Fargate spot, and Also use EC2. Mixed strategies can reduce cost or increase placement flexibility, but each enabled provider must exist on the selected cluster.
For Fargate and Fargate Spot, App size defaults to 2 vCPU and 4 GB memory. App ephemeral storage uses the AWS default of 20 GiB unless you increase it to 21-200 GiB. For EC2 capacity, App vCPU defaults to 1.5 and App memory in GB defaults to 3.5; leave spare CPU and memory on each EC2 instance for the ECS agent and system processes.
CPU architecture defaults to x86_64 for broad compatibility. Choose ARM64 only when the image and native dependencies support it.
Autoscaling
Autoscaling is enabled by default with one minimum task and three maximum tasks. For production, start with at least two minimum tasks when availability matters. When autoscaling is disabled, Desired tasks controls how many tasks the ECS service keeps running.
Scheduled scaling actions and custom metric scaling policies are available for advanced capacity patterns.
Application configuration
Use Runtime environment variables for plain container environment values. Ravion also sets PORT from Container port. Use Runtime secrets for sensitive values. Secrets are injected into the ECS task from SSM Parameter Store or Secrets Manager using name and value_from objects. Use Build environment variables for values needed during image builds. Values can be plain strings or references loaded from Parameter Store or Secrets Manager. For Dockerfile builds, enable Inject environment variables in Dockerfile to pass those values as Docker build arguments.Persistent storage
Enable the EFS file system setting, select a Ravion EFS module, and set the EFS mount path. Ravion adds the task volume, mounts it into the app container, attaches the file system’s client security group to the service so NFS traffic is allowed, and mounts through the file system’s access point when one is enabled. Sidecars mount the same file system through their Mount points setting withefs as the source volume.
EFS volumes work with Fargate and EC2 Linux tasks and keep data across task replacement. Transit encryption is enabled by default. Enable EFS IAM authorization to authorize file system access with the task role; the task role must allow elasticfilesystem:ClientMount, plus elasticfilesystem:ClientWrite or elasticfilesystem:ClientRootAccess as needed.
Deployment
Deployment strategy defaults to Rolling. Blue/green, Linear, and Canary use the native ECS traffic-shift controller with production and alternate target groups. The deployment strategy can change between deploys without changing Terraform infrastructure. Deployments update the ECS service task definition with the selected image, generated container definition, awslogs or FireLens configuration, runtime platform, environment variables, secrets, and capacity-provider-compatible task settings. The deploy-time Image value depends on the build source:
Run pre-deploy command and Run post-deploy command start optional one-off ECS tasks before or after each deployment. These commands use the deployed app image, the app container name, the configured task role and execution role, the selected capacity provider strategy, service subnets, service security groups, runtime environment variables, and runtime secrets. Leave either toggle disabled to skip that hook and hide its settings.
Use pre-deploy commands for work that must complete before the service updates, such as database migrations. Use post-deploy commands for work that should happen after a successful deployment, such as cache warming. Commands are ECS command argument arrays. For shell behavior, use
/bin/sh, -lc, and your shell command as separate arguments.
Logging and observability
CloudWatch logging is enabled by default and appears in the Logs tab. Enable FireLens log routing when app logs should also go to destinations such as Datadog, Splunk, Firehose, OpenSearch, or S3. Keep CloudWatch output enabled unless logs should go exclusively to an external destination. The Metrics tab includes common ECS service metrics plus Network Load Balancer target group health metrics for healthy and unhealthy hosts.Configuration
*Conditionally required based on the selected listener protocol, health check protocol, build type, autoscaling mode, or capacity provider.
Design decisions
- The module always models a Layer 4 service behind a Network Load Balancer. HTTP host and path routing are intentionally outside this module definition.
- The listener is created by the service stack on the selected public or private cluster NLB, so each ECS Network Service owns its listener port.
- Tasks default to private subnets even for public network services. The NLB is public; the tasks remain private when the VPC has NAT or equivalent egress.
- Health checks default to TCP because the module supports non-HTTP protocols.
- Built images are pushed to an ECR repository created with the service stack. Pull from image registry lets teams bring their own image pipeline.
- Desired count uses the autoscaling minimum when autoscaling is enabled and the Desired tasks input when autoscaling is disabled.
- Advanced Terraform variables exist for exceptional lower-level overrides. Prefer the typed Ravion fields whenever possible.
Learn more
- Amazon ECS services
- Network Load Balancers
- Network Load Balancer listeners
- Target group health checks
- Amazon ECS capacity providers
- Amazon ECS service auto scaling
- Railpack documentation
Inputs reference
All inputs forrvn-ecs-nlb version 0.2.2. Use the name shown for each field as the input key in module config.
ECS cluster
ECS cluster.
- Immutable after creation
Network service
Service name. Name for the ECS service and related resources.
- Default:
<<project.given_id>>-<<environment.given_id>>-<<module.given_id>> - Immutable after creation
- Pattern:
^[A-Za-z0-9][A-Za-z0-9_-]{0,254}$— Use 1-255 letters, numbers, underscores, or hyphens, starting with a letter or number.
Public network service. Expose this service through the public NLB. Turn off to use the private NLB.
- Default:
true
Run in private subnets. Recommended. Requires a NAT gateway or equivalent for internet access and keeps tasks off public subnets.
- Default:
true
Build config
Build source.
- Default:
dockerfile - Allowed values:
dockerfile(Dockerfile),railpack(Railpack),image_registry(Pull from image registry)
Git repository.
- Shown when:
{"build_source":["dockerfile","railpack"]}
Source base path. Repository-relative source and build root.
- Default:
. - Shown when:
{"build_source":["dockerfile","railpack"]}
Image repository. Image repository without a tag or digest, such as
nginx, ghcr.io/org/app, or 123456789012.dkr.ecr.us-east-1.amazonaws.com/app.- Shown when:
{"build_source":"image_registry"}
Registry credentials secret ARN. Secrets Manager secret ARN for private registries such as GHCR or Docker Hub. The secret must use the ECS repository credentials JSON format. Not needed for public images or normal same-account ECR.
- Shown when:
{"build_source":"image_registry"}
Start command. Optional command arguments that override the image default command. For shell behavior, use
/bin/sh, -lc, and your command string as separate arguments.- Default:
[] - Shown when:
{"build_source":"image_registry"}
Docker
Dockerfile path. Path to the Dockerfile to use for the build, relative to the repository root or configured source base path.
- Shown when:
{"build_source":"dockerfile"}
Docker build context path. Directory to use as the Docker build context, relative to the repository root or configured source base path.
- Shown when:
{"build_source":"dockerfile"}
Railpack
Railpack version. Optional Railpack version to use for the build. Leave blank to use the Ravion default.
- Pattern:
^(|latest|v?[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?)$— Leave blank, use latest, a semantic version like 0.29.0, or a v-prefixed version like v0.29.0. - Shown when:
{"build_source":"railpack"}
Install command.
- Shown when:
{"build_source":"railpack"}
Build command.
- Shown when:
{"build_source":"railpack"}
Start command.
- Shown when:
{"build_source":"railpack"}
Deployment
Deployment strategy. Choose how traffic moves from the current deployment to the new deployment.
- Default:
rolling - Allowed values:
rolling(Rolling),blue_green(Blue/green),linear(Linear),canary(Canary)
Bake time in minutes. Minutes to keep the current and new deployments running after production traffic has fully shifted, before the old deployment is removed.
- Default:
10 - Min:
0 - Max:
1440 - Shown when:
{"deployment_strategy":["blue_green","linear","canary"]}
Linear step percentage. Percentage of production traffic to move to the new deployment at each linear step.
- Default:
20 - Min:
1 - Max:
100 - Shown when:
{"deployment_strategy":"linear"}
Linear step bake time in minutes. Minutes to wait between linear traffic steps before shifting the next percentage.
- Default:
5 - Min:
0 - Max:
1440 - Shown when:
{"deployment_strategy":"linear"}
Canary percent. Percentage of production traffic to send to the new deployment during the canary phase.
- Default:
5 - Min:
1 - Max:
100 - Shown when:
{"deployment_strategy":"canary"}
Canary bake time in minutes. Minutes to hold canary traffic before shifting the remaining production traffic to the new deployment.
- Default:
10 - Min:
0 - Max:
1440 - Shown when:
{"deployment_strategy":"canary"}
Manual approval gates. Optional gates that pause the deployment at chosen lifecycle stages until you approve it. Applies only to the blue/green, linear, and canary strategies.
- Default:
[{"stage":"POST_TEST_TRAFFIC_SHIFT","timeout_action":"ROLLBACK","timeout_in_minutes":1440}] - Shown when:
{"deployment_strategy":["blue_green","linear","canary"]}
Network listener
Container port. Port the container listens on.
- Default:
3000 - Min:
1 - Max:
65535 - Immutable after creation
Listener port. Port the NLB listens on.
- Default:
80 - Min:
1 - Max:
65535 - Immutable after creation
Listener protocol. Protocol for the NLB listener and target group.
- Default:
TCP - Allowed values:
TCP,TLS,UDP - Immutable after creation
TLS certificate. ACM certificate module for TLS listeners.
- Shown when:
{"listener_protocol":"TLS"}
TLS SSL policy. SSL policy for TLS listeners.
- Default:
ELBSecurityPolicy-TLS13-1-2-2021-06 - Shown when:
{"listener_protocol":"TLS"}
TLS ALPN policy. Optional ALPN policy for TLS listeners.
- Allowed values:
HTTP1Only(HTTP1 only),HTTP2Only(HTTP2 only),HTTP2Optional(HTTP2 optional),HTTP2Preferred(HTTP2 preferred),None - Shown when:
{"listener_protocol":"TLS"}
TLS target protocol. Protocol used between the NLB and the ECS task for TLS listeners. Use TCP for TLS termination at the NLB or TLS for encrypted traffic to the task.
- Default:
TCP - Allowed values:
TCP,TLS - Immutable after creation
- Shown when:
{"listener_protocol":"TLS"}
NLB ingress CIDRs. IPv4 CIDR blocks allowed to reach the NLB listener.
- Default:
["0.0.0.0/0"] - Shown when:
{"public_nlb_service_enabled":true}
Private NLB ingress CIDRs. IPv4 CIDR blocks allowed to reach the private NLB listener.
- Default:
["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"] - Shown when:
{"public_nlb_service_enabled":false}
Health check
Health check protocol. Protocol the target group uses for health checks.
- Default:
TCP - Allowed values:
TCP,HTTP,HTTPS
Health check path. HTTP path the load balancer calls to verify the service is healthy.
- Default:
/ - Shown when:
{"health_check_protocol":["HTTP","HTTPS"]}
Success codes. HTTP status code matcher for successful health checks.
- Default:
200-399 - Shown when:
{"health_check_protocol":["HTTP","HTTPS"]}
Interval (secs). Seconds between load balancer health checks.
- Default:
30 - Min:
5 - Max:
300
Timeout (secs). Seconds to wait for the health-check response before marking that check as failed.
- Default:
10 - Min:
2 - Max:
120
Healthy threshold. Number of consecutive successful checks required before an unhealthy target is considered healthy.
- Default:
3 - Min:
2 - Max:
10
Unhealthy threshold. Number of consecutive failed checks required before a target is considered unhealthy.
- Default:
3 - Min:
2 - Max:
10
Health check grace period (secs). Seconds ECS ignores failing load balancer health checks after a task starts.
- Default:
0 - Min:
0
Deregistration delay (secs). Seconds the target group waits for in-flight requests to drain before deregistering a target.
- Default:
300 - Min:
0 - Max:
3600
Source IP stickiness. Keep repeat traffic from the same source IP on the same task when possible.
- Default:
false
Container resources
Capacity provider. Choose the primary capacity provider. Most services should use only one provider.
- Default:
fargate - Allowed values:
fargate(Fargate),fargate_spot(Fargate spot),ec2(EC2)
Also use Fargate. Add Fargate to the capacity provider strategy in addition to the primary provider.
- Default:
false - Shown when:
{"capacity_provider":{"not":"fargate"}}
Also use Fargate spot. Add lower-cost interruptible Fargate spot capacity in addition to the primary provider.
- Default:
false - Shown when:
{"capacity_provider":{"not":"fargate_spot"}}
Also use EC2. Add EC2 capacity from the selected cluster in addition to the primary provider.
- Default:
false - Shown when:
{"capacity_provider":{"not":"ec2"}}
App size. CPU and memory for Fargate tasks. Prices are estimated from AWS Fargate pricing for the selected region, architecture, and capacity provider.
- Default:
{"memory_gb":4,"vcpu":2} - Shown when:
{"capacity_provider":["fargate","fargate_spot"]}
App ephemeral storage (GiB). Optional ephemeral storage size for each Fargate app task, from 21 to 200 GiB. Leave blank to use the AWS default of 20 GiB.
- Min:
21 - Max:
200 - Shown when:
{"capacity_provider":["fargate","fargate_spot"]}
App vCPU. vCPU reserved for each app task on EC2 capacity. Leave at least 0.25 vCPU unreserved on each EC2 instance for the ECS agent and system processes.
- Default:
1.5 - Pattern:
^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$— Enter a vCPU value, such as 0.5, 1, or 2. - Shown when:
{"capacity_provider":"ec2"}
App memory in GB. Memory reserved for each app task on EC2 capacity. Leave at least 0.5 GB unreserved on each EC2 instance for the ECS agent and system processes.
- Default:
3.5 - Pattern:
^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$— Enter a memory value in GB, such as 0.5, 1, or 4. - Shown when:
{"capacity_provider":"ec2"}
CPU architecture. Use x86_64 for broad compatibility; use ARM64 for lower cost when your image and dependencies support it.
- Default:
X86_64 - Allowed values:
X86_64(x86_64 - widest compatibility),ARM64(ARM64 - lower cost)
ECS exec. Enable ECS Exec for interactive debugging in running containers. Leave off by default for tighter access control; turn on when operators need shell/debug access through AWS Systems Manager.
- Default:
false
Autoscaling
Autoscaling.
- Default:
true
Minimum tasks. Recommend at least 2 for production.
- Default:
1 - Min:
0 - Shown when:
{"auto_scaling_enabled":true}
Maximum tasks.
- Default:
3 - Min:
1 - Shown when:
{"auto_scaling_enabled":true}
Desired tasks. Number of tasks to keep running when autoscaling is disabled.
- Default:
1 - Min:
1 - Shown when:
{"auto_scaling_enabled":false}
CPU target (%).
- Default:
70 - Min:
1 - Max:
100 - Shown when:
{"auto_scaling_enabled":true}
Memory target (%). Target average memory utilization for memory-based autoscaling. Leave blank to disable memory autoscaling.
- Default:
80 - Min:
1 - Max:
100 - Shown when:
{"auto_scaling_enabled":true}
Scale-in cooldown (secs). Time after a scale-in activity before another scale-in can happen. AWS defaults ECS target tracking cooldowns to 300 secs; start here for production and tune if needed.
- Default:
300 - Min:
0 - Shown when:
{"auto_scaling_enabled":true}
Scale-out cooldown (secs). Time after a scale-out activity before another scale-out can happen. AWS defaults ECS target tracking cooldowns to 300 secs; start here for production and tune if needed.
- Default:
300 - Min:
0 - Shown when:
{"auto_scaling_enabled":true}
Scale in. Allow autoscaling to reduce task count automatically.
- Default:
true - Shown when:
{"auto_scaling_enabled":true}
Scheduled scaling actions. Optional Application Auto Scaling scheduled actions for the ECS service desired count. Each action sets a recurring, one-time, or rate-based schedule and may update the minimum capacity, maximum capacity, or both.
- Default:
[] - Shown when:
{"auto_scaling_enabled":true}
Custom metric scaling policies. Additional target tracking scaling policies using custom CloudWatch metrics. Each policy must use a metric that changes proportionally with ECS service capacity.
- Default:
[] - Shown when:
{"auto_scaling_enabled":true}
Environment variables
Build environment variables. Environment variables available during builds. Values can be plain strings or references loaded from Parameter Store or Secrets Manager.
Inject environment variables in Dockerfile. Pass build environment variables into Dockerfile builds as build arguments.
- Default:
false - Shown when:
{"build_source":"dockerfile"}
Runtime environment variables. Runtime environment variables passed to the app container. PORT is added automatically from the container port setting.
Runtime secrets. Secrets injected into the ECS task at runtime as an array of {name, value_from} objects. value_from can be an SSM parameter or Secrets Manager ARN.
Pre and post deploy
Run pre-deploy command. Run a one-off ECS task before updating the ECS service.
- Default:
false
Pre-deploy command. Command arguments to run before updating the ECS service. For shell behavior, use
/bin/sh, -lc, and your command string as separate arguments.- Default:
[] - Shown when:
{"pre_deploy_enabled":true}
Pre-deploy environment variables. Additional environment variables for the pre-deploy task. Runtime environment variables and secrets are already inherited from the app container.
- Default:
[] - Shown when:
{"pre_deploy_enabled":true}
Pre-deploy CPU units. Optional CPU units for the pre-deploy task. Leave blank to use the app task CPU setting.
- Min:
1 - Shown when:
{"pre_deploy_enabled":true}
Pre-deploy memory (MiB). Optional memory in MiB for the pre-deploy task. Leave blank to use the app task memory setting.
- Min:
1 - Shown when:
{"pre_deploy_enabled":true}
Pre-deploy ephemeral storage (GiB). Optional ephemeral storage size for the pre-deploy task. Leave blank to use the task definition default.
- Min:
21 - Max:
200 - Shown when:
{"pre_deploy_enabled":true}
Pre-deploy timeout (secs). Maximum time to wait for the pre-deploy task to finish.
- Default:
1800 - Min:
1 - Shown when:
{"pre_deploy_enabled":true}
Run post-deploy command. Run a one-off ECS task after the ECS service deployment succeeds.
- Default:
false
Post-deploy command. Command arguments to run after the ECS service deployment succeeds. For shell behavior, use
/bin/sh, -lc, and your command string as separate arguments.- Default:
[] - Shown when:
{"post_deploy_enabled":true}
Post-deploy environment variables. Additional environment variables for the post-deploy task. Runtime environment variables and secrets are already inherited from the app container.
- Default:
[] - Shown when:
{"post_deploy_enabled":true}
Post-deploy CPU units. Optional CPU units for the post-deploy task. Leave blank to use the app task CPU setting.
- Min:
1 - Shown when:
{"post_deploy_enabled":true}
Post-deploy memory (MiB). Optional memory in MiB for the post-deploy task. Leave blank to use the app task memory setting.
- Min:
1 - Shown when:
{"post_deploy_enabled":true}
Post-deploy ephemeral storage (GiB). Optional ephemeral storage size for the post-deploy task. Leave blank to use the task definition default.
- Min:
21 - Max:
200 - Shown when:
{"post_deploy_enabled":true}
Post-deploy timeout (secs). Maximum time to wait for the post-deploy task to finish.
- Default:
1800 - Min:
1 - Shown when:
{"post_deploy_enabled":true}
Logging
FireLens log routing. Routes the app container logs through a Fluent Bit sidecar. CloudWatch output stays enabled by default so Ravion runtime logs continue to work.
- Default:
false
FireLens image. Container image for the Fluent Bit log router sidecar.
- Default:
public.ecr.aws/aws-observability/aws-for-fluent-bit:stable - Shown when:
{"firelens_enabled":true}
Additional Fluent Bit config. Optional Fluent Bit config appended after the generated [SERVICE] block. Add [OUTPUT] blocks here for destinations such as Datadog, Splunk, Firehose, OpenSearch, or S3.
- Shown when:
{"firelens_enabled":true}
Keep CloudWatch output enabled. Recommended. Sends FireLens-routed app logs to the service CloudWatch log group so Ravion runtime logs continue to work. Disable only if all app logs should go exclusively to external destinations.
- Default:
true - Shown when:
{"firelens_enabled":true}
Add ECS log metadata. Adds ECS cluster, task, and container metadata to FireLens log records.
- Default:
true - Shown when:
{"firelens_enabled":true}
FireLens environment variables. Environment variables passed to the log router sidecar. Use these for non-secret destination options.
- Default:
[] - Shown when:
{"firelens_enabled":true}
FireLens secrets. Secrets injected into the log router sidecar as an array of {name, value_from} objects. Use these for API keys or tokens stored in SSM Parameter Store or Secrets Manager.
- Default:
[] - Shown when:
{"firelens_enabled":true}
IAM roles and policies
Execution role ARN override. Optional existing ECS task execution role ARN. Leave blank to let the module create and manage the execution role used for pulling images and writing logs.
Task role ARN override. Optional existing ECS task role ARN for application AWS permissions. Leave blank to let the module create a task role and attach the policies configured below.
Task role policy ARNs. Additional managed IAM policy ARNs to attach to the generated task role. Only used when task role ARN override is blank.
- Default:
[]
Task role inline policies. Inline IAM policy documents keyed by policy name.
- Default:
{}
Execution role policy ARNs. Additional managed IAM policy ARNs to attach to the generated execution role. Only used when execution role ARN override is blank.
- Default:
[]
Networking and deployment
Minimum healthy percent. Minimum percentage of desired tasks that must stay healthy during rolling deployments. Keep 100 for zero-downtime deploys. Lower it only when the cluster does not have enough spare capacity to start replacement tasks first, since lowering it can reduce availability during deploys.
- Default:
100 - Min:
0 - Max:
200
Maximum percent. Maximum temporary task count during rolling deployments. Keep 200 for fast replacement capacity. Lower it when cluster capacity, IP availability, or burst cost should limit how many extra tasks ECS can start.
- Default:
200 - Min:
100 - Max:
400
Additional security groups. Additional security group IDs to attach to ECS tasks.
- Default:
[]
Allowed CIDR blocks. CIDR blocks allowed direct access to the service in addition to load balancer traffic.
- Default:
[]
Sidecars. Optional containers that run in the same ECS task as the app container. Use sidecars for agents, local proxies, lightweight workers, or helper processes that should share task networking and lifecycle with the app.
- Default:
[]
Persistent storage
EFS file system. Mount an EFS file system into the app container. The service attaches the file system’s client security group and adds the volume and mount point automatically.
- Default:
false
EFS file system.
- Shown when:
{"efs_enabled":true}
EFS mount path. Path inside the app container where the file system is mounted.
- Default:
/mnt/efs - Pattern:
^/— Use an absolute container path. - Shown when:
{"efs_enabled":true}
EFS read only. Mount the file system as read-only inside the app container.
- Default:
false - Shown when:
{"efs_enabled":true}
EFS IAM authorization. Use the task role to authorize file system access. The task role must allow
elasticfilesystem:ClientMount, plus elasticfilesystem:ClientWrite or elasticfilesystem:ClientRootAccess as needed.- Default:
false - Shown when:
{"efs_enabled":true}
Builder config
Builder instance type. Use EC2 for quick start or EC2 spot for cheaper, but potentially delayed builds.
- Default:
ec2 - Allowed values:
ec2(EC2),ec2-spot(EC2 spot) - Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Builder instance size. EC2 instance type for builds. Start with the default value, then increase or decrease it based on the resource usage report at the end of builds.
- Default:
c7a.4xlarge - Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Builder execution environment. Optional execution environment ID or given ID for builds. Defaults to the module Terraform execution environment.
- Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Builder AMI. Optional AMI ID for build runners. Leave empty to use the default runner image.
- Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Image registry lifecycle
Scan images on push. Ask ECR to run its basic vulnerability scan whenever a new image is pushed. Keep this on for early dependency and OS package findings; disable only if another scanner owns image scanning or duplicate findings are noisy.
- Default:
true - Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Force delete image repository. Allow the ECR repository to be deleted even when it contains images. Use with care.
- Default:
false - Shown when:
{"build_source":["dockerfile","railpack","nixpacks"]}
Misc
Force new deployment. Force ECS to start a new deployment when applying service configuration, even if the task definition did not change.
- Default:
true
Tags. A map of tags to assign to all resources. Default tags are
Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, ModuleIdTerraform settings
OpenTofu version override. Override the environment’s default version for this module
Ravion Terraform workspace name. Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
- Immutable after creation
Advanced Terraform variables. Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
- Default:
{}