简体   繁体   中英

How to connect self hosted PostgreSQL on AWS EKS to AWS AppSync with auto schema generation and hot reload?

I have research it for several days but could not find a definitive answer for it.

My use case is I have a PostgreSQL database hosted on AWS EKS and I want to expose it using GraphQL, which generally leads to AWS AppSync.

I understand that AppSync can be auto imported from DynamoDB only however I am not using that. From several articles it suggested a Lambda Function to connect between AppSync and PostgreSQL. Which I tried, but I need the two feature which is:

  • Auto Generated Schema
  • Hot reload of the schema whenever there is changes in the database

Currently I am using PostGraphile for these two features however I am not sure AppSync can be connected to that, as I understand we need to push the schema generated by PostGraphile to AppSync, but I need it to be automatic.

Eg: I create a new table in PostgreSQL -> PostGraphile Lambda Function reload the schema -> Reflects on AppSync schema automatically -> User call new table via AppSync

Can this flow be achieved? Is there anything I can use as reference?

Thank you!

If anyone still wondering, I found a resource from AWS seems to be able to achieve this with some tweaks and changes: https://github.com/aws-samples/appsync-with-postgraphile-rds

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM