Friday, 7 January 2022

AWS CloudWatch Logs Insights etc

AWS CloudWatch Logs Insights

Logs Insights Syntax

Sample

#need to select a log group first. Like is case sensitive. Two filter is and logic
fields @timestamp, @message
|filter @message like "pay"
|filter @message like "POST"
|sort @timestamp desc
|limit 20

To add time range, use UT and pick absolute and then write down range. Need to pick UTC

AWS S3

Can store some public files in S3 and copy back to a Docker image
  1. Upload the file into AWS S3
  2. Edit permission to make it public
  3. Copy the url for this object
  4. Use curl to copy file in Dockerfile
    RUN curl "https://my-assets.s3.us-west-2.amazonaws.com/good-assets/grpc.so" --output /usr/lib/php8/modules/grpc.so

Amazon Elastic Container Service (ECS)

ECS runs and manages docker-enabled applications in amazon EC2 instances.

Amazon EC2 container registry stores docker images.

To use ECS

  1. Create EC2 Cluster. These instances are linked in a virtual private cloud(VPC)
  2. Create task defintion to define a container. It is a configuration for running a docker image
  3. Deploy containers using task definition to run on the cluster
  4. Use Serive to manage tasks. Serice includes task defintion, desired count and task placement strategy
  5. Update Service with new task defintions to replace old tasks

Some my aws blog links

Dynamodb

Intrinsic functions

Amazon EC2

No comments:

Post a Comment