What is the MOST cost-effective solution to meet these requirements?
Create an ECS cluster using On-Demand Instances. Provision the database and its read replicas in Amazon RDS using Spot Instances. Store the documents in an encrypted EBS volume, and create a cron job to delete the documents after 7 years.
Create an ECS cluster using a fleet of Spot Instances, with Spot Instance draining enabled. Provision the database and its read replicas in Amazon RDS using Reserved Instances. Store the documents in a secured Amazon S3 bucket with a lifecycle policy to move the documents that are older than 3 months to Amazon S3 Glacier, then delete the documents from Amazon S3 Glacier that are more than 7 years old.
Create an ECS cluster using On-Demand Instances. Provision the database and its read replicas in Amazon RDS using On-Demand Instances. Store the documents in Amazon EFS. Create a cron job to move the documents that are older than 3 months to Amazon S3 Glacier. Create an AWS Lambda function to delete the documents in S3 Glacier that are older than 7 years.
Create an ECS cluster using a fleet of Spot Instances with Spot Instance draining enabled. Provision the database and its read replicas in Amazon RDS using On-Demand Instances. Store the documents in a secured Amazon S3 bucket with a lifecycle policy to move the documents that are older than 3 months to Amazon S3 Glacier, then delete the documents in Amazon S3 Glacier after 7 years.
Explanations:
Using On-Demand Instances for the ECS cluster is cost-inefficient. Spot Instances should be considered for cost savings. Storing documents on EBS is also not ideal due to high storage costs and complexity in managing lifecycle. RDS with Spot Instances is not ideal due to potential interruptions.
Using Spot Instances for the ECS cluster and Reserved Instances for RDS offers cost efficiency. Storing documents in S3 with lifecycle policies is optimal for infrequent access, and Glacier is a cost-effective choice for long-term storage. Lifecycle policies handle document retention.
EFS is more expensive than S3 for document storage and is not a good fit for infrequently accessed documents. Moving documents to S3 Glacier via a cron job adds unnecessary complexity, and Lambda functions for deletions are not cost-effective.
Spot Instances for ECS and RDS On-Demand Instances create an imbalance between cost savings and stability. RDS should be reserved or use Aurora for better cost efficiency. The use of S3 with Glacier and lifecycle policies is correct, but the overall approach is less cost-effective compared to Option B.