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

Problem on deploy #60

Closed pedrosodre closed 4 years ago

pedrosodre commented 5 years ago

Hello,

I tried add the serverless-api-gateway-caching to our serverless.yml to enable the caching on a path param, but the deploy returns this error on pipeline:

serverless deploy --stage=prd

  Serverless Error ---------------------------------------

  Serverless plugin "serverless-api-gateway-caching" initialization errored: Unexpected token (

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           6.17.1
     Serverless Version:     1.42.3

Here is our serverless.yml:

service:
  name: serverless-endpoint

custom:
  apiGatewayCaching:
    enabled: true
    ttlInSeconds: 3600

plugins:
  - serverless-webpack
  - serverless-api-gateway-caching

package:
  exclude:
    - tests/**
    - doc/**

provider:
  name: aws
  region: us-east-1
  runtime: nodejs10.x
  environment:
    INDEX_LOG: logs_endpoint

functions:
  get-endpoint:
    handler: lambda/endpoint-public.get
    timeout: 30
    memorySize: 256
    events:
      - http:
          method: get
          path: /endpoint/{url}
          caching:
            enabled: true
            cacheKeyParameters:
              - name: request.path.url

Did I forget anything?

Cheers

DianaIonita commented 5 years ago

Hi @pedrosodre,

The configuration looks fine. I can't reproduce it on my end. I'm curious, does it still happen if you remove serverless-webpack?

pedrosodre commented 4 years ago

Hey @DianaIonita , thank you for your reply!

Actually I didn't tried remove serverless-webpack because I'm using Typescript on project, so I'm not able to run the code with serverless without it.

DianaIonita commented 4 years ago

Hi @pedrosodre,

Would you be able to reproduce the issue by creating the simplest repository possible and uploading that to GitHub please?

Thanks

DianaIonita commented 4 years ago

Feel free to reopen this if you have any more information about the issue.