You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Environment variable must contain string error when pulling from Secrets Manager #5869
Environment variable EncoderProfiles must contain string
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: linux
Node Version: 11.2.0
Serverless Version: 1.38.0
Environment variable EncoderProfiles must contain string
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: linux
Node Version: 11.2.0
Serverless Version: 1.38.0
Provider Error messages:
Environment variable EncoderProfiles must contain string
Is the secret your referencing actually a string or is it a JSON blob? The AWS console pushes you to using JSON blobs (the key/value UI creates JSON & DB secrets are also JSON blobs)
if it's the later, you'll need to do something like this:
I tried to reference a variable the way you mentioned ${self:custom.variables.THE_NAME_OF_THE_FIELD_IN_THE_JSON_YOU_WANT}, but it wasn't working, so I printed and got this:
This shows that the response from AWS is in fact a string and not a JSON blob. In my case I was a expecting a JSON since I have multiple variables in the secret manager.
Activity
dschep commentedon Feb 27, 2019
Is the secret your referencing actually a string or is it a JSON blob? The AWS console pushes you to using JSON blobs (the key/value UI creates JSON & DB secrets are also JSON blobs)
if it's the later, you'll need to do something like this:
To check what
SomeEnvVaris being set to, runsls printagbanil commentedon Mar 11, 2019
Hello @dschep,
I'm having this same issue. I made a call to the secret manager like this:
I tried to reference a variable the way you mentioned
${self:custom.variables.THE_NAME_OF_THE_FIELD_IN_THE_JSON_YOU_WANT}, but it wasn't working, so I printed and got this:This shows that the response from AWS is in fact a string and not a JSON blob. In my case I was a expecting a JSON since I have multiple variables in the secret manager.
mesaugat commentedon Mar 12, 2019
Reverting back to
v1.37.0worked for me. I was getting the same error after upgrading tov1.38.0.gudata commentedon Jul 14, 2019
in v1.47.0
it works.
But! if i use
instead of
Then I get the json as string, which is expected because the prefix should be /aws and not aws
medikoo commentedon Apr 12, 2021
Closing, as with new variables resolver it can be solved by passing
rawoption to variable config, as: