Q76 — AWS SAA-C03 Ch.12
Question 76 of 100 | ← Chapter 12
Q876. A company is building a web application that serves a content management system. The content management system runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The EC2 instances run in an Auto Scaling group across multiple Availability Zones. Users are constantly adding and updating files, blogs, and other website assets in the content management system.A solutions architect must implement a solution in which all the EC2 instances share up-to-date website content with the least possible lag time.Which solution meets these requirements?
- A. Update the EC2 user data in the Auto Scaling group lifecycle policy to copy the website assets from the EC2 instance that was launched most recently. Configure the ALB to make changes to the website assets only in the newest EC2 instance.
- B. Copy the website assets to an Amazon Elastic File System (Amazon EFS) file system. Configure each EC2 instance to mount the EFS file system locally. Configure the website hosting application to reference the website assets that are stored in the EFS file system. ✓
- C. Copy the website assets to an Amazon S3 bucket. Ensure that each EC2 instance downloads the website assets from the S3 bucket to the attached Amazon Elastic Block Store (Amazon EBS) volume.Run the S3 sync command once each hour to keep files up to date.
- D. Restore an Amazon Elastic Block Store (Amazon EBS) snapshot with the website assets. Attach the EBS snapshot as a secondary EBS volume when a new EC2 instance is launched. Configure the website hosting application to reference the website assets that are stored in the secondary EBS volume.
Correct Answer: B. Copy the website assets to an Amazon Elastic File System (Amazon EFS) file system. Configure each EC2 instance to mount the EFS file system locally. Configure the website hosting application to reference the website assets that are stored in the EFS file system.
Explanation
To ensure all EC2 instances in an Auto Scaling group share up-to-date website content with minimal lag time in a content management system, the recommended solution is:B. Copy the website assets to an Amazon Elastic File System (Amazon EFS) file system. Configure each EC2 instance to mount the EFS file system locally. Configure the website hosting application to reference the website assets stored in the EFS file system.Here's why:Option A suggests updating the EC2 user data in the Auto Scaling group lifecycle policy to copy website assets from the most recently launched EC2 instance and configuring the ALB to make changes only in the newest instance. This approach relies on copying assets between EC2 instances and may introduce lag time, as changes made on one instance need to be propagated to the others. It does not provide an efficient and scalable solution for sharing up-to-date content across all instances.Option C suggests copying the website assets to an Amazon S3 bucket and having each EC2 instance download the assets to its attached Amazon EBS volume. While this approach can work, it requires manual synchronization of files and running the S3 sync command periodically. It may introduce delays in propagating updates to all instances, and the frequency of syncing (once per hour) may result in content lag.Option D suggests restoring an Amazon EBS snapshot with the website assets and attaching it as a secondary EBS volume to new EC2 instances. While this option provides a means to share website assets, it requires the creation of new EBS snapshots whenever content is updated. Managing snapshots and attaching them to instances can be complex and might not provide efficient content sharing across multiple instances.Option B recommends copying the website assets to an Amazon EFS file system. Amazon EFS provides a fully managed, scalable, and shared file system that can be mounted across multiple EC2 instances. Each EC2 instance can access and serve the website assets directly from the shared EFS file system, ensuring that all instances have access to up-to-date content. Changes made in one instance are immediately visible to others, eliminating the need for manual synchronization or snapshot management.In summary, the most suitable solution for ensuring up-to-date website content across all EC2 instances in an Auto Scaling group is to copy the assets to an Amazon EFS file system (Option B). This approach provides a scalable and shared file system that can be mounted on each instance, allowing them to access and serve the content with minimal lag time.