Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing logical ID of AppSync resolver result in error upon deploy (CDK)

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 :)

like image 522
Hairi Avatar asked Dec 14 '25 22:12

Hairi


1 Answers

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.

like image 89
Lasek Avatar answered Dec 16 '25 21:12

Lasek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!