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, Amplify, Cloud Development Kit (CDK), etc? #160

Closed
0xdevalias opened this Issue Sep 13, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@0xdevalias
Copy link

0xdevalias commented Sep 13, 2018

This is more of a pondering/question.. but how does (or do you see) SAM, Amplify, Cloud Development Kit (CDK), etc playing together?

In a lot of ways it feels like that there is a fair bit of crossover between all of the tools (at least in the CLI area), and that they would work pretty synergistically together (or outright replace each other)

For example, from my little experience playing with/reading about them:

Amplify seems nice for quickly generating some common 'stack features' for a project, but seems less nice when it comes to customising those things later on, and since it (currently) seems to only generate CloudFormation json, and doesn't appear as though it has any SAM features, it all feels pretty verbose.

SAM is nice and relatively quick for implementing the various little things it supports, but very quickly degenerates into having to manually wire together a bunch of CloudFormation yaml directly, and has a few interesting quirks/similar with regards to file uploads, stacksets, etc.

Cloud Development Kit (CDK) sounds like it will be a good toolset for tying together features and functions, and in a lot of ways feels like it could encapsulate or almost replace the others. In particular, I get the feeling that everything Amplify currently does could be done in a simpler/more maintainable way with CDK (or perhaps Amplify could use CDK's functionality under the hood)

If I had to guess.. I would say that a combination of CDK + SAM's translations would make for the 'nicest' end result.. but this is all high level pondering/speculation. Ultimately it comes down to what is going to make my life easier/quicker/less boilerplatey as a developer, and which of these is likely to be hanging around in the long run.

Ref:

@undefobj

This comment has been minimized.

Copy link
Contributor

undefobj commented Sep 13, 2018

Thanks for the question. Amplify is an open source project which is focused on mobile and web developers building applications. This consists of a library, UI components, and a CLI toolchain. The design follows a category based model allowing developers to perform advanced use cases with declarative client APIs so that they can focus on their application code (e.g. Auth.signIn() or API.graphql()). This allows developers to focus on their business use cases and less time on re-implementing the most common use cases around mobile or web app development (Auth flows, Storage and API interaction, Analytics, etc.).

Additionally while most of the implementations today use AWS services, this design and the architecture allows you to use them with non-AWS backends (for instance calling your own self hosted API) or even provide your own GraphQL transformers or CLI plug-ins. Some links to read more about the project can be found below.

https://github.com/aws-amplify/amplify-js/wiki
https://aws.amazon.com/blogs/mobile/announcing-aws-amplify-and-the-aws-mobile-cli/
https://aws.amazon.com/blogs/mobile/announcing-the-aws-amplify-cli-toolchain/

@0xdevalias

This comment has been minimized.

Copy link

0xdevalias commented Sep 14, 2018

Thanks for that @undefobj, helps to clarify the purpose a bit better. I wonder, given the crossover, is there any likelihood that now (or in the future) Amplify (at least the CLI side of things) might consume CDK's resources to handle the AWS side of things? Would enable easier customisability, ability to output yaml formatted, etc.

@undefobj

This comment has been minimized.

Copy link
Contributor

undefobj commented Sep 15, 2018

Amplify library can leverage AWS resources today created independently of the CLI, either from other tools or the AWS console. We manage feature priorities based on the number of customer requests and also how they fit within the goals of a particular part of the project. It's important to remember that from my explanation above Amplify's goal is to provide a category based model of interacting with the cloud using declarative actions based on use cases for mobile and web developers, and what you're asking about is a specific implementation that would be most useful for people that really want to dig into the underlying details and manage at a fine grained level all of the AWS resources. That being said the design philosophy of Amplify (Library and CLI) is to provide escape hatches and we'll continue to keep doing this. For instance you can write your own GraphQL transformer which could potentially leverage other tools rather than straight CloudFormation: https://github.com/aws-amplify/amplify-cli/blob/master/how-to-write-a-transformer.md

You can also write your own plug-in to the CLI that could potentially do what you're asking for above and publish it. We are working for a guide on how to do this in the coming weeks stay tuned.

@0xdevalias

This comment has been minimized.

Copy link

0xdevalias commented Sep 17, 2018

That being said the design philosophy of Amplify (Library and CLI) is to provide escape hatches and we'll continue to keep doing this.

This is more what I was aiming at. The simplicity of a 'add this category of functionality' system is great, but if there is no easy way to tweak it as required when your needs don't perfectly match, it becomes super painful having to reimplement the whole category/find a workaround just to tweak one tiny part of it.

Also, given that the current implementation appears to just use raw cloudformation json + some templating, I figured perhaps it would be a more flexibile/'nice' solution to consume the CDK api to produce the same higher level categories, and then you could also leverage additional functionality it provides.

You can also write your own plug-in to the CLI that could potentially do what you're asking for above and publish it. We are working for a guide on how to do this in the coming weeks stay tuned.

Looking forward to the guide. I looked around for any existing documentation/explanation before opening this, but didn't seem to come across anything detailed/'implementable' enough.

@kaustavghosh06

This comment has been minimized.

Copy link
Contributor

kaustavghosh06 commented Dec 27, 2018

Closing this issue. Thanks for your blog post earlier this year regarding this explaining the use cases around SAM, Amplify, Cloud Development Kit (CDK) and when/where to use which service/tool!

@sopel

This comment has been minimized.

Copy link

sopel commented Jan 18, 2019

Took me a few seconds to find the mentioned and indeed excellent blog post, so for future visitors: Forming Serverless Clouds with AWS: CloudFormation, SAM, CDK, Amplify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment