Let's say you have an AWS AppSync API named API-DEV
.
It hosts the GraphQL Schema, the Resolvers, the Data sources, DynamoDB tables (ex:Dev_Articles
), DynamoDB tables configuration, and DynamoDB data. The API is consumed by approx. 50 instances of the same React app.
How would you automate the migration of newest features from API-DEV
to API-STAGING
? Note that I want to update everything except data.
Ways to go I'm thinking about:
aws-cli
to store the changes in a GIT repo and automatically deploy on push. Seems like a great way to do this but couldn't find a step-by-step guide, plus, all our config is already in AWS so my guess is that we would have to recreate all using the template.aws-cli
to compare and update. Then have this hosted on Lamda and triggered by pushes on the staging
or master
branches of the React app repo (Code Commit > Code Build > Code Deploy). That's where I'm heading for now, but there may be an existing solution out there.Have any other idea? Let me know!
Use CloudFormation to model your API. You can then maintain your API configuration, resolvers, and data sources (without data) as code and run that template in the various stages.
To simplify creation of the CloudFormation, you can use the AWS Amplify CLI to define the GraphQL schema, which will autogenerate the resolvers for you.