Python sample app is broken in 0.36.0
See original GitHub issueNote: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.
-
I’m submitting a …
- 🪲 bug report
- 🚀 feature request
- 📚 construct library gap
- ☎️ security issue or vulnerability => Please see policy
- ❓ support request => Please see note at the top of this template.
-
What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce Install cdk 0.3.6
cdk init sample-app --language=python
source .env/bin/activate
python3 -m pip install -r requirements.txt
cdk synth
Traceback (most recent call last):
File "app.py", line 5, in <module>
from hello.hello_stack import MyStack
File "/home/ec2-user/environment/test2/hello/hello_stack.py", line 9, in <module>
from hello_construct import HelloConstruct
File "/home/ec2-user/environment/test2/hello/hello_construct.py", line 8, in <module>
class HelloConstruct(cdk.Construct):
**AttributeError: module 'aws_cdk.cdk' has no attribute 'Construct'**
Subprocess exited with error 1
-
What is the expected behavior (or behavior of feature suggested)? cdk synth should succeed
-
What is the motivation / use case for changing the behavior or adding this feature?
-
Please tell us about your environment:
- CDK CLI Version:0.36.0
- Module Version: xx.xx.xx
- OS: Amazon Linux (Code9)
- Language: [Python ]
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc) It appears the change from aws-cdk.cdk in 0.36.0 broke the sample-app and needs to be updated.
It also appears there is a change to the sqs.Queue class that breaks hello_construct.py. Specicially, visibility_timeout_secs was renamed visbility_timeout and expects an object instead of int.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
To workaround in the sample app:
cdk,
tocore,
in app.py, hello_construct.py, and hello_stack.pycdk.
tocore.
in the same 3 python scriptsvisibility_timeout_secs=300
tovisibility_timeout=core.Duration.seconds(300)
in hello_construct.pyApp.run()
withApp.synth()
at the end of the app.py scriptHave fun!
Same for me. I installed cdk this morning. At that time it was 0.35. I wrote my app modeled on the sample app. Later in the day, I had to install cdk for cloudformation. At that point my cdk got upgraded to 0.36. That time I got the same error.