EFS error 'One or more LifecyclePolicy objects specified are malformed.' with CDK v2

0

I followed that example building an EFS share using CDK v2: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_efs.LifecyclePolicy.html#example what in my case looks like this:

    const fileSystem = new efs.FileSystem(this, 'efsFileSystem', {
      removalPolicy: cdk.RemovalPolicy.DESTROY,
      vpc: vpc,
      lifecyclePolicy: efs.LifecyclePolicy.AFTER_7_DAYS, // <-- causes error
      performanceMode: efs.PerformanceMode.GENERAL_PURPOSE,
      outOfInfrequentAccessPolicy: efs.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS, 
      encrypted: false, //public data, no need for that
      enableAutomaticBackups: false //public data, no need for that
    }); 

When running cdk deploy, I get the error

Resource handler returned message: "One or more LifecyclePolicy objects specified are malformed. (Service: Efs, Status Code: 400, Request ID: ..., Extended Request ID: null)" (RequestToken: ..., HandlerErrorCode: GeneralServiceException)

When I omit lifecyclePolicy line it works fine. Is that a known issue or do I overlook something?

AWS
Marco
asked 2 years ago66 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions