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
0
votes
1 answer

How to automatically put environment variable to all lambdas created in my CDK project

We implement almost all our lambda's in Chalice and then consume them in CDK project as described here. I need to add same environment variable to all lambda's in stack (different per developer). I would like to do it automatically, and not count…
0
votes
2 answers

chalice package: Could not install dependencies: graphqlclient==0.2.4

While running chalice package command I am getting this error: $ chalice package --stage preview .chalice/deployments/preview Creating deployment package. Could not install dependencies: graphqlclient==0.2.4 You will have to build these yourself…
Shaffan
  • 53
  • 10
0
votes
2 answers

Chalice on_s3_event trigger seems to not work

I have a Chalice app that reads config data from a file in an S3 bucket. The file can change from time to time, and I want the app to immediately use the updated values, so I am using the on_s3_event decorator to reload the config file. My code…
John Gordon
  • 29,573
  • 7
  • 33
  • 58
0
votes
1 answer

AWS chalice how to reduce lamda deployment size

I have managed to deploy one lambda function fine with chalice and the lambda function code was only like 15kb, I'm trying to do it again and this time it is over 8mb! I assume it is uploading my virtualenvironment too? How do I stop this happening…
imlearningcode
  • 381
  • 1
  • 7
  • 24
0
votes
1 answer

Lambda timeout value not changing after timeout key added to Chalice config.json

I want my AWS Lambda function to run for longer than the default 60 seconds so have added the timeout key to config.json { "version": "2.0", "app_name": "mychaliceapp", "stages": { "dev": { "api_gateway_stage": "api", …
nipy
  • 5,138
  • 5
  • 31
  • 72
0
votes
1 answer

"chalice deploy" call ends up with "Unknown parameter in input: "Layers""

I create the most basic chalice app from chalice import Chalice app = Chalice(app_name='testApp') @app.route('/') def index(): return {'hello': 'world'} with empty requirements.txt and config that looks like this: { "version": "2.0", …
0
votes
1 answer

How to have image and json returned from separate routes in same Chalice application?

I have this minimally complete, verifiable example Chalice application: from chalice import Chalice, Response from urllib.request import Request, urlopen from urllib.parse import unquote import io app =…
Alex R
  • 11,364
  • 15
  • 100
  • 180
0
votes
1 answer

Pony ORM - Resolve 'Expected string or bytes-like object' error

I'm currently developing an API for AWS with Chalice in Python that uses Pony ORM to handle our database. When trying to query with a select like this db.select(s.start_time for s in db.Session) I'm getting the 'Expected string or bytes-like object"…
Papoy Edits
  • 97
  • 1
  • 7
0
votes
1 answer

How do you modify/replace an S3 image using Python and the Chalice library?

I'm writing a lambda function that gets triggered everytime a user uploads an image to S3. The function's primary purpose is to compress the image, possibly renaming it in the process as well. To achieve this, the function is to fetch the newly…
Melvic Ybanez
  • 1,893
  • 4
  • 19
  • 26
0
votes
2 answers

How do you invoke a sagemaker xgboost endpoint from a chalice app?

I built a chalice web-app that is hosted in an s3 bucket and calls an xgboost endpoint. I keep getting an error when I invoke the model through the web-app. When I looked into the Lambda log files I discovered my input is not properly decoding.…
0
votes
1 answer

Adding Headers to AWS API Gateway Response using Chalice

My use-case requires my app to return CORS headers when error response is 401. This functionality was added by AWS last year (See this). It can be done using Cloudformation and Swagger template but I'm not sure if it's yet possible with Chalice.
0
votes
1 answer

Handling routes with Chalice

Chalice expects an app.py file with routes mapped to python function. Using chalice deploy deploys these functions as AWS lambda and creates the route mapping in API Gateway. I have to create a project with around 30 different route mappings. I…
Abhishek Jha
  • 935
  • 2
  • 10
  • 22
0
votes
1 answer

Reading S3 file content fails using Chalice Framework AWS

I am trying to read contents of S3 file that I wrote to earlier. When I read from the local boto3 script I can see the content of the file but when I run the code on Lambda using Chalice I get "NotFoundError" Here is the code for Chalice App from…
sanjiv soni
  • 77
  • 1
  • 7
0
votes
2 answers

AWS CORS Enabling - Where it needs to be enabled? Chalice? Dynamodb? or S3?

Trying my hands on with aws. I have done following. Created a dynamodb table. Created Chalice app to access the data through api. Created a Angular6 application to do CRUD operation on the table using above api. Everything worked fine when the…
just10minutes
  • 583
  • 10
  • 26
0
votes
1 answer

Limit return items on chalice and lambda service

I'm writing serverless apps in python and deploy use chalice, lambda, aws Just a quick question: I would like to limit the number of the item returned from the API. Maximum 1000 items per day Maximum 200 items per hour Here is sample…
Mazh N.
  • 1
  • 1