Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

ecspresso

> DevOps
Open source

ecspresso is a deployment tool for Amazon ECS

1.1K stars0 likes1 views
WebsiteGitHub

About

ecspresso is a deployment tool for Amazon ECS

ecspresso

ecspresso is a deployment tool for Amazon ECS.

(pronounced the same as "espresso" :coffee:)

ecspresso allows you to manage ECS services and task definitions as code in JSON, YAML, or Jsonnet files, enabling version control and infrastructure as code practices. You can generate configuration files from existing ECS services using ecspresso init, making it easy to start managing your infrastructure.

Definition files support template syntax and Jsonnet native functions to embed environment variables, Terraform state values, SSM parameters, and Secrets Manager ARNs. ecspresso supports multiple deployment strategies including rolling updates and Blue/Green deployments with both ECS native and CodeDeploy controllers. Before deploying, you can preview changes with diff and validate configurations with verify. If something goes wrong, rollback helps you safely revert to a previous state.

ecspresso also supports ECS Express mode for simplified deployments and provides a plugin system for extending functionality.

Table of Contents

  • Documents
  • Install
  • Usage
  • Quick Start
  • Configuration file
  • Template syntax
  • Deployment
    • Rolling deployment
    • Waiting for the deployment
    • Early success criteria
    • Blue/Green deployment (ECS)
    • Blue/Green deployment (CodeDeploy)
  • Scale out/in
  • Rollback
  • Run task
  • Notes
    • Version constraint
    • Manage Application Auto Scaling
    • Jsonnet support
    • Deploy to Fargate
    • Fargate Spot support
    • ECS Service Connect support
    • EBS Volume support
    • S3 Files volume support
    • VPC Lattice support
    • High resolution CloudWatch metrics
    • ECS Express mode support
    • Diff and Verify
    • Manipulate ECS tasks
    • Show documentation
    • LLM agent integration
  • Plugins
    • tfstate
    • CloudFormation
    • SSM Parameter Store
    • Secrets Manager
    • External commands
  • LICENSE

Documents

  • Differences between v1 and v2.
  • ecspresso Advent Calendar 2020 (Japanese)
  • ecspresso handbook (Japanese)
  • Command Reference (Japanese)

Install

Homebrew (macOS and Linux)

bash
$ brew install kayac/tap/ecspresso

asdf (macOS and Linux)

bash
$ asdf plugin add ecspresso
# or
$ asdf plugin add ecspresso https://github.com/kayac/asdf-ecspresso.git

$ asdf install ecspresso 2.3.0
$ asdf set -u ecspresso 2.3.0

aqua (macOS and Linux)

aqua is a CLI version manager.

bash
$ aqua g -i kayac/ecspresso

Binary packages

Releases

Docker image

Docker images are available on GitHub Container Registry.

bash
$ docker pull ghcr.io/kayac/ecspresso:v2.7.0

The image is based on gcr.io/distroless/static-debian12 and supports both linux/amd64 and linux/arm64 architectures.

bash
$ docker run --rm \
    -v ~/.aws:/root/.aws:ro \
    -v $(pwd):/work \
    -w /work \
    ghcr.io/kayac/ecspresso:v2.7.0 deploy --config ecspresso.yml

CircleCI Orbs

https://circleci.com/orbs/registry/orb/fujiwara/ecspresso

yaml
version: 2.1
orbs:
  ecspresso: fujiwara/[email protected]
jobs:
  install:
    steps:
      - checkout
      - ecspresso/install:
          version: v2.3.0 # or latest
          # version-file: .ecspresso-version
          os: linux # or windows or darwin
          arch: amd64 # or arm64
      - run:
          command: |
            ecspresso version

version: latest installs different versions of ecspresso for each Orb version.

  • fujiwara/[email protected]
    • The latest release version (v2 and later)
  • fujiwara/[email protected]
    • The latest version of v1.x
  • fujiwara/[email protected]
    • The latest version of v2.x

Note: version: latest is not recommended as it may cause unexpected behavior when a new version of ecspresso is released.

Orb fujiwara/[email protected] supports version-file: path/to/file, which installs the ecspresso version specified in the file. This version number does not have a v prefix, For example, 2.0.0.

GitHub Actions

Action kayac/ecspresso@v2 installs an ecspresso binary for Linux(x86_64) into /usr/local/bin. This action installs ecspresso. When args input is provided, it runs ecspresso with the specified arguments after installation.

yaml
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: kayac/ecspresso@v2
        with:
          version: v2.3.0 # or latest
          # version-file: .ecspresso-version
      - run: |
          ecspresso deploy --config ecspresso.yml

To use the latest version of ecspresso, pass the parameter "latest".

yaml
      - uses: kayac/ecspresso@v2
        with:
          version: latest

version: latest installs different versions of ecspresso for each Action version.

  • kayac/ecspresso@v1
    • The latest version of v1.x
  • kayac/ecspresso@v2
    • The latest version of v2.x

Note: version: latest is not recommended as it may cause unexpected behavior when a new version of ecspresso is released.

Action kayac/ecspresso@v2 supports version-file: path/to/file, which installs the ecspresso version specified in the file. This version number does not have a v prefix, For example 2.3.0.

Run ecspresso after installation

When the args input is provided, the action runs ecspresso with the specified arguments after installation.

yaml
      - uses: kayac/ecspresso@v2
        with:
          version: latest
          args: deploy
        env:
          ECSPRESSO_CONFIG: ecspresso.yml

Usage

…

For more options for sub-commands, See ecspresso sub-command --help.

Log format

--log-format option controls the log output format. The default is text.

text format outputs human-readable logs. Attributes from slog.With (e.g. service/cluster) appear before the message, and per-call attributes appear after the message in [key:value] format.

2024-01-01T00:00:00.000+09:00 [INFO] [myService/default] deployment created on CodeDeploy [deployment_id:d-XXXXXXXXX] [url:https://...]

json format outputs structured JSON logs suitable for machine parsing. All attributes are output as individual JSON fields.

json
{"time":"2024-01-01T00:00:00.000+09:00","level":"INFO","msg":"deployment created on CodeDeploy","cluster":"default","service":"myService","deployment_id":"d-XXXXXXXXX","url":"https://..."}

Quick Start

ecspresso allows you to easily manage your existing/running ECS services by code.

Try ecspresso init for your ECS service with option --region, --cluster and --service.

bash
$ ecspresso init --region ap-northeast-1 --cluster default --service myservice --config ecspresso.yml
2024-01-01T00:00:00.000+09:00 [INFO] [myservice/default] saving service definition [path:ecs-service-def.json]
2024-01-01T00:00:00.000+09:00 [INFO] [myservice/default] saving task definition [path:ecs-task-def.json]
2024-01-01T00:00:00.000+09:00 [INFO] [myservice/default] saving config [path:ecspresso.yml]

Review the generated files: ecspresso.yml, ecs-service-def.json, and ecs-task-def.json.

Now you can deploy the service using ecspresso!

bash
$ ecspresso deploy --config ecspresso.yml

Next step

ecspresso can read service and task definition files as a template. A typical use case is to replace the image's tag in the task definition file.

Modify ecs-task-def.json as below.

diff
-  "image": "nginx:latest",
+  "image": "nginx:{{ must_env `IMAGE_TAG` }}",

Then, deploy the service with environment variable IMAGE_TAG.

bash
$ IMAGE_TAG=stable ecspresso deploy --config ecspresso.yml

For more information, refer to the Configuration file and Template syntax sections.

Configuration file

A configuration file for ecspresso (YAML, JSON, or Jsonnet format).

yaml
region: ap-northeast-1 # or AWS_REGION environment variable
cluster: default
service: myservice
task_definition: taskdef.json
timeout: 5m # default 10m
ignore:
  tags:
    - ecspresso:ignore # ignore tags of service and task definition

ecspresso deploy works as below.

  • Register a new task definition from task-definition file (JSON or Jsonnet).
    • Replace {{ env `FOO` `bar` }} syntax in the JSON file with environment variable "FOO".
      • If "FOO" is not defined, replaced by "bar"
    • Replace {{ must_env `FOO` }} syntax in the JSON file wth environment variable "FOO".
      • If "FOO" is not defined, abort immediately.
  • Update service tasks by the service_definition file (JSON or Jsonnet).
  • Wait for the service to be stable.

Configuration files and task/service definition files are read by go-config which provides template functions env, must_env and json_escape.

Template syntax

ecspresso uses the text/template standard package in Go to render template files, and parses them as YAML or JSON.

When using Jsonnet, ecspresso first renders the Jsonnet files and then parses them as text/template. As a result, template functions can only render string values using "{{ ... }}", since the template function syntax {{ }} conflicts with Jsonnet syntax. To render non-string values, consider using Jsonnet functions instead.

By default, ecspresso provides the following as template functions.

env

go-template
"{{ env `NAME` `default value` }}"

This replaces the placeholder with the value of the environment variable NAME. If not set, it defaults to "default value".

must_env

go-template
"{{ must_env `NAME` }}"

This replaces the placeholder with the value of environment variable NAME. If not set, ecspresso will panic and stop forcefully.

Defining critical values with must_env helps prevent unintended deployments by ensuring these values are set before execution.

json_escape

go-template
"{{ must_env `JSON_VALUE` | json_escape }}"

This escapes values as JSON strings, which is useful for embedding values as strings that require escaping, such as quotes.

Plugin provided template functions

ecspresso also adds some template functions via plugins. See the Plugins section.

Example of deployment

Rolling deployment

ecspresso deploy performs rolling deployment by default.

…

deploy commands has many options to customize the deployment behavior. See ecspresso deploy --help for more details.

…

Waiting for the deployment

ecspresso deploy waits until the deployment completes by default. Use --no-wait to return immediately after starting the deployment, or --wait-until to choose what to wait for.

For the ECS deployment controller (also used when `deploymentC

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goawsdeploymentdockerecs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理