The version of the replication configuration schema does not support the use of ReplicationTime

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.

Answer №1

For my setup in Terraform v1.3.2 using aws v4.22.0, I found success with the following syntax:

filter {
  and {
    tags = {}
  }
}

This configuration enables RTC, DeleteMarker, and additional features.

Answer №2

I faced a similar issue while using Terraform and had to include the following snippet:

        filter {
          tags = {}
        }

I stumbled upon a helpful suggestion on this topic: Is there a way to enable ReplicationConfiguration for AWS S3 Replication management using s3.putbucketreplication API?, which directed me to https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-add-config.html#replication-config-optional-filter. This resource, although not very clear, hinted that utilizing API V2 is necessary for replication functionality:

Replication configuration XML V2 includes the Filter element for rules.

If you wish to apply the rule to all objects in the bucket (as I did), there is also this option:

If you specify a rule with an empty filter tag your rule will apply to all objects in your bucket.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering an error message about 'resolving symbol values statically' while building an Angular 2 project

Currently, I am utilizing an older module called angular-2-local-storage. The initialization process is as follows: const LOCAL_STORAGE_SERVICE_CONFIG_TOKEN: string = 'LOCAL_STORAGE_SERVICE_CONFIG'; export const LOCAL_STORAGE_SERVICE_CONFIG = ne ...

What is the process for turning off a TypeScript rule for a single line of code?

Dealing with Summernote as a jQuery plugin has been a bit of a struggle for me. I'm trying to modify the object without needing type definitions, but TypeScript keeps throwing errors my way. Even after attempting to delete certain keys, I still get th ...

Is there a way to access a specific argument in yargs using typescript?

The idea behind using yargs is quite appealing. const argv = yargs.options({ env: { alias: 'e', choices: ['dev', 'prod'] as const, demandOption: true, description: 'app environment&apos ...

Conceal multiple parameters within routing for added security

I have setup my Angular component with a button that triggers an event. Inside this event, I currently have: this.router.navigate('page2') While I am aware that query parameters can be passed inside the URL, I am faced with the challenge of pas ...

Retrieve the property of a Typescript object using a template argument

I am looking to develop a Typescript Collection class that can locate items by field. Here is an example of what I have in mind: class Collection<T, K keyof T> { private _items: T[]; public isItemInCollection(item: T) { return _item ...

Tips for personalizing the Material UI autocomplete drop-down menu

I'm currently working with Material UI v5 beta1 and I've been attempting to customize the Autocomplete component. My goal is to change the Typography color on the options from black to white when an item is selected. However, I'm struggling ...

Angular strictPropertyInitialization - best practices for initializing class members?

When initializing a component, I need to retrieve user information. However, with the Angular strict mode in place, I'm uncertain about where to fetch this data. I have considered 3 options. But which one is the most appropriate? Is there another alt ...

Using forwardRef to pass a ref to a TS/React component

I am encountering an issue where I have a component with forwardRef and I need to use it inside another component with forwardRef: const DEFAULT_ELEMENT = "button"; export type PropsOf<TTag = any> = TTag extends React.ElementType ? Reac ...

The child module invokes a function within the parent module and retrieves a result

Guardian XML <tr [onSumWeights]="sumWeights" > Algorithm sumWeights(): number { return // Calculate total value of all weights } Offspring @Input() onTotalWeights: () => number; canMakeChanges() { return this.onTota ...

Creating a TypeScript object declaration

I am looking for some help with converting this JavaScript code to TypeScript. I am new to both languages, and when trying to access the 'this' object in my TypeScript version, I get an error message saying that 'this possibly be unknown&apo ...

Navigate through the router using query parameters in Angular 5

Encountering an issue with routing to a route containing query params. Here is the function in question: goToLink(link) { this.router.navigate([`${link.split('?')[0]}`, { queryParams: this.sortParams(link)}]); } Additionally, there is anoth ...

Update my SPFx web component to link to a CSS file instead of embedding the CSS styles directly within the component

I recently developed a web part that is reminiscent of a similar one found on GitHub @ https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-enhanced-list-formatting. This particular web part enables the embedding of custom CSS code directly in ...

Defining onClick event in Typescript and React.Konva

Struggling with resolving the tslint error Type declaration of 'any' loses type-safety., particularly when it comes to determining the correct type for the Event. Currently converting the Lynda tutorial "Building and Deploying a Full-Stack React ...

Obtaining a Bearer token in Angular 2 using a Web

I am currently working on asp.net web api and I am looking for a way to authenticate users using a bearer token. On my login page, I submit the user information and then call my communication service function: submitLogin():void{ this.user = this.l ...

What causes the createResource error to become undefined when it is refetched before being properly set?

How can I access and display the error property for a createResource? In this scenario, why is the error initially set to undefined before it is thrown? The logging shows that it first displays undefined for the error before eventually getting to line er ...

Angular Fails to Identify Chart.js Plugin as an Options Attribute

Encountering issues with using the 'dragData' plugin in Chart.js 2.9.3 within an Angular environment: https://github.com/chrispahm/chartjs-plugin-dragdata After importing the plugin: chartjs-plugin-dragdata, I added dragdata to the options as sh ...

What is the best way to transform a for loop using array.slice into a for-of loop or map function in order to generate columns and rows

Experiencing an issue with Angular8. Seeking help to convert a for loop for an array into a loop utilizing either for-of or array.map. The code in question involves passing an array of objects and the need to separate it into col and row arrays for visual ...

An error occurred in Nest JS, specifically in the node_modules/jest-diff/build/diffLines.d.ts file at line 8, character 13. The error message is "error TS1005:

Whenever I start and run the NestJS app in watch mode by using the npm run start:dev command, I encounter the following error: ERROR in node_modules/jest-diff/build/diffLines.d.ts(8,13): error TS1005: '=' expected. node_modules/jest-diff/build/d ...

What is the best way to access a class's private static property in order to utilize it for testing purposes?

Hello, I am currently a beginner in TypeScript and unit testing, so this inquiry may seem elementary to those more experienced. I am attempting to perform unit testing on the code provided below using sinon. Specifically, I am interested in testing whethe ...

Designing the File and Folder Organization for Next.js Frontend and AWS Cloud Development Kit (CDK) Backend

When it comes to creating websites with serverless backends, I've been thinking about the best practices for folder structure. Currently, my setup includes a Next.js frontend and an AWS CDK backend. The way I've structured the folders has the bac ...