An administrator is establishing Same-Region Replication (SRR) for an Amazon S3 bucket within a single AWS account. Both the source and destination buckets have versioning active. The administrator has created a replication IAM role with a trust policy for `s3.amazonaws.com` and a permissions policy that allows `s3:ReplicateObject` on the destination. However, when the administrator executes `aws s3api put-bucket-replication` from their local machine, they receive an 'AccessDenied' error.
Which of the following is the most likely cause of this failure?
- AThe replication IAM role trust policy must specify the administrator's IAM user in the Principal element and grant the `sts:AssumeRole` permission.
- The IAM user executing the CLI command does not have the `iam:PassRole` permission to pass the replication role to the Amazon S3 service.Answer
- CThe destination bucket has versioning enabled, but S3 replication requires versioning to be enabled only on the source bucket and suspended on the destination bucket.
- DThe KMS key policy for the destination bucket's encryption key does not permit the administrator's IAM user to access it, overriding the IAM policy.
Answer
The IAM user executing the CLI command does not have the `iam:PassRole` permission to pass the replication role to the Amazon S3 service.
The correct answer is correct because setting up S3 replication requires the user to pass an IAM service role to Amazon S3. AWS enforces security by requiring that the identity configuring replication must have the `iam:PassRole` permission for the specific IAM role. Without this permission, the AWS CLI command will return an Access Denied error.
Step-by-Step Solution
Key Concept
IAM PassRole permission requirement for service role delegation
Estimated Time:1m 30s