(appsync): 2.1.0 breaks deployment
See original GitHub issueWhat 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
My bad - happy to help if there are any other changes that need to be made but looks like they are all covered - just lemme know. @bodokaiser - you many want to use an older CDK version < 2.1.0 until the next release has both of the above changes.
OK our stack doesn’t actually use Appsync. I’ll try to figure out what’s the problem and create separate issue 😃 We get the same error though.