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

Support for the docker lambda runtime #1828

Closed
RyanJarv opened this issue Dec 7, 2020 · 4 comments · Fixed by #2236
Closed

Support for the docker lambda runtime #1828

RyanJarv opened this issue Dec 7, 2020 · 4 comments · Fixed by #2236
Labels
spec CloudFormation Specification Bug

Comments

@RyanJarv
Copy link

RyanJarv commented Dec 7, 2020

cfn-lint 0.43.0

This is a feature request for supporting docker lambda sam templates.

Please provide as much information as possible:

  • SAM templates produced by aws-sam-cli with the docker deploy option don't pass validation

Running on the template.yaml in the base directory outputs the following:

% cfn-lint template.yaml                  
E0001 Error transforming template: Resource with id [HelloWorldFunction] is invalid. 'ImageUri' must be set.
template.yaml:1:1

Running on the packaged template at .aws-sam/build/template.yaml produces the following:

E3002 Invalid Property Resources/HelloWorldFunction/Properties/Code/ImageUri
.aws-sam/build/template.yaml:12:3

E3002 Invalid Property Resources/HelloWorldFunction/Properties/PackageType
.aws-sam/build/template.yaml:12:3

E3003 Property Handler missing at Resources/HelloWorldFunction/Properties
.aws-sam/build/template.yaml:12:3

E3003 Property Runtime missing at Resources/HelloWorldFunction/Properties
.aws-sam/build/template.yaml:12:3

@PatMyron
Copy link
Contributor

PatMyron commented Dec 7, 2020

could you include your template?

The second half likely involves #1219 since no Resource Specfications have been released for weeks

The first half may be fixed by upgrading SAM:
pip3 install aws-sam-translator --upgrade

@PatMyron PatMyron added the spec CloudFormation Specification Bug label Dec 16, 2020
@PatMyron
Copy link
Contributor

fixes for the second half just merged in yesterday, so the second half will be fixed in the next release

@kddejong
Copy link
Contributor

This template is working with the newest version of the sam translator. If you leave that value out you will get the error that you have specified but that error is coming from https://github.com/aws/serverless-application-model if you believe it shouldn't exist we may need to create an issue there.

Transform: AWS::Serverless-2016-10-31
Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      PackageType: Image
      ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest
      ImageConfig:
        Command:
          - "app.lambda_handler"
        EntryPoint:
          - "entrypoint1"
        WorkingDirectory: "workDir"

v0.44.2 is out and includes the 2nd half fixes that @PatMyron mentioned.

@dquam
Copy link

dquam commented Mar 18, 2022

@kddejong - I think this needs to be re-opened. The original issue is still present. It was fixed in sam validate here. From that fix, here is a test that will fail cfn-lint.

The problem is that cfn-lint passes the template as-is to the transalator, but sam will deploy an image to ECR then add an ImageUri before translating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec CloudFormation Specification Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants