Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

EFS: It forces me to replace the EFS which have files #20025

Closed
tom10271 opened this issue Apr 22, 2022 · 1 comment
Closed

EFS: It forces me to replace the EFS which have files #20025

tom10271 opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@tom10271
Copy link

Describe the bug

I have upgraded from CDK v1 to v2. I have fixed import paths in files only. My EFS has not specified encryted.

When I run cdk diff, this was returned:

[~] AWS::EFS::FileSystem My worker EFS MyworkerEFSC4FFD393 replace
 └─ [+] Encrypted (requires replacement)
     └─ true

When I explicitly set it to false, it still ask for a EFS replacement.

[~] AWS::EFS::FileSystem Odoo worker EFS OdooworkerEFSC4FFD393 replace
 └─ [+] Encrypted (requires replacement)
     └─ false

Expected Behavior

It should not replace my EFS if I set to false as it was not enabled at all.

Current Behavior

Either true or false for Encrypted it will still going to replace my EFS.

Reproduction Steps

Create EFS in v1

    new FileSystem(scope, 'My worker EFS', {
        vpc: NETWORKING.VPC,

        // Updating this property will replace the file system.
        performanceMode: PerformanceMode.GENERAL_PURPOSE,
        vpcSubnets: {
            subnets: [NETWORKING.PUBLIC_SUBNET_2B]
        },
        enableAutomaticBackups: true,
        removalPolicy: RemovalPolicy.RETAIN,
        lifecyclePolicy: LifecyclePolicy.AFTER_90_DAYS,
    });

Then run cdk diff

Possible Solution

You fix it :)

Additional Information/Context

No response

CDK CLI Version

2.20.0 (build 738ef49)

Framework Version

No response

Node.js Version

v14.19.1

OS

macOS 12.3.1 (21E258)

Language

Typescript

Language Version

~3.9.7

Other information

No response

@tom10271 tom10271 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 22, 2022
@github-actions github-actions bot added the @aws-cdk/aws-efs Related to Amazon Elastic File System label Apr 22, 2022
@peterwoodworth
Copy link
Contributor

Hey @tom10271, going to migrate this to a discussion.

Adding encryption was part of our graduating this module to stable. This was back a year ago, so before we released v2. What we did to prevent breaking existing users was to hide this behind a feature flag.

However, CDK v2 removed most feature flags. These are the only ones we still support in v2. I believe that your best path forward here is to remove the encryption property with an escape hatch

const cfnFs = fs.node.defaultChild as CfnFileSystem;
cfnFs.addPropertyDeletionOverride('Encrypted')

@aws aws locked and limited conversation to collaborators Apr 22, 2022
@peterwoodworth peterwoodworth converted this issue into discussion #20049 Apr 22, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants