AWS CDK is an IaC Framework which enables you to easily create serverless applications and plug together several AWS resources like Lambda, API Gateway and DynamoDB tables with just a few lines of code. But how do I verify if the application works as expected?
This talk covers the different ways of testing CDK apps and thereby comprises unit testing Lambda functions, snapshot testing and fine-grained assertion testing of CDK stacks.
Since integration testing is an essential part of gaining confidence in your application, we will split an application into several smaller parts, deploy and test them.
3. More than 550
employees
3
13 locations
in Germany
founded in
2004
> 250 successful
projects in 2022
Off-Project Time for
Innovation & Knowledge Sharing
4. 4
We like to share our knowledge – with our customers and in the community. *
Softwerker magazine
with > 5.500
subscribers
Podcasts for
SoftwerkerCast
Hosted conferences:
SoftwerkerKonf &
Cloud Love
Conference with 25+
workshops & talks
Local Meetups
organized
Lectures & talks at
trade conferences
and fairs
4
7
55
2
>48
Blog posts with
526K clicks and
18 million impressions
91
Knowledge shared is knowledge doubled.
4
* Acin 2022
8. // Sven’s Idea – Let’s do serverless
9
// Scalability and elasticity
// Reduced operational overhead
// Cost-effectiveness
// Security and high availability
Go Serverless!
9. // But wait – what about testing?
10
// Testing locally
// Deploy to the cloud
// What needs to be tested
Testing?
10. // Hackweek – build a POC
11
Go Serverless! Testing?
Hackweek!?
37. // Put Order on queue - testing
38
// Integration tests (cloud)
• Deploy construct
• Replace external resources
// Integration test runner (alpha)
• Deploy to the cloud
• Test in the cloud
38. // Integration test runner
39
// Stack under test
• Deployed to the cloud
// Integration test runner (alpha)
• Step function
• Deployed to the cloud
• Make AWS api calls
• Make Assertions on responses