Skip to content
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

Add documentation for AWS CDK #958

Merged
merged 2 commits into from
Apr 13, 2021
Merged

Add documentation for AWS CDK #958

merged 2 commits into from
Apr 13, 2021

Conversation

zaro0508
Copy link
Contributor

Sceptre can generate cloudformation templates from AWS CDK code
without much effort. Adding documention on how to use sceptre
to drive AWS CDK python files.

@dlahn
Copy link

dlahn commented Jan 12, 2021

I think there is some issue here. It works fine to generate an individual stack, however, trying to run multiple stacks using the same template file blows up with all sorts of random errors, like:

'CloudAssembly' object has no attribute 'template'
'CloudAssembly' object has no attribute 'template'
'CloudAssembly' object has no attribute 'template'
'CloudFormationStackArtifact' object has no attribute 'get_stack'
'CloudFormationStackArtifact' object has no attribute 'get_stack'
'CloudFormationStackArtifact' object has no attribute 'get_stack'
"Parameter validation failed:\nInvalid type for parameter TemplateBody, value: None, type: <class 'NoneType'>, valid types: <class 'str'>"

@zaro0508
Copy link
Contributor Author

did my fix make any difference for you @dlahn ?

@dlahn
Copy link

dlahn commented Jan 12, 2021

@zaro0508 I had already made the change you proposed on our side. We are still seeing those errors with the change in place. It works fine for an individual stack, but not when we run a folder for example, containing a number of stacks that use the same template file.

@zaro0508
Copy link
Contributor Author

hmm, it seems to work for me. Can you please provide pip/version info and see if your environment is much different than mine? here is details of my environment and execution: http://paste.openstack.org/show/801572/

@dlahn
Copy link

dlahn commented Jan 13, 2021

@zaro0508 It's pretty similar. I'm running Python 3.8.1. I was on Sceptre 2.4, but 2.3 exhibits the same problem. Upgrading CDK to what you have gives a few new errors:

Cannot reference across apps. Consuming and producing stacks must be defined within the same CDK app.
'CloudAssembly' object has no attribute 'template'
Cannot reference across apps. Consuming and producing stacks must be defined within the same CDK app.
'CloudFormationStackArtifact' object has no attribute 'get_stack'

These are definitely defined in the same apps. I use the same approach you do above.

As far as your run example, it doesn't look like (though I could be wrong) that you are running a number of the same template in parallel. In my case, I have about 6 stacks defined that insert routes into a route table. They all use route.py. If I run them individually, all is good. If I run the whole folder, it all blows up/hangs. Perhaps there is some sort of collision between these being run at the same time by Sceptre?

@lloydpick
Copy link

Might be related to aws/aws-cdk#1479

As an additional note about something that I missed last time around: App is designed to only be instantiated once. It's represents the "CDK App", not "your app".

@zaro0508
Copy link
Contributor Author

Thanks for the reference @lloydpick. That makes sense because my test run consisted of one CDK file with a bunch of other non-CDK files. The issue that @dlahn is seeing seems like a CDK problem not a sceptre problem.

Sceptre can generate cloudformation templates from AWS CDK code
without much effort. Adding documention on how to use sceptre
to drive AWS CDK python files.
@zaro0508 zaro0508 merged commit 5486a6a into Sceptre:master Apr 13, 2021
alex-harvey-z3q pushed a commit to fsa-streamotion/sceptre that referenced this pull request May 14, 2021
Sceptre can generate cloudformation templates from AWS CDK code
without much effort. Adding documention on how to use sceptre
to drive AWS CDK python files.
mrowlingfox pushed a commit to fsa-streamotion/sceptre that referenced this pull request May 19, 2021
Sceptre can generate cloudformation templates from AWS CDK code
without much effort. Adding documention on how to use sceptre
to drive AWS CDK python files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants