Coder Social home page Coder Social logo

[serverless-api-gateway-caching] No Rest API found. Caching settings will not be updated - when used in conjunction with serverless-nested-stack. about serverless-api-gateway-caching HOT 9 CLOSED

kkirov avatar kkirov commented on June 16, 2024 2
[serverless-api-gateway-caching] No Rest API found. Caching settings will not be updated - when used in conjunction with serverless-nested-stack.

from serverless-api-gateway-caching.

Comments (9)

chaitanya11 avatar chaitanya11 commented on June 16, 2024 3

I am also facing same issue when used with serverless-plugin-split-stacks.

from serverless-api-gateway-caching.

webchaz avatar webchaz commented on June 16, 2024 2

I'm getting this same issue using serverless-plugin-split-stacks have also tried multiple order for including these. Any chance you found a solution to this?

from serverless-api-gateway-caching.

majoraze avatar majoraze commented on June 16, 2024 1

Actually I found this package that I believe is a fork of this one and it's working:
https://www.npmjs.com/package/serverless-api-gateway-caching-split-stack

All I have to do (after spent some time looking at the code) is add this configuration:

apiGatewayCaching:
    forceEnable: true

And changing the plugin to:
- serverless-api-gateway-caching-split-stack

Maybe someone can merge this in this repo?

from serverless-api-gateway-caching.

BorjaMacedo avatar BorjaMacedo commented on June 16, 2024 1

If you are using split stack you need it to place the AWS :: ApiGateway :: RestApi resource in the root. To cause that you need to use the file stacks-map.js.

if (resource.Type.includes('AWS::ApiGateway::RestApi')) {
            return false;
}

Be careful, returning null or undefined is not enough.

from serverless-api-gateway-caching.

willfarrell avatar willfarrell commented on June 16, 2024

What's the order of your plugins? Order matters.

from serverless-api-gateway-caching.

kkirov avatar kkirov commented on June 16, 2024
  • serverless-api-gateway-caching
  • serverless-nested-stack

but I also tried:

  • serverless-nested-stack
  • serverless-api-gateway-caching

and I get the same result.

from serverless-api-gateway-caching.

simqel avatar simqel commented on June 16, 2024

For now, the only solution that I've found is to set restApiId and restApiRootResourceId manually:

provider:
  apiGateway:
    restApiId: xxxxx
    restApiRootResourceId: xxxxx

How to get them: https://serverless.com/framework/docs/providers/aws/events/apigateway#manually-configuring-shared-api-gateway

Can be also set separately for stages using custom section and variables.

from serverless-api-gateway-caching.

majoraze avatar majoraze commented on June 16, 2024

Same issue using serverless-plugin-split-stacks. Any solution rather than setting the restApiId manually?

from serverless-api-gateway-caching.

DianaIonita avatar DianaIonita commented on June 16, 2024

The latest version of the plugin, 1.7.3, now has an improved way of finding the Rest API id, which should make it work with stack splitting plugins. The changes applied are in this PR if anyone is curious.

Please feel free to reopen the issue or raise a new one if you're still having problems.

from serverless-api-gateway-caching.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.