Deploy AWS Amplify GraphQL Transformers with AWS CDK

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • aws-amplify-cdk

    AWS Amplify GraphQL transformers deployed with AWS CDK

    Note: A GitHub repository is available to demonstrate the full implementation. Check it out here. The starting point for this article is a project already having AWS CDK configured, which is effectively the result of my previous article https://dev.to/alexvladut/how-to-add-aws-cdk-to-an-existing-project-2d30. This article assumes you're already familiar with how AWS Amplify GraphQL transformers work, but you can find more details in this section of the documentation https://docs.amplify.aws/cli/graphql/overview/.

  • amplify-cli

    The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.

    AWS Amplify code is open-sourced and could be found on GitHub at https://github.com/aws-amplify/amplify-cli. We could make use of the NPM packages deployed independently to recreate the functionality offered by the AWS Amplify CLI regarding the GraphQL transformers. The entry point for generating the Appsync resolvers could be found here and the class we are interested in is GraphQLTransform which takes as a parameter all the individual transformers and iterates over them to generate the GraphQL resolvers and the associated CloudFormation stacks for deploying those resolvers.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

  • amplify-cli-export-construct

    I used the logic defined in this helper library created by AWS to help with importing the CloudFormation resources generated by AWS Amplify https://github.com/aws-amplify/amplify-cli-export-construct. It cannot be used per se due to it requiring all the other resources being available, not only the Appsync related ones, but still, it provides good inspiration.

  • amplify-flutter

    A declarative library with an easy-to-use interface for building Flutter applications on AWS.

    AWS Amplify provides a set of tools and libraries to enable rapid web and native application development. By making use of their tools you can get an application up and running very quickly and with minimal knowledge of the underlying AWS infrastructure. AWS Amplify CLI is one of the tools offered by AWS Amplify in their toolchain. The CLI provides an interactive experience to adding backend capabilities to your application such as GraphQL or RESTful API, authentication, storage, etc. Those configurations are compiled by AWS Amplify CLI into CloudFormation stacks that could be easily deployed to AWS. As an example, the auth capability provided by AWS Amplify is translated to a CloudFormation stack defining a Cognito User Pool with the properties selected interactively during the setup process. This is an exempt from AWS Amplify's docs showing how you will be guided step-by-step in configuring the authentication:

  • aws-cdk

    The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code

    As mentioned above, the AWS Amplify CLI worked great for getting started with a fully working application and even having it deployed very easily, but there are a few limitations I came across along the way that made me look for alternatives. For example, I encountered a few situations when upgrading to a newer version of the AWS Amplify CLI broke my deployment and I had to recreate all the resources from scratch, which is not acceptable for an application running in production. On top of that, performing more advanced configurations requires you to dive into the JSON CloudFormation templates which could be tedious. AWS Amplify is expecting to own the whole structure of your project and as a result, I had a hard time configuring the Lambda functions' code at a different location to use the same linting rules and bundling tools as for the rest of the project, as well as to share some code with the other applications. As AWS CDK was released, I found it to provide a much better experience and flexibility. All the infrastructure resources could be defined in the same programming language as the rest of your code, and you get nice features such as code auto-completion suggestions. The main part of AWS Amplify that I still find useful is the Appsync GraphQL transformers. It is a significant productivity boost as it automatically generates many of the queries and mutations needed by the application. As a result, I was looking around for options to integrate the AWS Amplify GraphQL transformers into a project deployed with AWS CDK, and it turns out the Amplify code is modular enough and it is not as hard as I feared it would be to accomplish this goal.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts