Skip to content

S3-Replication: L2 for Cross account replication not working #35825

@jesperalmstrom

Description

@jesperalmstrom

Describe the bug

Hi,
In the L2 construct documentation https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_s3/ReplicationRule.html it is mentioned Cross Account support. but we have tried many different configurations without success. The only workaround is to fall back to the L1 CFN way.

        replication_config = s3.CfnBucket.ReplicationConfigurationProperty(
            role=replication_role_arn,
            rules=[
                s3.CfnBucket.ReplicationRuleProperty(
                    id=REPLICATION_RULE_ID,
                    status="Enabled",
                    prefix=REPLICATION_RULE_PREFIX,
                    priority=REPLICATION_RULE_PRIORITY,
                    destination=s3.CfnBucket.ReplicationDestinationProperty(
                        bucket=f"arn:aws:s3:::{destination_bucket}",
                        account=account,
                        access_control_translation=s3.CfnBucket.AccessControlTranslationProperty(
                            owner="Destination"
                        ),
                    ),
                )
            ],
        )

        # Apply replication configuration to the bucket
        cfn_bucket = self.bucket.node.default_child
        cfn_bucket.replication_configuration = replication_config

Could this be clarified or fixed?

I suspect that the problem is related to this destination bucket owner setting:

Image

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Library Version

Expected Behavior

An example that work for Cross Replication or a fix

Current Behavior

Does not work

Reproduction Steps

Try to setup cross account s3 replication using only L2 constructs

Possible Solution

No response

Additional Information/Context

No response

AWS CDK Library version (aws-cdk-lib)

2.202.0

AWS CDK CLI version

2.1030.0 (build e46adaf)

Node.js Version

v24.10.0

OS

Ubuntu 24.04

Language

Python

Language Version

Python 3.13

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-s3Related to Amazon S3bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions