I am currently working on setting up S3 Replication using the AWS CDK. I have referenced https://github.com/rogerchi/cdk-s3-bucketreplication/blob/main/src/index.ts as a starting point, and while it does create a replication rule, I am facing some issues customizing it to fit my specific requirements.
One particular issue arises when trying to include RTC (Replication Time Control):
sourceBucket.replicationConfiguration = {
role: replicationRole.roleArn,
rules: [
{
destination: {
storageClass: ReplicationDestinationStorageClass.STANDARD_IA,
bucket: destinationBucket.bucketArn,
metrics: {
status: "Enabled",
eventThreshold: {
minutes: 15,
},
},
replicationTime: {
status: "Enabled",
time: {
minutes: 15,
},
},
},
status: ReplicationRuleStatus.ENABLED,
},
],
};
This setup results in the error message:
ReplicationTime cannot be used for this version of the replication configuration schema.
Furthermore, I do not want to utilize a prefix, but rather define the scope of the rule as "This rule applies to all objects in the bucket." Unlike the default approach which seems to imply the use of a prefix. Upon examining the created rule, it appears to have "Limit the scope of this rule using one or more filters" selected by default.
https://i.sstatic.net/zdcfq.png
If you have any suggestions or advice regarding this matter, I would greatly appreciate it.