This directory contains sample logging and monitoring resources for Amazon ECS.
-
AWS IAM Role for ECS Container Instances - This CloudFormation template deploys an IAM role that includes AWS managed policies for ECS, CloudWatch, and AWS Systems Manager. This enables you to capture logs and custom Amazon EC2 metrics on your ECS container instances as well as manage the underlying EC2 instances with AWS Systems Manager. It also enables you to connect to the container instances with AWS Systems Manager Session Manager.
-
ECS Cluster CloudFormation Template with the SSM agent and CloudWatch agent installed - Linux - This CloudFormation template is similar to the template deployed through the AWS ECS service console when you create a new ECS cluster. It is modified to automatically install / update the AWS Systems Manager agent and Amazon CloudWatch agent. It enables you to further customize operational components that you may want to install and configure as a standard for your ECS clusters.
-
Deploying the CloudWatch Agent to Collect EC2 Instance-Level Metrics on Amazon ECS - This CloudFormation template aligns to the manual deployment and setup of the Amazon CloudWatch agent for Amazon ECS Container Instances. The template deploys a service to the Amazon ECS cluster specified for the Amazon CloudWatch agent and configures it to collect and report metrics to Amazon CloudWatch. The customized template reads its CloudWatch configuration from an SSM parameter named ecs-cwagent-daemon-service in the account and region. You can use the sample CloudWatch agent configuration files to create the CloudWatch agent configuration and store them in the ecs-cwagent-daemon-service parameter. Refer to the AWS documentation for more details.
-
Firelens Example ECS Task Definition - This json file provides an ECS task definition that can be used to demo FireLens with an nginx container. You must update the executionRoleArn and taskRoleArn to a valid value within your account before use.
-
Amazon ECS Container example using EMF with CloudWatch to transmit custom metrics - This directory contains a working example for a python application that transmits metrics to the Amazon CloudWatch service in EMF format using the CloudWatch agent. It includes a Dockerfile to create the container image and a task definition file to deploy it to ECS. You must update the task definition for your environment. Update the image parameter to the ECR repository where you deploy the image. Update the executionRoleArn and taskRoleArn to your account values.
-
Amazon ECS Container example using EMF with Firelens to transmit custom metrics - This directory contains a working example for a python application that transmits metrics to the Amazon CloudWatch service in EMF format using the Firelens agent. It includes a Dockerfile to create the container image and a task definition file to deploy it to ECS. You must update the task definition for your environment. Update the image parameter to the ECR repository where you deploy the image. Update the executionRoleArn and taskRoleArn to your account values.