Slide 1

Slide 1 text

Seamless AWS Cloud Development and Testing Locally

Slide 2

Slide 2 text

anca.ghenade@localstack.cloud @tinyg210 tinyg210 Anca Ghenade Developer Advocate @ LocalStack

Slide 3

Slide 3 text

How does one go around developing applications using AWS services? A short story… with cats.

Slide 4

Slide 4 text

1. So you’re tasked with developing a new web application on AWS Cloud

Slide 5

Slide 5 text

2. Developing on a local machine, you soon find out that there are lots of dependencies with resources in the cloud

Slide 6

Slide 6 text

3. You realize that the dev & test loop is extremely slow and tedious. Every local change needs to be packaged and uploaded to the cloud for testing.

Slide 7

Slide 7 text

4. You have a red build on your feature branch, but can’t efficiently test and debug the code in the CI/CD pipeline.

Slide 8

Slide 8 text

5. The whole team is using Git flow for development - one CI build per feature branch. There is an explosion of different environments required for development (branches x developers).

Slide 9

Slide 9 text

6. Your manager approaches the team and complains that AWS dev/test resources are not being cleaned up properly causing cost spikes.

Slide 10

Slide 10 text

Additional pain points: You’re working in environments that have concerns about: ● Security ● Regulatory compliance ● Data Sovereignty ● Risk Management * We’re talking about banking and healthcare especially here.

Slide 11

Slide 11 text

So the developer experience is… complex. 󰤆

Slide 12

Slide 12 text

What is LocalStack? A fully functional local cloud stack that was born out of these exact concerns.

Slide 13

Slide 13 text

● Enables a highly efficient dev & test loop for cloud apps ● Ships as a Docker image, easy to install and start up ● Support for a growing number of services: ○ compute (Lambda, ECS, EKS) ○ various databases (DynamoDB, RDS) ○ messaging (SQS, Kinesis, MSK) ○ some sophisticated/exotic APIs (Athena, Glue) ● CI integrations & advanced collaboration features ○ redefining the way cloud apps are developed across the lifecycle. ● Support for practices like chaos engineering, ephemeral environments for PRs.

Slide 14

Slide 14 text

“Your application won’t even know the difference.”

Slide 15

Slide 15 text

Source: https://github.com/tinyg210/san-francisco-ship

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Business Logic: ● Shipment entities ● The shipment has weight defined (for ship/plane calculations) ● We need to add the size as a picture ● For size we’re using the IIS (Internet International System) “Banana for scale”

Slide 18

Slide 18 text

Technical recap ● Bean configuration - using Java @Configuration classes ● Java AWS SDK - helps interaction with resources ● Spring Profiles - environment specific configuration ● IaC via Terraform - consistency across environments

Slide 19

Slide 19 text

Scenario 1 Scenario 2

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

You have reasons: ● Most applications are complex in used resources ● Creating resources is time consuming ● Development cycles can be slow - costs developer time ● Resources are tedious to clean up ● If not disposed of properly, resources can be costly ● Interaction between services can be slow on AWS

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

IaC Tools Developer Tools Language SDKs App Frame- works CI/CD Systems TESTCONTAINERS Copilot

Slide 24

Slide 24 text

Some benchmarking: AWS LocalStack

Slide 25

Slide 25 text

What about testing your AWS-powered applications?

Slide 26

Slide 26 text

YES

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

How much of your system you can test Cloud emulation Full cloud emulation with service integration 3 Staging environments Highest fidelity because it actually runs in the cloud 4 Mocking Mock out cloud APIs 1 Service emulation Replace individual services with local versions 2 Testability of Cloud App Deployments

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Testcontainers

Slide 31

Slide 31 text

Test successful POST Test successful GET Test fails validation on incorrect values Test 404 on wrong param

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

AWS Parity ● AWS Server Framework ○ weekly runs to check parity ○ makes heavy use of botocore ● Snapshot testing ● Metrics collection to track test coverage

Slide 34

Slide 34 text

Thank You!