Nice article ! Thanks for sharing.
In addition, if your CDK stack does not require any assets to be uploaded (understand does not contain any lambda, which should be taken care of by Serverless framework definition), you can use CDK programmatic API synth to inject generated Cloudformation resources directly within the resources key of your serverless.yml file. You then only need to run sls deploy to deploy both Serverless framework resources and CDK resources. Take a look at twitter.com/bartheletf/status/1382... to know more !
Ooh, that's a great point I didn't consider! It does make it a bit simpler but you also lose a few of the benefits of having the separate stacks and being able to cdk diff for example, I suppose.
Hi @Frédéric, excellent idea but I had a question:
What if the exported values are tokens? Cause the token values are alloted actual values only after deployment through cdk.
Hi @adityanair102001 , I wrote an article to explain in more detail what can be achieved in terms of CDK provisioning through Serverless framework lifecycle. You can have a look at dev.to/kumo/serverless-framework-a... to learn more. Token can be resolved using the resolve API available on the CDK stack :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article ! Thanks for sharing.
In addition, if your CDK stack does not require any assets to be uploaded (understand does not contain any lambda, which should be taken care of by Serverless framework definition), you can use CDK programmatic API
synthto inject generated Cloudformation resources directly within theresourceskey of your serverless.yml file. You then only need to runsls deployto deploy both Serverless framework resources and CDK resources. Take a look at twitter.com/bartheletf/status/1382... to know more !Ooh, that's a great point I didn't consider! It does make it a bit simpler but you also lose a few of the benefits of having the separate stacks and being able to
cdk difffor example, I suppose.Thanks for the tip! 🙌
Hi @Frédéric, excellent idea but I had a question:
What if the exported values are tokens? Cause the token values are alloted actual values only after deployment through cdk.
Hi @adityanair102001 , I wrote an article to explain in more detail what can be achieved in terms of CDK provisioning through Serverless framework lifecycle. You can have a look at dev.to/kumo/serverless-framework-a... to learn more. Token can be resolved using the resolve API available on the CDK stack :)