Update ECS Service

Update Task Definition

Go back to the ECS Console:

  • Select Task Definition.
  • Choose the task fcjresbar-task-fe.

9.3.1

Next, select the latest task version, and choose Create new revision.

9.3.2

Scroll down to the Task Role section:

  • Enter ECS
  • Select ECSTaskFullAccessToS3Role.

9.3.3 9.3.4

Continue scrolling down.

9.3.5

In the Log collection section, expand and select Export logs to S3 via AWS Firelens.

9.3.6

Next, configure the log driver:

  • In the bucket variable, enter firelens-logs or any other name you assigned to the S3 Bucket in the previous step.
  • Add the variable retry_limit and set it to 2.

9.3.7

When selecting different log options, a new container will be created below. Some details:

  • Image URI: amazon/aws-for-fluent-bit:stable
  • CPU: 1; Memory hard limit: 3; Memory soft limit: 2.

9.3.8

Leave the log driver configuration settings as default.

9.3.9

Finally, click Create to create the new revision.

9.3.10

Success!

9.3.11

Update ECS Service

Return to the frontend service to update to the latest version. Click Update service.

9.3.12

Select the latest revision.

9.3.13

Leave the rest unchanged, scroll down, and click Create to update the service.

9.3.14

After a short time, you should see that two new containers have been created—one for the frontend and one for the log router. Logs are now being sent to the log router.

9.3.15