serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.67k stars 5.74k forks source link

Unable to access SSM Parameters in serverless3.38 , node: v20 #13028

Open vignesh-tpg opened 1 month ago

vignesh-tpg commented 1 month ago

Issue description

The SSM Parameters though accessible via AWS CLI were not accessible using serverless version 3.38.0. There are no issues with AWS Credentials and it was verified. Variables are referred like this in application - serverless.js.

custom: { SUBNETID1: '${ssm:/platform/vpc/default-network/subnet/private1/id}', SUBNETID2: '${ssm:/platform/vpc/default-network/subnet/private2/id}', }

Above usage led to this error Cannot resolve serverless.js: Variables resolution errored with:

Context

Image

czubocha commented 2 weeks ago

Hey @vignesh-tpg, the security token is invalid error usually means the credentials are expired or misconfigured. Please check the AWS profile specified in your Serverless config (e.g., provider.profile) or try running the command with --aws-profile to ensure the correct one is used.