Installation
AppSync Butler should be installed in your CDK or SST application. If you are new to CDK/SST, please consult the relevant documentation:
- Getting started with AWS Cloud Development Kit
- Getting started with Serverless Stack Toolkit
Create a new CDK or SST application
We provide a convenient CLI appsync-butler to bootstrap a CDK or SST application with AppSync Butler installed. If you have an existing CDK or SST application, skip to the Manual setup section. To create a new project, run the following:
SST v1 is no longer mainted. The tutorial is functional with SST v1 if you have already bootstrapped the SST v1 in your AWS account before*. We recommend choosing CDK when following this tutorial. If you're interested in support for SST v2, please file an issue on GitHub.
* When bootstrapping SST v1 on an AWS account, SST will deploy a cloudformation template that has a node14 lambda function. AWS killed support for node14 in lambda functions, and as such, the cloudformation deployment would fail.
- Serverless Stack Toolkit
- AWS Cloud Development Kit
npx appsync-butler -t sst
npx appsync-butler -t cdk -- --language typescript
The --language typescript
option is passed to the aws-cdk
CLI.
To view other other possible values, run npx aws-cdk init app --help
(or npx appsync-butler -t cdk -- --help
).
This will take care of invoking the sst or the cdk CLI along with installing AppSync Butler and setting up the directory tree.
Manual setup
Open a terminal in your CDK or SST project and install the required dependencies.
- Serverless Stack Toolkit
- AWS Cloud Development Kit
# Using npm:
npm install @appsync-butler/core @appsync-butler/sst
# Using Yarn:
yarn add @appsync-butler/core @appsync-butler/sst
# Using npm:
npm install @aws-cdk/aws-appsync-alpha @appsync-butler/core
# Using Yarn:
yarn add @aws-cdk/aws-appsync-alpha @appsync-butler/core