-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
appsync: API level cache config #31160
Comments
Thank you for your feature request. Looking at the CFN doc for https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html Can you elaborate more on how a cacheConfig should be passed to a GraphQLApi? |
@pahud - It's possible that it cannot be added directly to the const api = new appsync.GraphqlApi(this, 'EventBridgeApi', {
name: 'EventBridgeApi',
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.eventbridge.graphql')),
});
const cache = new appsync.ApiCache(
api_id: api.api_id
cache_behavior: appsync.CacheBehavior.FULL_REQUEST_CACHING,
type: appsync.CacheType.LARGE,
...
) |
I think we can simply create a const api = new appsync.GraphqlApi(this, 'EventBridgeApi', {
name: 'EventBridgeApi',
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.eventbridge.graphql')),
});
api.addCache(this, 'CacheName', {
cache_behavior: appsync.CacheBehavior.FULL_REQUEST_CACHING,
type: appsync.CacheType.LARGE,
...}; wdyt? And, if you are interested to submit a PR, you can follow this blog post and we'd be happy to review your PR to have this feature. |
I like that. I'd be happy to work on a PR! Thanks for the blog post for reference. |
Describe the feature
The
aws_appsync
module does not include any L2 constructs to enable caching at the API level. There is aCachingConfig
construct but that is specifically for resolvers and cannot be enabled if the API does not have caching enabled itself.Use Case
There is no way to enable caching on a graphql API outside of cfn constrcuts. I would like to enable this directly in the GraphqlApi construct or via it's own L2 construct.
Proposed Solution
Ideally, it could be configured directly in the GraphqlApi construct:
Other Information
No response
Acknowledgements
CDK version used
2.153.0
Environment details (OS name and version, etc.)
MacOS 14.6.1, Node v18
The text was updated successfully, but these errors were encountered: