aws-sam-cli: Utilizing the "Globals" section of SAM is not respected

I am utilizing the Globals section of SAM. This is a great feature to help reduce copy-pasting in all of the Functions. However, sam-local does not appear to be respecting the runtime supplied in this section.

The Globals section of template.yml

Globals:
  Function:
    runtime: python3.6

And when I run sam local start-api, I receive errors like this for all of my endpoints:

2017/12/09 15:29:01 Ignoring FunctionName (functionPath) due to unsupported runtime ()
ERROR: None of the Serverless functions in your SAM template were able to be mounted. See above for errors.

I would be happy to make a pull request if this is a feature that would be welcomed, and if I could get some initial guidance on the internals of sam-local to know where this would fit best.

Based on a quick search of the source, I think we would have to look for Globals and pass the runtime into https://github.com/awslabs/aws-sam-local/blob/develop/start.go#L78 when building the Functions.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 24
  • Comments: 16 (2 by maintainers)

Most upvoted comments

+1 to Globals

+1 to Globals and nodejs6.10