Skip to content

Cannot use the extras lambda layer #290

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

Closed
FredrikMeyer opened this issue Feb 16, 2021 · 3 comments
Closed

Cannot use the extras lambda layer #290

FredrikMeyer opened this issue Feb 16, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@FredrikMeyer
Copy link

I'm trying to use the extras layer, but I get a error message:

[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'pydantic'

Expected Behavior

Be able to import the parser module without also installing pydantic.

Current Behavior

Pydantic is not included in the layer.

Steps to Reproduce (for bugs)

My SAM template:

  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./my_function
      Handler: main.handler
      Runtime: python3.8
      Layers:
        - !GetAtt AwsLambdaPowertoolsPythonLayer.Outputs.LayerVersionArn

  AwsLambdaPowertoolsPythonLayer:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-extras
        SemanticVersion: 1.10.3

Environment

Deployed via

sam build --use-container && sam deploy  --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND 

I've downloaded the layer to my machine and I double-checked that pydantic is not included.

@FredrikMeyer FredrikMeyer added bug Something isn't working triage Pending triage from maintainers labels Feb 16, 2021
@to-mc to-mc self-assigned this Feb 16, 2021
@to-mc
Copy link
Contributor

to-mc commented Feb 16, 2021

Thanks for the report @FredrikMeyer. I can confirm the published layer doesn't contain the correct dependencies. I've fixed an issue in our pipeline that I think was causing this, so future releases of powertools should get all the correct dependencies packaged with the layer. Looking into how/if we can fix this for already deployed layer versions.

@to-mc
Copy link
Contributor

to-mc commented Feb 17, 2021

I've made a new release (1.10.4) to trigger the fixed pipeline to publish a new layer version. The published versions are immutable so we can't replace those. Should work fine after updating SemanticVersion to 1.10.4.

@to-mc to-mc closed this as completed Feb 17, 2021
@FredrikMeyer
Copy link
Author

Thank you for the quick answer and solution! I've just confirmed that the new release works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants