AppSync Subscription doesn't work when deployed through CloudFormation

0

This may sound weird, but when I deploy my AppSync stack through CloudFormation (using Serverless Framework), stack deploys successfully but on running subscription (enhanced filtering), it doesn't trigger even though mutations are called. I noticed something, when I deploy subscriptions manually through the console or just update the schema from the console without modifying anything, the subscription runs fine as expected.

3개 답변
1

I'm facing the same issue, watch this video: https://youtu.be/bkWkMAch6cw

답변함 3달 전
  • The same is happening to me too, after deploying just adding a space to the schema in console will make it working. Surprisingly, when I redeploy (2nd time with the same configuration no change) somehow it works.

1

Actually, Whether creating appsync through the console or CloudFormat, it is essentially the same. Both of these methods rely on calling the corresponding API at the bottom, such as CreateGraphqlApi[1], and you can see the corresponding events in your cloudtrail. The only difference between the two is that the parameters specified during creation are different. Cloudformation needs to specify more parameters by itself, which may be the reason why the two appsyncs perform differently.

You can search for CreatGraphqlApi based on event name in your cloudtrail[2] console, event history to compare the difference of these[3].

[1]https://docs.aws.amazon.com/appsync/latest/APIReference/API_CreateGraphqlApi.html
[2]https://docs.aws.amazon.com/zh_cn/appsync/latest/devguide/cloudtrail-logging.html
[3]https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html

profile picture
답변함 3달 전
0
수락된 답변

I have found the issue, it was due to adding default arguments in the schema.

Apparently, AppSync doesn't formally support default arguments, so whenever I used to deploy using CloudFormation the schema with default argument was uploaded (although it cant be seen from console). And on updating console manually, AppSync would take care of default arguments internally.

Removing the default argument worked for me

답변함 3달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠