question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SAM Build support for Provided runtime

See original GitHub issue

Describe your idea/feature/enhancement

I am trying to use NodeSource’s N|Solid Lambda Layer with SAM. This is a replacement for Node.js and therefore uses the provided runtime. Everything else with my function is identical to the Node.js runtime. I have a package.json that included dependencies for my application.

When running sam build I get the follow error:

$ sam build
2019-04-04 13:26:52 Found credentials in shared credentials file: ~/.aws/credentials
2019-04-04 13:26:52 Building resource 'Function'
Build Failed
Error: 'provided' runtime is not supported

I can’t use SAM to build and deploy my Node.js functions when they use a provided runtime.

I would like sam build to support the provided runtime.

Proposal

Obviously, the provided runtime is a little tricky for building because the runtime could be anything and there’s no way to know from the template.yaml file.

My proposal would be to add an optional flag to the sam build command called --builder. With this flag you could tell sam build which builder to use regardless of runtime. This way we can still use the provided runtime, but still use sam build to package our Node.js applications.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gkrizekcommented, Jun 12, 2019

I just did a quick test on a local build of the CLI and this seems to work as expected. Might be worth adding some additional logging to let the user know it’s auto selected.

1reaction
sanathkrcommented, Apr 5, 2019

@gkrizek This is a great usecase for .samrc(#975) - basically a config file that changes the default behavior for SAM CLI. I like the rc file over command line arguments because you can setup how SAM CLI behaves (in this case “sam build”) one time, check into your repository, and be reused across your team without learning a new flag and typing it every time.

Thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

sam build - AWS Serverless Application Model
The sam build command processes your AWS SAM template file, application code, and any applicable language-specific files and dependencies. The command also ...
Read more >
SAM Build support for Provided runtime · Issue #1099
Describe your idea/feature/enhancement I am trying to use NodeSource's N|Solid Lambda Layer with SAM. This is a replacement for Node.js and ...
Read more >
Building custom runtimes - Amazon Serverless Application ...
You can use the sam build command to build custom runtimes required for your Lambda function. You declare your Lambda function to use...
Read more >
Amazon Lambda
Create the function. The target/manage.sh script is for managing your lambda using the AWS Lambda Java runtime. This script is provided only ...
Read more >
Writing Lambda functions in Node.js runtime and deploy ...
If your SAM template was valid, then it will create all the necessary resources defined in the template.yml file and deploy your application...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found