A SysOps Administrator is setting up Same-Region Replication (SRR) between two Amazon S3 buckets within the same AWS account using the AWS CLI. The administrator has successfully enabled bucket versioning on both the source and destination S3 buckets. Additionally, they created an IAM service role named S3ReplicationServiceRole with a trust policy allowing the s3.amazonaws.com service principal to assume the role. The role's permissions policy grants all necessary S3 permissions to access the source bucket and write replicas to the destination bucket.
When the administrator attempts to apply the replication configuration using the command:
aws s3api put-bucket-replication --bucket source-bucket --replication-configuration file://replication.json
the command fails with an AccessDenied error. The administrator is currently logged in with an IAM user account that has the AWS managed AmazonS3FullAccess policy attached, but no other IAM permissions. Which modification is required to resolve this error and successfully apply the replication configuration?
- ASuspend versioning on the destination bucket to prevent potential replication loops.
- Add the iam:PassRole permission for the S3ReplicationServiceRole to the administrator's IAM user policy.Cevap
- CUpdate the trust policy of S3ReplicationServiceRole to allow the administrator's IAM user to perform the sts:AssumeRole action.
- DModify the destination bucket policy to grant the administrator's IAM user the s3:ReplicateObject permission.