CloudFormation ECS Fargate Basic Template
This article details how to install the Matillion CDC Agent on Amazon ECS Fargate using a CloudFormation template.
These steps can only be taken after completing the preliminary steps found in AWS Installation: Templated Installations and assumes you have done so.
It is highly recommended you read the documentation and prerequisites before beginning this process. It is likely you will require input from your organisation's cloud administrator for access and permissions.
The template provides a blueprint for installation that you may use verbatim, but you may need to modify it to suit your own needs and rules governing your cloud infrastructure.
This template will create the following resources in your AWS account:
- ECS Task Definition
- ECS Fargate Cluster and Service
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 ARN.
- Subnet and security group within a customer private cloud with outbound access.
- CloudWatch log group for container log ingestion.
- S3 bucket for data ingestion.
- Secrets Manager entries for your Platform Key and database passwords.
- 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)
You are also expected to have access to certain details and permissions:
- Access to a 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.
Create Agent Stack
You should have your Platform Key and Agent Identity Environment Variables ready before beginning this process. If you do not have these, please first consult the Creating Agents documentation.
You will require permissions to create and manage resources in your AWS or Azure account. Please contact your administrator. Matillion's provided templates will not work if you have insufficient permissions.
Using the CloudFormation Template
- Download the ECS Fargate (CloudFormation) Basic template files in the Downloads section at the bottom of this article.
- Log in to your AWS account and navigate to the CloudFormation service.
- Choose Create Stack.
- Select Template is ready.
- Select Upload a template file and then Choose File.
- Upload your template
.jsonand click Next to move to the next screen.
Specify stack details
Complete the form with the required details:
|Stack name||An arbitrary name for your new stack.|
|AgentID||The ID_AGENT attained during agent creation.|
|ClusterName||Name the ECS Fargate cluster that will be created from the template. This is where your agent is hosted.|
|ExecutionRoleArn||The ARN of the IAM Role that Task Execution will use. See the Task Execution Role in IAM Roles for more information.|
|ImageURL||The agent image location. Do not edit this field.|
|LogGroupPath||Name of an existing CloudWatch log group to be used for agent logging.|
|OrganizationID||ID_ORGANIZATION attained during agent creation.|
|PlatformKeyName||The name of the secret generated to hold your Platform Key. If you are following our recommended install, this will be agent-rsa. Note that your Task Role policy must include the ARN for this secret.|
|Region||The name of the region you want to create these resources in.|
|RoleArn||The ARN of the IAM Role the Task will use. See the Task Role in IAM Roles for more information.|
|SecurityGroups||Select the Security Group that your service will create log streams in.|
|ServiceName||A unique name for the new ECS Service you want to run tasks under.|
|SubnetIDs||The subnet ID for your intended subnet.|
|TaskDefinitionName||A unique name for agent tasks to run under.|
- When your details are entered, click Next.
- Configure Stack Options: No action is required on this page. Click Next.
- Review: Select Acknowledge the template has changed and click Create.
When your stack has been fully created (will take some time) you can return to Matillion CDC and view the Agents list. Your new agent should appear on the list and have the "Connected" status if all has gone well. If not, please consult the Troubleshooting documentation.
If you are creating a Pipeline and have completed this step, consult the CDC Pipelines documentation to review the process and find your next steps.
This article covers the Basic Template installation. The template itself can be downloaded here:
And an accompanying parameters file for those installing via CLI: