Home > front end >  Changing ID of AppSync resolver result in error upon deploy (CDK)
Changing ID of AppSync resolver result in error upon deploy (CDK)

Time:07-29

When I change a resolver ID as follows:

From: new appsync.Resolver(scope, "SuperResolver",.....

To: new appsync.Resolver(scope, "MegaResolver",.....

i.e from "SuperResolver" to "MegaResolver" and then I run cdk deploy, I get the following error:

Only one resolver is allowed per field. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException; Request ID: fd68b0ff-38a5-4149-a797-138baf6a836c; Proxy: null

It appears that instead of replacing the ID of the existing resolver (or deleting the construct with the old ID and creating a new one with the new ID), AppSync tries to attach a new resolver to the GQL field.

But the error is rather bogus, so my assumption may be incorrect.

Did anyone experience such a problem? Any help would be much appreciated :)

CodePudding user response:

It's because CloudFormation firstly creates new resources before it deletes old ones. In this case you have to delete resolver in one deploy and add new one in the next.

  • Related