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

Support for cross-stack resource access

Open abhinavagrahari opened this issue 2 years ago • 4 comments

Is there any updates or walkaround for https://github.com/dherault/serverless-offline/issues/388

abhinavagrahari avatar Mar 29 '22 11:03 abhinavagrahari

I'm getting same issue. offline: Failure: 1 validation error detected: Value '[object Object]' at 'tableName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.-]+ ValidationException: 1 validation error detected: Value '[object Object]' at 'tableName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.-] when trying to access exported table

adityarai avatar Apr 06 '22 16:04 adityarai

Having a similar issue:

` provider: name: aws runtime: nodejs16.x environment: USER_POOL_ID: !Ref CognitoUserPool CLIENT_ID: !Ref CognitoUserPoolClient REGION: us-east-1

`

Lambda Environments variables are populated correctly online but locally I get the following error:

{"message":"2 validation errors detected: Value '[object Object]' at 'clientId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\w+]+; Value '[object Object]' at 'userPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\w-]+_[0-9a-zA-Z]+","code":"InvalidParameterException","time":"2022-06-28T04:15:14.130Z","requestId":"41101f25-e629-4f65-b3b0-79bf462a6205","statusCode":400,"retryable":false,"retryDelay":65.88270859004197}

Noticed online its working correctly but only locally, dumping my environment variables in the console shows me this:

NODE_PATH: '/var/runtime:/var/task:/var/runtime/node_modules', USER_POOL_ID: '[object Object]', CLIENT_ID: '[object Object]', REGION: 'us-east-1', _HANDLER: 'api/auth/login.post'

USER_POOL_ID and CLIENT_ID are being pulled in as objects but in the lamdba they are strings (correct credentials).

Any suggestions to fix this?

sukh-gill avatar Jun 28 '22 04:06 sukh-gill

Something similar to https://github.com/serverless/serverless/blob/main/lib/plugins/aws/invoke-local/index.js#L170-L198 needs to be implemented at https://github.com/dherault/serverless-offline/blob/master/src/lambda/handler-runner/HandlerRunner.js.

SerheyDolgushev avatar Jun 28 '22 10:06 SerheyDolgushev

could someone point to the applicable documentation?

dnalborczyk avatar Jun 30 '22 01:06 dnalborczyk