Skip to content
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

(api-gateway): Ability to set Per-key cache invalidation attributes #18794

Open
2 tasks
parencik opened this issue Feb 2, 2022 · 10 comments
Open
2 tasks

(api-gateway): Ability to set Per-key cache invalidation attributes #18794

parencik opened this issue Feb 2, 2022 · 10 comments
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway feature-request A feature should be added or improved. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1

Comments

@parencik
Copy link

parencik commented Feb 2, 2022

Description

It would be great to be able to set Per-key cache invalidation (enabled/disabled) and sub-attributes - Require authorization (true/false) and Handle unauthorized requests (1 from 3 options) globally - per stage and per method in API.

Use Case

I'm regularly deploying 20+ APIs to 3 stages and have to manually set Per-key cache invalidation behavior manually for each method separately, thats annoying.

Proposed Solution

Would be great if added these options to interface StageOptions and MethodDeploymentOptions

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@parencik parencik added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 2, 2022
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Feb 2, 2022
@otaviomacedo
Copy link
Contributor

Hi, @parencik. I'm not sure if I fully understand this feature request.

You can already define caching per key on the integration level. For example:

new apigateway.LambdaIntegration(someLambdaFunction, {
  cacheKeyParameters: /* ... */
});

And to define which methods need authorization and what authorization mechanism to apply, you can use authorizers on the method level.

But I presume you mean something different. Can you share some examples of what the API would look like?

@bruno-roussel
Copy link

I have the same issue, I can't find a way to configure the cache invalidation

image

from this issue aws/serverless-application-model#788

@parencik
Copy link
Author

parencik commented Feb 14, 2022

@otaviomacedo
Bruno's print screen shows what i meant

@peterwoodworth peterwoodworth removed the needs-triage This issue or PR still needs to be triaged. label Mar 31, 2022
@otaviomacedo otaviomacedo removed their assignment Jun 27, 2022
@unitypark
Copy link

are there any progress on this issue?

@Naumel
Copy link
Contributor

Naumel commented Sep 15, 2022

This issue is a p2, which means that we are unable to work on this immediately.

We use +1s to help prioritize work, and are happy to reevaluate this issue based on community feedback ( number of 👍 on issue description).

@github-actions github-actions bot added p1 and removed p2 labels Nov 13, 2022
@github-actions
Copy link

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

@otaviomacedo
Copy link
Contributor

This is not supported in CloudFormation. I've opened a ticket internally to understand what can be done.

@otaviomacedo otaviomacedo added the needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. label May 19, 2023
@erikfinnman
Copy link

Stumbled recently upon this myself and the best workaround I've come up with is to use the AWS CLI as part of the CI/CD pipeline and remove this property from the API:
aws apigateway update-stage --rest-api-id [api-id] --stage-name [stage_name] --patch-operations \ op="replace",path="'the_resource_path/GET/caching/requireAuthorizationForCacheControl'",value="false"

I have seen some posts where people use wildcards to update multiple resources at the same time, but I didn't get that to work.

Note that the "path" must be escaped according to the instructions here: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/apigateway/client/update_stage.html

@gqe3red
Copy link

gqe3red commented Jul 20, 2023

Please enable the feature Per-key cache invalidation along with Require authorization and Handle unauthorized requests for caching feature

@paul-uz
Copy link

paul-uz commented Oct 30, 2023

+1

I've just encountered this issue. It gets enabled by default it seems, and no way to set it in the Cloudformation config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway feature-request A feature should be added or improved. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1
Projects
None yet
Development

No branches or pull requests

9 participants