Serverless: TypeError: Cannot read property 'outputs' of undefined

1.1k views Asked by At

service: testnewman
# app and org for use with dashboard.serverless.com
#app: your-app-name
#org: your-org-name

plugins:
  - serverless-bundle
  - serverless-pseudo-parameters
  - serverless-plugin-stack-config
  - serverless-plugin-newman
  - serverless-shell

# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
frameworkVersion: '2'

provider:
  name: aws
  runtime: nodejs12.x
  stage: ${opt:stage, 'simi33'}
  region: ${opt:region, 'us-west-2'}
  profile: ${opt:profile, 'sandbox'}


functions:
  hello:
    handler: handler.hello

custom:
  collection:
    file: test/postman_collection.json
  environment:
    file: test/deploy.postman_environment.json
    values:
      - key: endpoint
        enabled: true
        value: ServiceEndpoint
        type: OUTPUTS

This is what my serverless.yml file looks like. The lambda function gets created fine.

When I run the command:

serverless outputs --stage simi33 --region us-west-2 --profile sandbox

It says:

Serverless: Running "serverless" installed locally (in service node_modules)
Serverless: Retrieving Outputs...
Serverless: getValues.error: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
Serverless: TypeError: Cannot read property 'outputs' of undefined

This isn't a permissions issue. I am otherwise able to deploy the application if not using stack-config plugin.

If I run sls deploy -v command, This is what I get:


Stack Outputs
HelloLambdaFunctionQualifiedArn: arn:aws:lambda:us-west-2:102483920364:function:testnewman-simi33-hello:1
ServerlessDeploymentBucketName: testnewman-simi33-serverlessdeploymentbucket-1u4ci9eebg2es

Serverless: Retrieving Outputs...
Serverless: Calling CloudFormation...
Serverless: getValues.error: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
Serverless: Writing Outputs...
Serverless: TypeError: Cannot read property 'outputs' of undefined

My profile sandbox is configured to "assume" a role and that works fine everywhere else. With stack config, if I use a profile that does not have to assume a role, it works okay. How can I fix this? How can I use this with a profile that assumes a role?

How can I fix this? sandbox profile is configured as follows:

[vln-iam]
aws_access_key_id = ABCDEFGHIJKL
aws_secret_access_key = thkjgfthcghvjbjhfxhgchvmcf


[sandbox]
role_arn = arn:aws:iam::123456789:role/Admin
source_profile = vln-iam
region = us-west-2
mfa_serial = arn:aws:iam::987654321:mfa/sikau
0

There are 0 answers