Run Ant Media Server Enterprise Edition container on Amazon Elastic Container Service (ECS) in cluster mode
This document explains how to run an Ant Media Server Enterprise edition container on ECS in cluster mode.
Step 0. Register for Ant Media Server Container Product
Ensure you have registered & subscribed to the Ant Media Server Enterprise container image on the AWS Marketplace.
Step 1. Create AWS ECS Cluster
-
Open the AWS Management Console:
- Navigate to the Amazon Elastic Container Service (ECS).
-
Create the Cluster:
- Click Clusters → Create Cluster.
-
Configure Cluster Settings:
- Cluster name: test-cluster
-
Configure Infrastructure Settings:
- Infrastructure: Amazon EC2 instance.
- Provisioning model: On-demand.
- EC2 instance type: c5.xlarge (change to ensure compatibility with your workload).
- Desired capacity: As needed.
- SSH Key pair: Select your existing key pair or create a new one to access EC2 instances.
-
Network Settings:
- Choose a public VPC or use the default VPC.
- Auto-assign public IP: True
-
Create the Cluster:
- Review other default settings.
- Click Create.
Step 2: Create an Identity and Access Management (IAM) Role for Task Execution
-
Open the IAM Console:
- Go to Identity and Access Management (IAM) → Roles → Create Role.
-
Choose Trusted Entity Type:
- Trusted entity type: AWS service.
-
Choose Use Case:
-
Service or use case: Elastic Container Service Task → Next.
-
-
Attach Policies:
- Add the following managed policies:
- AmazonECSTaskExecutionRolePolicy (mandatory for ECS task execution).
- AWSMarketplaceMeteringRegisterUsage (required for Ant Media Server container licensing and metering).
-
Review and Create
-
Name the role ecsTaskExecutionRole-test-cluster.
-
Review the summary and click Create Role.
-
Step 3: Create an ECS Task Definition
-
Create the Task Definition:
- Open the ECS Service and click Task Definitions → Create New Task Definition with JSON.
-
Paste and Customize the JSON Configuration:
Replace
xxxxxxxx
in thetaskRoleArn
andexecutionRoleAr
n with the actual ARN of yourecsTaskExecutionRole
{
"family": "ams-task-definiton",
"containerDefinitions": [
{
"name": "ams",
"image": "709825985650.dkr.ecr.us-east-1.amazonaws.com/ant-media/ant-media-server-ee:2.11.3",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [],
"environmentFiles": [],
"mountPoints": [],
"volumesFrom": []
}
],
"taskRoleArn": "arn:aws:iam::xxxxxxxx:role/ecsTaskExecutionRole",
"executionRoleArn": "arn:aws:iam::xxxxxxxx:role/ecsTaskExecutionRole",
"networkMode": "host",
"requiresCompatibilities": [
"EC2"
],
"cpu": "4048",
"memory": "4096",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
}
}
-
Optional: Update the
image
tag for the latest Ant Media Server version and adjustcpu
andmemory
values if necessary.
Step 4: Run the AMS Task
-
Launch the Task:
-
Go to ECS Clusters →
test-cluster
. -
Click Tasks → Run New Task.
-
Under Compute configuration (advanced) Choose EC2 as the launch type.
-
Deployment configuration → Task → Task Definition → Choose ams-task-definition
-
Click Create.
-
-
Verify Task Status:
-
Ensure the task shows a RUNNING status under the Tasks tab.
-
Step 5: Test the Setup
-
Find the EC2 Instance IP:
-
Open the EC2 Dashboard → Instances.
-
Locate the instance running your container and note its public IP address.
-
-
Access Ant Media Server Dashboard:
-
Open a browser and visit:
http://<EC2-Instance-IP>:5080
-
Log in to the dashboard by creating your credentials.
-
Your Ant Media Server using AWS ECS is ready to use.
-