amazon-web-services - How to keep AWS APPSync APIs in sync from Dev to Staging to Production?
问题描述
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:
- Keep a list of things to update, move the staging apps to maintenance mode, and manually apply the changes to staging env. Seems like a lot of work to do at every "release" and error-prone.
- Use some kind of YAML template in conjunction with
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. - Use some kind of tool that would automate compare and update from two given API and DynamoDB. Not found this yet.
- Build my own Nodejs app that would leverage
aws-cli
to compare and update. Then have this hosted on Lamda and triggered by pushes on thestaging
ormaster
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!
解决方案
使用CloudFormation 为您的 API 建模。然后,您可以将 API 配置、解析器和数据源(无数据)维护为代码,并在各个阶段运行该模板。
为了简化 CloudFormation 的创建,您可以使用AWS Amplify CLI定义 GraphQL 架构,该架构将为您自动生成解析器。
推荐阅读
- php - 为 PHP 7.4.14 启用 imap - BIG SUR
- haskell - Haskell quickBatch 测试:Ap ZipList 的新类型包装器
- javascript - 为什么这个元素没有从 Firestore 中获取?
- firefox-addon-webextensions - 使用 web-ext 使用 node_module 脚本签署 webextension
- list - 如何更改 Haskell 矩阵中的某个值?
- node.js - 在 deno 中连接到 SQL Server 时出错:“找不到模块加密”
- flutter - Flutter DataTable 的默认线型是什么?
- amazon-web-services - 我如何确保我的 aws s3 存储桶只能写入
- php - WooCommerce 自定义 PHP 代码以更改“添加到购物车”按钮文本
- wifi - ESP32 为什么深度睡眠后 WiFi 连接会导致“触发掉电检测器”