Create an AWS Task definition to run Liquibase commands

Last updated: July 14, 2025

There are multiple ways to operate Liquibase container within AWS. The example provided is specific to containers in ECS, and is one of several solutions. A task definition is a JSON text file that outlines how your containers operate in ECS. In the context of Liquibase, you write task definitions to run Liquibase commands on AWS. Follow the guide below to learn how to create Liquibase specific task definitions.

Before you begin

Required additional AWS Resources:

  • MySQL RDS Instance - If you are using MySQL DB

  • AWS Fargate ECS cluster

  • IAM role to access the CloudWatch Logs, create Task Definitions, etc.

Procedure

Create a task definition for Liquibase commands in AWS Fargate

1

Navigate to your Amazon Elastic Container Service console.

a-ecs
2

Select Task definitions from the left side navigation.

task-def
3

Click the Create a new task definition button

Use this example task definition below to build a new task by replacing the placeholder values of <PRO CONTAINER IMAGE LINK> and <S3 BUCKET NAME> with your values.

In this example, task definitions are arranged as individual Liquibase commands. You can create batch task definitions that contain multiple Liquibase commands by following AWS best practices.

Task definition example
loading
4

Ensure that the Launch type selected is AWS Fargate.

fargate-launch-type
5

Set both the Task role and execution role to ecsTaskExecutionRole. This role is created by default when we create a ECS Fargate cluster.

task-role
6

This is the container you may want to extend the Docker container to use SQL, mySQL, NoSQL, or any other type of extension.

Ensure that Container has this Image URI: 709825985650.dkr.ecr.us-east-1.amazonaws.com/liquibase/liquibase/liquibase-pro:<insert_image_tag>

7

Create an AWS Task Definition to Run Liquibase Commands

If you work with MySQL DB, add INSTALL_MYSQL with a value of true
8

Click the Create button at the bottom of the page to complete mounting the files in Fargate.

Create an AWS Task definition to run Liquibase commands - Liquibase