DianaIonita / serverless-api-gateway-caching

A plugin for the Serverless framework which helps with configuring caching for API Gateway endpoints.
ISC License
136 stars 35 forks source link

Method couldn't be found in the compiled CloudFormation template #44

Closed daniyals closed 5 years ago

daniyals commented 5 years ago

Hello,

Im getting this following error when I try to deploy the serverless code. The app has been in production for quite sometime and now its showing this error and I need to modify the cache settings

The method ApiGatewayMethodInstant-articleSlugVarGet couldn't be found in the compiled CloudFormation template. Caching settings will not be updated for this endpoint.

  instantarticlebyslug:
    handler: services/instantarticles/postbyslug.show
    environment:
      ENDPOINT_URL: <domain>
    events:
      - http:
          path: post/{slug}/instant-articles
          method: get
          caching:
            enabled: true
            cacheKeyParameters:
              - name: request.path.slug

I think its the - in instant-articles causing the issue

cvr270 commented 5 years ago

I ran into a similar issue. As far as I could see the issue is the - ApiGatewayMethodInstant-articleSlugVarGet should be translated to ApiGatewayMethodInstantDasharticleSlugVarGet in the cloudformation stack, if I'm not mistaken?

daniyals commented 5 years ago

Yes I removed the - and it deployed fine.

DianaIonita commented 5 years ago

Thanks for finding this issue, I've just released v1.3.5 which should fix it.