Deploy the container using AWS Fargate

Deploy the container using AWS Fargate

Deploy the container using AWS Fargate

  1. First we will create Task definitions to run monolith
  • Go to ECS
  • Select Task definitions
  • Find the Task definition named Monolith-Definition-STACK_NAME

Deploy the container using AWS Fargate

  1. Go to ECR
  • Copy Image URI

Deploy the container using AWS Fargate

  1. Back to interface ECS
  • Select Monolith-Definition-STACK_NAME

Deploy the container using AWS Fargate

  1. In the interface Monolith-Definition-STACK_NAME revision 1. We will create a new revision.
  • Select Create new revision

Deploy the container using AWS Fargate

  1. Configure Container
  • Name, enter the service name of your choice (In the lab, enter monolith-service)
  • Paste the copied Image URI into Image URI

Deploy the container using AWS Fargate

  1. Select Create

Deploy the container using AWS Fargate

  1. Finish creating a new revision

Deploy the container using AWS Fargate

  1. In view Monolith-Definition-STACK_NAME revision 2
  • Select Deploy
  • Select Run task

Deploy the container using AWS Fargate

  1. In the Deploy interface
  • Environment, select Existing cluster, select Cluster-STACK_NAME
  • Select Launch type
  • In Launch type, select FARGATE
  • Platform version select LATEST

Deploy the container using AWS Fargate

  1. In the Deployment configuration section
  • Select Task
  • Desired choose 1

Deploy the container using AWS Fargate

  1. Configure Networking
  • VPC, select Mysfits-VPC-STACK_NAME
  • Subnets select Mysfits-PublicOne-STACK_NAME
  • Select Security Group, Select Use an existing security group
  • Security group name, choose default but configure inbound port 80
  • Auto-assign public IP - “ENABLED”
  • Select Deploy

Deploy the container using AWS Fargate

  1. Create task successfully

Deploy the container using AWS Fargate

  1. Select the task you just created and select Networking.
  • Purpose of using Public IP to use curl command to check by making GET request.
  • When using Fargate initialization, each task gets its own ENI and Public IP and Private IP.

Deploy the container using AWS Fargate

  1. Make a browser access
http://TASK_PUBLIC_IP_ADDRESS/mysfits

Deploy the container using AWS Fargate

  1. Execute the curl command on Cloud9
curl http://TASK_PUBLIC_IP_ADDRESS/mysfits

Deploy the container using AWS Fargate

  1. Select the task you just created and select Logs

Deploy the container using AWS Fargate

  1. Using AWS CloudWatch to View Log events
  • Select monolith log group (STACK_NAME-MythicalMonolithLogGroup-XXX)

Deploy the container using AWS Fargate

  1. After running the curl command successfully, we can delete the task
  • Select Task
  • Select Monolith-Definition-STACK_NAME revision 2.
  • Select Stop
  • Select Stop selected

Deploy the container using AWS Fargate

  1. Verify Stop and select Stop

Deploy the container using AWS Fargate

  1. Delete task successfully.

Deploy the container using AWS Fargate