serverless-localstack icon indicating copy to clipboard operation
serverless-localstack copied to clipboard

ssm parameter not found, issue starts in version 0.4.20

Open Psynbiotik opened this issue 3 years ago • 1 comments
trafficstars

I have a config similar to this:

service: apps

provider:
  name: aws
  runtime: nodejs8.10
  stage: ${env:ENVIRONMENT}
  timeout: 300
  memorySize: 256
  versionFunctions: false
  region: ${env:AWS_REGION}
  environment:
    ENVIRONMENT: ${env:ENVIRONMENT}
    MY_URL:${ssm:/path/to/entry}

custom:
  localstack:
    host: http://localhost
    edgePort: 4566
    endpoints:
       SSM: http://localhost:4566
    stages:
      - local

functions:
  example:
    handler: functions/example/index.handler

plugins:
  - serverless-localstack

In version 0.4.19 it will resolve the ssm value correctly, in version 0.4.20 it will not. I think it is related to this ticket: https://github.com/localstack/serverless-localstack/issues/53

The error is like this: A valid SSM parameter to satisfy the declaration 'ssm:/path/to/entry' could not be found.

Psynbiotik avatar Jun 22 '22 04:06 Psynbiotik

Issue reproduced in my case as well and found this opened issue. I hope this gets attention soon.

evyros avatar Jul 28 '22 11:07 evyros

Same here, in my case it gets the secrets from AWS, not Localstack

LaurentGoderre avatar Mar 28 '23 16:03 LaurentGoderre

Hi @Psynbiotik, hi @evyros, hi @LaurentGoderre,

we recently discovered that the localstack-serverless plugin has issues resolving environment variables when using serverless v3 (it worked with v2 though). We could pin down the issue and provided a fix. Could you check if your issue is resolved when using the localstack-serverless plugin version 1.1.0? 🙏

steffyP avatar May 17 '23 07:05 steffyP

I have the same issue:

  • I have 2 stages defined: local and production.
  • Only local is added to custom.localstack.stages list.
  • In production I have some ssm parameters defined.

If I run sls wsgi --stage local, serverless-localstack is trying to resolve the production ssm parameters from LocalStack, so it fails.

membrive avatar May 22 '23 09:05 membrive

Sorry for the late reply, updating to 1.1.0 worked for me

LaurentGoderre avatar Jun 14 '23 16:06 LaurentGoderre

Hi @membrive,

can you confirm that you updated the serverless-localstack plugin to version 1.1.0 or greater? If you still encounter the issue, could you please create a new ticket, with a reproducible sample? 🙏

The original issue reported here seems to be resolved with the latest plugin version, we will close this ticket therefore.

steffyP avatar Jun 15 '23 11:06 steffyP