ECS Optimized Rocky Linux 8.5 – Getting Started

This guide will help you quickly get started with our AWS Marketplace offering – ECS Optimized Rocky Linux 8.5 Image.

Overview

ECS is a fully managed container orchestration service from AWS that makes it easy for you to deploy, manage, and scale containerized applications. Containers are defined using task definitions and run as services across a fleet of Amazon EC2 instances. ECS can automatically scale up your applications to meet a spike in demand or scale down when demand is less, leading to cost-effective operations in the cloud.

Underneath this robust AWS container orchestration solution is Docker, an industry-standard container runtime engine and the ECS agent responsible for scheduling services across your clusters.

This listing bundles this robust orchestration solution with Rocky Linux, a community favourite Linux Operating System, into a single 1-click deploy Optimized AMI.

Click below to deploy this image and start your journey to doing DevOps right.

What is inside this image?

  • Rocky Linux.
  • The latest Docker engine is installed.
  • Latest ECS-Agent installed.

Quick Start

To connect this AMI to your ECS cluster, add the snippet below to the user data of your EC2 Cluster instance during provisioning. Be sure to change the cluster name to match your cluster.

#!/bin/bash
echo ECS_CLUSTER=clusterName >> /etc/ecs/ecs.config

In the AWS EC2 instance setup console, your user data section would look like this: (Advanced details – section)

Advanced Method

  1. SSH into your ecs host and open file /etc/ecs/ecs.config using your favourite text editor. Add your ECS Cluster Name here – “ECS_CLUSTER=”
ECS_CLUSTER=clusterName

Your /etc/ecs/ecs.config would look like this;

ECS_DATADIR=/data
ECS_ENABLE_TASK_IAM_ROLE=true
ECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST=true
ECS_LOGFILE=/log/ecs-agent.log
ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","awslogs"]
ECS_LOGLEVEL=info
ECS_CLUSTER=clusterName
  1. Ensure your ECS host has the right IAM role to connect to the ECS service. For more on this, see this page from Amazon – https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html
  2. Restart ecs agent
systemctl restart ecs.service
  1. If you need to look at the logs, this file contains all ecs agent logs.
/var/log/ecs/ecs-agent.log
  1. Have fun!

Do you still need help?

Look, our Tech Support Staff live and breathe Cloud Engineering. Let them handle the details, so you can focus on the big picture.

Contact Support