Which solution meets these requirements and is MOST cost-effective?
Create an S3 Lifecycle policy that copies the objects from one of the application S3 buckets to the centralized S3 bucket.
Use S3 Same-Region Replication to replicate logs from the S3 buckets to another S3 bucket in us-west-2. Use this S3 bucket for log analysis.
Write a script that uses the PutObject API operation every day to copy the entire contents of the buckets to another S3 bucket in us-west-2. Use this S3 bucket for log analysis.
Write AWS Lambda functions in these accounts that are triggered every time logs are delivered to the S3 buckets (s3:ObjectCreated:* event). Copy the logs to another S3 bucket in us-west-2. Use this S3 bucket for log analysis.
Explanations:
S3 Lifecycle policies are designed to transition or expire objects, not replicate them. They cannot be used to copy logs from multiple S3 buckets to a centralized one automatically.
S3 Same-Region Replication (SRR) allows automatic replication of objects within the same region, in this case, us-west-2. It meets the requirements of replicating logs across accounts with minimal operational overhead and keeps all data in the region.
Using the PutObject API to copy logs daily is inefficient and requires significant custom script management, leading to higher operational overhead and cost. This approach is not optimal for continuous log replication.
Using Lambda functions to copy logs based on events would incur additional management overhead and could increase costs with numerous invocations. While it ensures real-time log copying, the operational complexity and cost are higher compared to S3 Same-Region Replication.