Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(efs): enableAutomaticBackups property of FileSystem is always treated as if it is true (#29881) #29914

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts
Expand Up @@ -586,7 +586,7 @@ export class FileSystem extends FileSystemBase {
performanceMode: props.performanceMode,
throughputMode: props.throughputMode,
provisionedThroughputInMibps: props.provisionedThroughputPerSecond?.toMebibytes(),
backupPolicy: props.enableAutomaticBackups ? { status: 'ENABLED' } : undefined,
backupPolicy: { status: props.enableAutomaticBackups ? 'ENABLED' : 'DISABLED' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause a breaking change where backupPolicy was undefined before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also have unit test and integ test for this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will cause a breaking change. The documentation says it's false by default, but it actually is always treated as true (see #29881).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Since this involves a breaking change, we need to handle via the feature flag. CDK Feature Flags are a mechanism that allows the CDK to evolve and change the behavior of certain classes and methods, without causing disruption to existing deployed infrastructure.

Below are the steps on adding a feature flag:

  1. Define the feature flag in features.ts
  2. Update the new feature flag in FEATURE_FLAGS.md
  3. Implement the feature flag. For reference here

fileSystemPolicy: Lazy.any({
produce: () => {
const denyAnonymousAccessFlag = FeatureFlags.of(this).isEnabled(cxapi.EFS_DENY_ANONYMOUS_ACCESS) ?? false;
Expand Down