(cdk migrate): While running `cdk migrate` with python, error received (NameError: name 'props_access_keys_rotated_param_max_access_key_age' is not defined.)
Describe the bug
-
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
-
Run the CDK migrate command:
cdk migrate --stack-name Comformance --language python --from-path Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml -
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
-
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
-
Run the CDK migrate command:
cdk migrate --stack-name Comformance --language python --from-path Operational-Best-Practices-for-CMMC-2.0-Level-2.yaml -
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
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-
snippet of stack created successfully -
The directory structure created -
I did the same for Typescript language and it succedded with that as well -
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.
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 , thanks for clarifying. I will investigate it further and get back to you.
@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'?
This is related to JSII Runtime so marking it as appropriate for JSII team and moving to JSII Repo for further investigation.