Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda Ruby Runtime doesn't Support ZipFile #6302

Closed
skorfmann opened this issue Feb 16, 2020 · 1 comment · Fixed by #6365
Closed

Lambda Ruby Runtime doesn't Support ZipFile #6302

skorfmann opened this issue Feb 16, 2020 · 1 comment · Fixed by #6365
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. p2

Comments

@skorfmann
Copy link
Contributor

This implies that the Lambda Ruby runtime supports ZipFile (aka inline code).

public static readonly RUBY_2_5 = new Runtime('ruby2.5', RuntimeFamily.RUBY, { supportsInlineCode: true });

However, when deploying a function like this

new lambda.Function(stack, 'foobar', {
  code: new lambda.InlineCode('def handler(event:, context:) ; "success" ; end'),
  handler: 'index.handler',
  timeout: cdk.Duration.seconds(15),
  runtime: lambda.Runtime.RUBY_2_5
});

I get the following error from CloudFormation

 19/52 | 9:14:58 PM | CREATE_FAILED        | AWS::Lambda::Function            | foobar (foobarF27D68A9) ZipFile can only be used when Runtime is set to either of nodejs8.10, nodejs10.x, nodejs12.x, python2.7, python3.6, python3.7.

The docs are also mentioning just nodejs and python

Environment

  • CLI Version 1.22.0 (build 309ac1b)

This is 🐛 Bug Report

@skorfmann skorfmann added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 16, 2020
@SomayaB SomayaB added the @aws-cdk/aws-lambda Related to AWS Lambda label Feb 17, 2020
@nija-at
Copy link
Contributor

nija-at commented Feb 19, 2020

Ack, supports inlineCode needs to be unset for Ruby.

@nija-at nija-at added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2020
@mergify mergify bot closed this as completed in #6365 Feb 20, 2020
mergify bot pushed a commit that referenced this issue Feb 20, 2020
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile

fixes #6302



----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

<!-- 
Please read the contribution guidelines and follow the pull-request checklist:
https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md
 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants