Background: I’m building a single page application (SPA) with Quasar (Vue) utilizing things like AppSync, DDB, Lambda, etc., hopefully all orchestrated by CDK.
I understand how Amplify can get you up and running by automatically generating Cloudformation templates and deploying then for you, but the moment I want to start customizing anything related to it or take the Cfn resources as a dependency in my own CDK package, it becomes a huge page.
Ideally I would like to be able to use CDK to manage the infra for my service rather than relying on Amplify to abstract it away from me, but I also really don’t want to manually write out my entire GraphQL schema by hand and write 300 different mapping templates for the various resolver so I can have proper authentication and ownership of data. I would really like to use the aws-appsync-codegen CLI tool, but that was replaced by the Amplify CLI; and the only way I can use the amplify CLI is if I setup and configure Amplify.
I did try using both a CDK defined Amplify app that would also use `amplifyPush` to deploy the nested Cfn stacks that it had itself, but I feel like it’s so much cleaner and maintainable to have separate packages for infra vs UI.
The only way I can really think about going with this is configuring Amplify on my UI package, and then manually copying over the automatically generate values for my CDK package to use.
I’m really hoping I’m missing something hear, so I would love to hear anyone’s thoughts about this.
I’m interested in this question too. I use Cdk extensively and I’ve used amplify some. It appears to me that you have to choose between the amplify cli and amplify deployment pipeline or use Cdk and build it all yourself (ie no codegen).
It also looked to me like amplify cli was built to allow multiple iac providers but that cloud formation is the only one in use. I haven’t discovered any way for writing my own cdk iac providers in amplify though. I also haven’t looked that hard.
Id like to see a hybrid example that gives full control over infrastructure with cdk and can also use the codegen tools that come with amplify. Maybe even use the amplify pipeline too. I’m sure it can be done, but I haven’t had time to try.
I think you are right guys! You need to chose either worlds. As you are fluent with the CDK, you have a lot more flexibility and control over the infrastructure. Amplify is really made to abstract from the infra and it’s primarily for developers who want to focus on app development mainly. I guess that maybe you could find another code generator. I’m interested if you could advise on a good one BTW.
Even if it’s primarily aimed at developers to start as quickly and easily as possible, there should be migration paths in place to keep the app running while migrating each part away from Amplify, if needed.
Fully agreed. We just ran into an issue where we wanted to add some redirect behavior to an Amplify-created CloudFront, and we weren’t able to do it. Very frustrating to say the least.