mlevit / aws-auto-cleanup

Programmatically delete AWS resources based on an allowlist and time to live (TTL) settings
MIT License
495 stars 55 forks source link

ApiGatewayMethodExecutionKeyVarGet - Properties validation failed for resource ApiGatewayMethodExecutionKeyVarGet with message: #140

Open troydieter opened 3 months ago

troydieter commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

PS C:\coderepo\aws-auto-cleanup\api> node --version v18.20.4 PS C:\coderepo\aws-auto-cleanup\api> serverless --version

Serverless ϟ Framework

• 4.1.16

-- When deploying the api I'm seeing:

✖ An error occurred: ApiGatewayMethodExecutionKeyVarGet - Properties validation failed for resource ApiGatewayMethodExecutionKeyVarGet with message:
[#/RequestParameters/method.request.path.key: expected type: Boolean, found: JSONObject, #/RequestParameters/method.request.path.key: expected type: String, found: JSONObject].
ServerlessError2: An error occurred: ApiGatewayMethodExecutionKeyVarGet - Properties validation failed for resource ApiGatewayMethodExecutionKeyVarGet with message:
[#/RequestParameters/method.request.path.key: expected type: Boolean, found: JSONObject, #/RequestParameters/method.request.path.key: expected type: String, found: JSONObject].
    at file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:660:830
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AwsDeploy.update (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:660:25421)
    at async aws:deploy:deploy:updateStack (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:671:4783)
    at async PluginManager.runHooks (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:9296)
    at async PluginManager.invoke (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:10066)
    at async PluginManager.spawn (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:10427)
    at async PluginManager.runHooks (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:9296)
    at async PluginManager.invoke (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:10066)
    at async PluginManager.run (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:854:10790)
    at async Serverless.run (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:861:10442)
    at async runFramework (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:909:2314)
    at async route (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:920:16046)
    at async Object.run2 [as run] (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:920:16444)
    at async run3 (file:///C:/Users/troy.dieter/.serverless/releases/4.1.16/package/dist/sf-core.js:920:17704)

If I comment out cacheKeyParameters, line 199 of api\serverless.yml and line 200 it works:

  ExecutionLogRead:
    handler: src/execution_log/read.lambda_handler
    name: ${self:service}-${self:provider.stage}-execution-log-read
    description: Returns execution logs
    memorySize: 2048
    timeout: 30
    package:
      patterns:
        - "!**"
        - "src/execution_log/read.py"
    environment:
      LOG_LEVEL: ${self:custom.log_level}
      EXECUTION_LOG_BUCKET: ${cf:auto-cleanup-app-${self:provider.stage}.ExecutionLogBucketName}
    events:
      - http:
          method: GET
          path: /execution/{key}
          cors: true
          private: true
          caching:
            enabled: true
            # cacheKeyParameters:
            #   - name: request.path.key

To Reproduce Steps to reproduce the behavior:

  1. Execute .\api\npm run deploy -- --region us-east-1

Expected behavior It would deploy

Screenshots

image

AWS (please complete the following information):

Additional context Add any other context about the problem here.