Questions tagged [chalice]

Chalice is a microframework for writing serverless apps in python. It allows you to quickly create and deploy applications that use AWS Lambda.

Chalice is a Python Serverless Microframework for AWS (Amazon Web Services). Chalice is maintained by AWS, the code is available on GitHub at https://github.com/aws/chalice.

Chalice allows to quickly create and deploy applications that use Amazon API Gateway and AWS Lambda. It provides:

  • A command line tool for creating, deploying, and managing your app
  • A familiar and easy to use API for declaring views in python code
  • Automatic IAM policy generation
153 questions
1
vote
1 answer

How to capture request id inside a lambda function in a chalice app

I am having a chalice app which exposes some urls backed by api gateway and lambda function. What I want is to log the request id with each and every log msg for debugging purposes. Below is how my code looks like. @app.route('/instrument',…
Naxi
  • 1,504
  • 5
  • 33
  • 72
1
vote
1 answer

CORS issues when calling AWS secrets manager from Lambda function

I have an API written in python/chalice deployed as a Lambda which gets called from a web app. I thought I had the usual CORS issues fixed, at least, things are working with no problems and have done for a while. Being a good boy I decided it was…
plet
  • 43
  • 6
1
vote
0 answers

How To Connect to an already created Chalice Project and AWS Lambda Environment

Beginner Chalice question here! I would like to connect to and modify a chalice project created by a team member that includes multiple lambda functions. I have already setup my AWS environment to connect to the same account, have git cloned the…
whs2k
  • 741
  • 2
  • 10
  • 19
1
vote
1 answer

Unable to import module 'app': No module named 'app' in Aws Lambda using Chalice

I am having below lambda function which uses Chalice. from chalice import Chalice from chalicelib import lookup_helper import os try: from urllib import unquote except ImportError: from urllib.parse import unquote app =…
Naxi
  • 1,504
  • 5
  • 33
  • 72
1
vote
1 answer

getting `GLIBC_2.18' not found error in aws api gateway

I am writing an Api in aws chalice. My code is working good in local. But I am getting the following respnse: { "message": "Internal server error" } My requirements.txt file contains: web3==5.12.1 pycryptodome==3.9.8 On checking in aws api…
Darth Vader
  • 881
  • 2
  • 7
  • 24
1
vote
1 answer

AWS Chalice with Dropbox API timeout

I have been unable to get dropbox python api to work with AWS Chalice. Whenever I have an import dropbox statement in app.py or anywhere else in the application, the command works in chalice local for localhost deployments, but timeout when I deploy…
darkvalance
  • 390
  • 4
  • 14
1
vote
1 answer

Why is my Lambda API via Chalice giving an internal server error instead of a datetime value?

The API result at /date is giving an {"message": "Internal server error"} error. /hello is successfully returning 'hello world'. The ultimate goal is to return the number of days passed so far this year. ''' from chalice import Chalice from…
1
vote
1 answer

How to directly invoke a Chalice Lambda from another Lambda without going through the API Gateway and Authorizer again?

I have 2 Lambdas using Chalice behind an API Gateway. All endpoints are protected by a Cognito authorizer. When I call GET /hello, I want the first Lambda to fetch data from the second Lambda: # Lambda1 @app.route('/hello') def say_hello(): name…
cahen
  • 15,807
  • 13
  • 47
  • 78
1
vote
1 answer

How to print complete http request using chalice?

I have a small application where I am using chalice to expose some endpoints. For logging purpose I want to print the entire url whenever any handler function is called. @app.route('/XYZ', methods=['GET']) @logging_and_error_handling() def…
Naxi
  • 1,504
  • 5
  • 33
  • 72
1
vote
1 answer

Resizing images uploaded to s3 using pillow

I have a chalice application that has a defined lambda_handler that will be triggered using s3 event notifications. Every time an image is created in my s3 bucket, the lambda_handler function will be invoked to create thumbnails. But when you upload…
1
vote
1 answer

AWS Chalice - CI/CD - Deploy under the same gateway

When we use chalice deploy for a component which is to be available as REST endpoint, Chalice creates the Lambda and API on AWS infrastructure. Every chalice project creates a new API with a unique id. I want to be able deploy multiple chalice…
1
vote
1 answer

How to schedule ec2 instance stop using chalice and lamda

I am scheduling ec2 instance shutdown everyday at 8 PM using chalice and lambda function. I have configured the chalice but not able to trigger or integrate python script using chalice import boto3 #creating session to connect to aws #defining…
monica
  • 11
  • 3
1
vote
1 answer

Call a specific route in a lambda function written using Chalice

I'm new to Chalice and I'm trying to call an aws lambda using boto3 in a python script. I need to know how to call a specific 'route' in that lambda. Maybe set client context or something in the event? The python script can call a lambda function…
Pete
  • 169
  • 2
  • 14
1
vote
1 answer

Set-Cookie is not been set (local DEV environment)

This is yet another question about set-cookie on localhost. I am facing the same problem as many others here when it comes to the usage of cookies on localhost. This is my setup: I am running a reactjs app locally on a url like…
dm88
  • 382
  • 2
  • 13
1
vote
2 answers

Chalice Framework: Request did not specify an Accept header with image/jpeg

I want to return an image from a Chalice/python application. My entire application code is pasted below: from chalice import Chalice, Response import base64 app = Chalice(app_name='hello') @app.route('/makeImage', methods=['GET']) def…
Alex R
  • 11,364
  • 15
  • 100
  • 180