Skip to content

Handler for python Zip package #90

@CGarces

Description

@CGarces

Hi!

I'm trying to adapt the python sample based on docker to a Zip package.

My yaml template looks very similar to the Docker sample but fails due Handler: run.sh

I have tried with this as run.sh

#!/bin/bash
gunicorn -b=:8080 -w=1 app:app

But give me he following errors

/var/task/run.sh: line 2: gunicorn: command not found

gunicorn is inside the requeriments.txt file

The yaml template looks like this:

Resources:
  FlaskFunction:
    Type: AWS::Serverless::Function
    Properties:
      MemorySize: 128
      CodeUri: app/
      Handler: run.sh
      Runtime: python3.9
      Events:
        Root:
          Type: HttpApi
          Properties:
            Path: /
            Method: ANY
        Proxy:
          Type: HttpApi
          Properties:
            Path: /{proxy+}
            Method: ANY
      Environment:
        Variables:
          AWS_LAMBDA_EXEC_WRAPPER: /opt/bootstrap
      Layers:
        - !Sub arn:aws:lambda:${AWS::Region}:753240598075:layer:LambdaAdapterLayerX86:6

Any clue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions