Skip to main content
Version: 2.12

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.

container-image

Step 1. Create AWS ECS Cluster

  1. Open the AWS Management Console:

    • Navigate to the Amazon Elastic Container Service (ECS).
  2. Create the Cluster:

    • Click ClustersCreate Cluster. aws-ecs-home-page
  3. Configure Cluster Settings:

    • Cluster name: test-cluster
  4. 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.
  5. Network Settings:

    • Choose a public VPC or use the default VPC.
    • Auto-assign public IP: True

    image

  6. Create the Cluster:

    • Review other default settings.
    • Click Create.

    image

Step 2: Create an Identity and Access Management (IAM) Role for Task Execution

  1. Open the IAM Console:

    • Go to Identity and Access Management (IAM)RolesCreate Role.
  2. Choose Trusted Entity Type:

    • Trusted entity type: AWS service.
  3. Choose Use Case:

    • Service or use case: Elastic Container Service Task → Next.

      image

  4. Attach Policies:

    • Add the following managed policies:
    • AmazonECSTaskExecutionRolePolicy (mandatory for ECS task execution).
    • AWSMarketplaceMeteringRegisterUsage (required for Ant Media Server container licensing and metering).
  5. Review and Create

    • Name the role ecsTaskExecutionRole-test-cluster.

    • Review the summary and click Create Role.

      image

Step 3: Create an ECS Task Definition

  1. Create the Task Definition:

    • Open the ECS Service and click Task DefinitionsCreate New Task Definition with JSON.
  2. Paste and Customize the JSON Configuration:

    Replace xxxxxxxx in the taskRoleArn and executionRoleArn with the actual ARN of your ecsTaskExecutionRole


{
"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 adjust cpu and memory values if necessary.

    task-definition

Step 4: Run the AMS Task

  1. Launch the Task:

    • Go to ECS Clusterstest-cluster.

    • Click TasksRun New Task.

    • Under Compute configuration (advanced) Choose EC2 as the launch type.

    • Deployment configuration → Task → Task Definition → Choose ams-task-definition

      image

    • Click Create.

  2. Verify Task Status:

    • Ensure the task shows a RUNNING status under the Tasks tab.

      tasks

Step 5: Test the Setup

  1. Find the EC2 Instance IP:

    • Open the EC2 DashboardInstances.

    • Locate the instance running your container and note its public IP address.

      image

  2. Access Ant Media Server Dashboard:

    • Open a browser and visit: http://<EC2-Instance-IP>:5080

    • Log in to the dashboard by creating your credentials.

      image

    • Your Ant Media Server using AWS ECS is ready to use.

      image