Terraform ECS Fargate Advanced Template
  • Dark

Terraform ECS Fargate Advanced Template

  • Dark


It is expected that users who choose to use Terraform over the equivalent CloudFormation template will have working knowledge of Infrastructure as Code using Terraform in AWS. Users should familiarise themselves with the official documentation before continuing:

Terraform template files can be found in the Downloads section of this article.

Created Resources

This template will create the following resources in your AWS account:

  • ECS Task Definition
  • ECS Fargate Cluster
  • S3 Bucket
  • CloudWatch Log Group
  • IAM Roles with permissions for the following:
    • Task Roles to your S3 bucket, ECS, EC2 and Secrets Manager (see "Task IAM Role" section)
    • Task Execution Roles to pull from ECR Public repositories (see "Task Execution IAM Role" section)


Edit the template

Users should inspect the template in a text editor and ensure the values are as-expected before proceeding. In particular, the PLATFORM_WEBSOCKET_ENDPOINT environment variable should be edited to match the expected endpoint and region. See Environment Variables for more information.


The basic template assumes you have certain resources already set up in your AWS stack. You will also be required to provide details on these resources such as names, paths and ARNs.

  • Subnet(s) within a VPC with outbound access to the relevant data sources and destinations, as well as to ECR and to the Matillion CDC Websocket endpoint.
  • Security group controlling ingress/egress within the subnet(s).
  • Secrets Manager entries for your Platform Key and database passwords.

User Access

You as a user are also expected to have access to certain details and permissions:

  • Access to a valid Terraform installation
  • Access to the Matillion Hub account and Matillion Data Loader.
  • CDC Agent Environment Variables (generated in Matillion Data Loader when creating a new agent)
  • Matillion Data Loader platform key (generated once per Matillion Data Loader account the first time you make an agent)
  • Access to AWS with the ability to create a stack on a billable account. You may require an administrator from your organisation to either give access or perform this process with you.