-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(appsync): 2.1.0 breaks deployment #17925
Description
What is the problem?
After upgrading from 2.0.0 to 2.1.0 we are no longer able to deploy, receiving:
TTL value cannot be smaller than 1 second and larger than 3600 seconds. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException
This seems to be caused by #17815, that introduces cachingConfig to appsync resolvers.
Despite the Cloudformation documentation specifying both the CachingConfig and its two Properties CachingKeys & Ttl as optional, our tests show that when CachingConfig is set, Ttl must be as well.
Current state of v2.1.0:
Not specifying any cachingConfig fails.
Specifying a cachingConfig including only cachingKeys fails.
Specifying a cachingConfig including only ttl succeeds.
Specifying a cachingConfig with both cachingKeys and ttl succeeds.
So it seems like ttl cannot be optional, and we need to check if cachingConfig is passed before adding it to the cfnResolver at line 117 in resolver.ts
@kylevillegas93 Are you able to look into this? I'm happy to help, but also quite busy until next year, and it would be nice to have a fix before then.
Reproduction Steps
Deploy a stack with any appsync resolver, without specifying cachingConfig.
What did you expect to happen?
Deployment to succeed without any errors.
What actually happened?
Deployment fails with: TTL value cannot be smaller than 1 second and larger than 3600 seconds. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException
CDK CLI Version
2.1.0
Framework Version
2.1.0
Node.js Version
14.18.2
OS
macOS 11.6.1
Language
Typescript
Language Version
No response
Other information
No response