serverless-architecture / reference-architectures

A community project for capturing, sharing, exploring, and debating the patterns and practices being used in serverless production applications.
https://www.jeremydaly.com/serverless-reference-architectures/
195 stars 26 forks source link

Add a Pulumi variant of Simple Web Service #3

Closed joeduffy closed 4 years ago

joeduffy commented 4 years ago

I saw this on Twitter today and got excited 😄 . I also instantly wondered what it'd look like in Pulumi and couldn't help myself. Here's just the Simple Web Service. If you are keen to include it, I'm happy to port the others!

Details:

This PR adds a Pulumi variant of the Simple Web Service reference architecture, which uses DynamoDB, API Gateway, and Lambda.

This example uses the simpler form of Pulumi which automatically assigns Lambda Function settings, including IAM, as well as auto-names various resources. See comments in the code for how to control these directly.

It also includes the application code right inside of the infrastructure definitions; this makes it easy to spin up serverless architectures, and gives Pulumi understanding of dependencies between things (and ability to capture the Table from the callback directly). This isn't always the desired approach; you can keep them distinct if you prefer. This page provides some detailed guidance on possible approaches https://www.pulumi.com/docs/guides/crosswalk/aws/lambda/.

jeremydaly commented 4 years ago

Hey Joe! This is awesome. I was just about to reach out to you this morning to ask if your team might be able to contribute. I'll merge this in and get it into the interface as well.

Thanks, Jeremy

joeduffy commented 4 years ago

Great, thanks Jeremy! If you think it's worth converting the other examples, I'm happy to do that.

We've been brainstorming the idea of doing more "reference architecture" material lately. I started this repo https://github.com/joeduffy/pulumi-architectures to experiment. Always happy to team up a bit on some of this 😄

In any case, thanks for starting this -- super eager to see where it goes from here 🎉

jeremydaly commented 4 years ago

Hey Joe,

It'd be great if you and your team could create examples for the different patterns in this repo just so they are organized all together. No need to copy other examples exactly, just as long as they implement the pattern. And if there are more resources on your side, just add those links to the READMEs.

Thanks, Jeremy