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

Closed
0xdevalias opened this issue Sep 13, 2018 · 7 comments
Closed

SAM, Amplify, Cloud Development Kit (CDK), etc? #160

0xdevalias opened this issue Sep 13, 2018 · 7 comments
Labels
question General question

Comments

@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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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.

@UnleashedMind UnleashedMind added the question General question label Sep 17, 2018
@kaustavghosh06
Copy link
Contributor

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
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

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question General question
Projects
None yet
Development

No branches or pull requests

5 participants