I am trying to get S3 Replication working via AWS CDK. I am using https://github.com/rogerchi/cdk-s3-bucketreplication/blob/main/src/index.ts as a starting point and it does create a replication rule. However there are some issues when trying to make it specific the case i want to setup.
When adding 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,
},
],
};
I get the following error....
ReplicationTime cannot be used for this version of the replication configuration schema.
Also, i do not wish to use a prefix but want the rule scope to be "This rule applies to all objects in the bucket". As per the console setting below. The above approach appears to create a configuration that 'should' have a prefix. i.e. Looking at the created rule it appears to have "Limit the scope of this rule using one or more filters" selected by default.
Any advice would be appreciated.
