jsii icon indicating copy to clipboard operation
jsii copied to clipboard

(cdk migrate): While running `cdk migrate` with python, error received (NameError: name 'props_access_keys_rotated_param_max_access_key_age' is not defined.)

Open nishikkr opened this issue 1 year ago • 4 comments

Describe the bug

  1. Use the AWS Config Conformance Pack YAML file: https://github.com/awslabs/aws-config-rules/blob/master/aws-config-conformance-packs/Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml

  2. Run the CDK migrate command:

    cdk migrate --stack-name Comformance --language python --from-path Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml
    
  3. Attempt to synthesize the stack:

    cdk synth
    

Regression Issue

  • [ ] Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Expected to synthezie

Current Behavior

Failes error stated above

Reproduction Steps

  1. Use the AWS Config Conformance Pack YAML file: https://github.com/awslabs/aws-config-rules/blob/master/aws-config-conformance-packs/Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml

  2. Run the CDK migrate command:

    cdk migrate --stack-name Comformance --language python --from-path Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml
    
  3. Attempt to synthesize the stack:

    cdk synth
    

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.160.0 (build 7a8ae02)

Framework Version

No response

Node.js Version

v18.20.4

OS

MacOS, confirmed it with Windows as well

Language

Python

Language Version

Python 3.12.5

Other information

No response

nishikkr avatar Oct 01 '24 20:10 nishikkr

Hi @nishikkr , thanks for reaching out.

I downloaded this yaml file and was able to migrate this yaml to my stack in Python on Mac-

Screenshot 2024-10-02 at 11 10 43 AM

snippet of stack created successfully -

Screenshot 2024-10-02 at 11 12 52 AM

The directory structure created -

Screenshot 2024-10-02 at 11 18 43 AM

I did the same for Typescript language and it succedded with that as well -

Screenshot 2024-10-02 at 11 21 37 AM Screenshot 2024-10-02 at 11 20 40 AM

Here is a useful post published by CDK Team on CDK Migrate command. Might be helpful.

I would request you to try again and get back if the issue persists. Thanks.

khushail avatar Oct 02 '24 18:10 khushail

Sorry I didn’t describe the issue clear enough cdk migrate does complete without the error for both language but for cdk synth fails on python but doesn’t for typescript

nishikkr avatar Oct 02 '24 19:10 nishikkr

@nishikkr , thanks for clarifying. I will investigate it further and get back to you.

khushail avatar Oct 02 '24 19:10 khushail

@nishikkr , I am able to repro this in Python (however it succeeds in Typescript)-

NameError: name 'props_access_keys_rotated_param_max_access_key_age' is not defined. Did you mean: 'access_keys_rotated_param_max_access_key_age'?
Screenshot 2024-10-02 at 2 08 39 PM

This is related to JSII Runtime so marking it as appropriate for JSII team and moving to JSII Repo for further investigation.

khushail avatar Oct 02 '24 21:10 khushail