Cannot get Secret Manager param value using ssm:/aws/reference/secretsmanager/

I am trying to access secret managers using Serverless secrets framework this way:

Approach1 (Old)
supersecret: ${ssm(us-east-1, raw):/aws/reference/secretsmanager/secret-name~true}

Approach2 (New)
variablesResolutionMode: 20210326 in serverless.yaml
supersecret: ${ssm(us-east-1, raw):/aws/reference/secretsmanager/secret-name}

Approach1 works fine, but I get the below error with Approach2 on serverless deploy-

Cannot resolve serverless.yml: Variables resolution errored with:
  - Cannot resolve variable at "custom.lambdas.test.custom.supersecret": An error occurred while calling one AWS dependency service.

Serverless version - Framework Core: 2.69.1 (local) Plugin: 5.5.1 SDK: 4.3.0 Components: 3.18.1

The secrets are not replicated and only exist in us-east-1. What could I be missing here?

1 Like

Did you ever resolve this? Just updated from old v2 version to v3 and am getting the same issue

Almost always when I get it, it’s because my AWS profile (–aws-profile) has no access.