How can the developer update the application to meet these requirements with MINIMUM changes?
Rewrite the application to be cloud native and to run on AWS Lambda, where the logs can be reviewed in Amazon CloudWatch.
Set up centralized logging by using Amazon OpenSearch Service (Amazon Elasticsearch Service), Logstash, and OpenSearch Dashboards (Kibana).
Scale down the application to one larger EC2 instance where only one instance is recording logs.
Install the unified Amazon CloudWatch agent on the EC2 instances. Configure the agent to push the application logs to CloudWatch.
Explanations:
Rewriting the application to be cloud native and run on AWS Lambda is a complex solution that requires substantial changes to the application, infrastructure, and deployment process, which goes beyond the requirement for minimal changes.
While Amazon OpenSearch Service can centralize logging, this solution requires setting up and managing multiple components (OpenSearch, Logstash, and OpenSearch Dashboards), which introduces additional complexity and cost, deviating from the requirement for minimal changes.
Scaling down to a single, larger EC2 instance would compromise high availability, which is critical for ecommerce websites, and does not meet the requirement for minimal changes.
Installing the unified Amazon CloudWatch agent is a straightforward and minimally invasive solution that allows logs from all EC2 instances to be aggregated in CloudWatch, enabling easy access without needing to log into each server individually.