4

I have defined a lambda layer in my Sam template, however Im having this issue. I havent found any related article that has this kind of error.

2019-09-01 16:10:14 Invoking app.lambda_handler (python3.7)
2019-09-01 16:10:14 Found credentials in shared credentials file: ~/.aws/credentials
2019-09-01 16:10:14 MyLambdaLayer is a local Layer in the template
2019-09-01 16:10:14 Image was not found.
2019-09-01 16:10:14 Building image...
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/0.19.0/libexec/lib/python3.7/site-packages/dockerpycreds/store.py", line 80, in _execute
    [self.exe, subcmd], input=data_input, env=env,
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-osxkeychain', 'list']' returned non-zero exit status 1.

My template yaml is setup like this:

MyLambdaFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: function/
      Handler: app.lambda_handler
      Runtime: python3.7
      Layers:
        - !Ref MyLambdaLayer
      Policies: 
      - AmazonDynamoDBFullAccess

  MyLambdaLayer:
    Type: AWS::Serverless::LayerVersion
    Properties:
        LayerName: app-dependencies
        ContentUri: dependencies/python.zip
        CompatibleRuntimes:
          -  python3.7
        RetentionPolicy: Retain

Outputs:
  LayerArn:
    Value: !Ref MyLambdaLayer
    Export:
      Name: app-dependencies-arn

Perhaps im missing settings on my docker? Any ideas is appreciated

XDProgrammer
  • 853
  • 2
  • 14
  • 31

0 Answers0