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

SAM version? #426

Open
boxabirds opened this issue Dec 18, 2019 · 13 comments
Open

SAM version? #426

boxabirds opened this issue Dec 18, 2019 · 13 comments

Comments

@boxabirds
Copy link
Contributor

Hi I love Serverless but corporate clients are generally hesitant to use third party elements in the core flow. SAM has come along a bit in recent times -- have you thought of doing a SAM version?

@jayair
Copy link
Contributor

jayair commented Dec 29, 2019

Hmm yeah thats a good point on the corporate clients part. We didn't have plans but I'll have a look at SAM and see how far along they are.

Contributions are welcome though!

@boxabirds
Copy link
Contributor Author

I’ll definitely contribute if I get far enough in this direction. This stack has been unbelievably good. When I start earning myself I’ll definitely sponsor it.

@m0un10
Copy link

m0un10 commented Jun 26, 2020

@jayair how would you prefer to see contributions in regards to SAM?

  1. As an addition to every part when it references serverless, it would have underneath that how to do with sam?
  2. A copy of the whole document structure with serverless parts replaced by sam?
  3. Use variables in the static site, so the choice of serverless and sam can be changed at site build-time (e.g. auto-framework=sam)
  4. Something else?

@boxabirds
Copy link
Contributor Author

Personally I think the juxtaposition of individual steps would be really good. That way people can really see the benefit of serverless.com as well.

@jayair
Copy link
Contributor

jayair commented Jul 3, 2020

@craigbarrau I think it's really hard to do each of the parts side-by-side and keeping them updated over time.

It might be easier to create a separate section that shows how to build out the same backend but with SAM. And then allowing the frontend section to use either backend.

We might even change the design of the homepage to indicate that you can use either backend.

@m0un10
Copy link

m0un10 commented Jul 3, 2020

Thanks @jayair. I recently went through the tutorials from the beginning and used sam instead. I think you are right that a separate section would probably be the easiest way to express the alternative option at least in the short-term.

I've just pushed my sam version of the API here and I'd be keen for feedback. I've also got some detailed notes on the gotchas and limitations compared to serverless as well as some of the benefits I found for sam over the serverless framework.

If you are seriously interested in bringing SAM support into the guide, I'd be more than happy to help as a collaborator or the primary author.

As an aside, and in reply to @boxabirds comment, the tools were a lot less different in terms of functionality and syntax than I thought they would be. One of the main things that I noticed was that sam doesn't try to own the build space as much as serverless. That wasn't a big deal as I learned that the magic of the serverless-bundle plugin seems to be easy to do with plain ol' webpack + npm.

@boxabirds
Copy link
Contributor Author

@craigbarrau amazing! This is really exciting work, thank you! Honestly as a newbie in this space, the tutorial was extremely well done and with sam it should become a mainstream seminal text.

Really, thank you, on behalf of all the budding AWS developers now and in the future.

@jayair
Copy link
Contributor

jayair commented Jul 12, 2020

@m0un10 Awesome! Thank you for this.

I've also got some detailed notes on the gotchas and limitations

Do you mind sharing these? Either in your repo README or here?

I'd like to go through your repo and try setting it up myself. And then put together a rough list of the steps and figure out how we can work together to get this done. Thanks again for offering to help.

@m0un10
Copy link

m0un10 commented Jul 13, 2020

I've got a gist here with my original notes. It also has some details around what is different for the first few chapters when SAM is used instead of the Serverless framework. I didn't have a chance to describe the differences in as much detail for the later chapters but it becomes pretty self explanatory and the full set of changes are available in the sam fork.

@jayair
Copy link
Contributor

jayair commented Jul 13, 2020

Perfect. I'll have a look. Thanks.

@jayair
Copy link
Contributor

jayair commented Jul 14, 2020

I didn't realize SAM requires Docker installed and running. Is there a way around this?

@m0un10
Copy link

m0un10 commented Jul 14, 2020

This is how SAM simulates the function calls locally when you run a test (e.g. sam local invoke or sam local start-api). It pulls down images to support whatever runtime is defined in the template.yaml. If you were simply wanting to build/deploy I don't think Docker would be needed. The deploy step is essentially a convenient wrapper around aws cloudformation deploy.

@boxabirds
Copy link
Contributor Author

If you need to build native binaries I think you still need Docker though, right?

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

No branches or pull requests

3 participants