S3 buckets can be versioned. When the S3 bucket is unversioned it means that a new version of an object overwrites an existing one in the S3 bucket.
It can lead to unintentional or intentional information loss.
There is a risk if you answered yes to any of those questions.
It’s recommended to enable S3 versioning and thus to have the possibility to retrieve and restore different versions of an object.
const s3 = require('aws-cdk-lib/aws-s3');
new s3.Bucket(this, 'id', {
bucketName: 'bucket',
versioned: false // Sensitive
});
The default value of versioned is false so the absence of this parameter is also sensitive.
const s3 = require('aws-cdk-lib/aws-s3');
new s3.Bucket(this, 'id', {
bucketName: 'bucket',
versioned: true
});