PyCharm: The project at ... uses a non-standard layout and cannot be attached to this project

I have the latest version of PyCharm installed (2017.1). Everything works well except when I try to open two projects in the same window. I get this popup after hitting OK in the Open Project...

Handling AWS Lambda errors with API Gateway

I have class BadRequest(Exception): pass in my Lambda function. I'd like to raise BadRequest("Invalid request params") and have the API return a response with status code 400 and body { "message":...

Unable to use pyodbc with aws lambda and API Gateway

I am trying to build a AWS Lambda function using APi Gateway which utlizes pyodbc python package. I have followed the steps as mentioned in the documentation. I keep getting the following error...

set timeout for chalice functions in general

In the documentation of chalice one can see an example of a configuration of a lambda function on aws provisioned by chalice. The idea is that you can define an app like below: from chalice import...

How to access the raw query string (or full URL) in a Chalice (AWS Lambda/API Gateway) app?

I'm using Chalice to build a fairly straightforward API on AWS Lambda & API Gateway. I need a way to get access to the raw query string (i.e foo=bar&abc=123). When accessing the...

Why is AWS's Chalice for Python not respecting my virtualenv?

I'm attempting to deploy a chalice application following the tutorial. I'm using a virtualenv with python3.6. My application is dependent on a github repo in the requirements.txt and that repo's...

trying to forward request with chalice

im trying to build a simple api+lambda with chalice which can receive a POST request and then forward it to another API while adding some authentication. when i run my chalice code locally i can...

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...

How to process DynamoDB stream events with Chalice

I am writing a project where I need to process DynamoDB table inserts and updates in Chalice. I see in Chalice events processing for SNS, SQS, scheduler but not for DynamoDB table. Currently it is...

What is the chalice @app.schedule syntax for cron events?

I am trying to follow the documentation from https://chalice.readthedocs.io/en/latest/topics/events.html I tried this @app.schedule('0 0 * * ? *') def dataRefresh(event): ...

Boto3 InvalidAccessKeyId in generate_presigned_post

I'm creating an AWS Lambda and API using Python's Chalice library. My AWS Credentials are injected using github workflow aws-actions and its able to chalice deploy. The endpoints are working and...

Unable to fetch file from Amazon S3 with an API

I am trying to fetch a file from an Amazon S3 bucket. I have written the code using Chalice microservice of aws. I am unable to understand how to solve this. As I am very new to aws and as per my...

Pip install on windows is giving can not combine '--user' and '--target'

I am trying to run below commands but it's not working on my windows machine. C:\Users\XXX\Desktop\python-7>pip install chalice -t . ERROR: Can not combine '--user' and...

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',...

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: #...

Discord bot random reply

I am currently working on a discord bot with a simple mini game. You write "gamestart" and the bot sends you 1 of 4 possible replies. But my bot isn't sending anything. What the problem could...

Any framework or tool is available to achieve swagger definition as the auto generation process for AWS Chalice?

I'm using AWS chalice for API development and deployed. Currently, I'm about to implement swagger definition for my API's and I don't want to do the swagger definition creation process as the...

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...

Can you set a field to not_analyzed in an auto created index in Elasticsearch?

As part of our AWS infrastructure, I am using an Elasticsearch (7.4) index. We use Terraform to create the domain in AWS Elasticsearch but we don't create the index explicitly. Instead when the...

Angular 8, IE11, ngx-image-cropper bugged, ERROR TypeError: Object doesn't support this action

I'm using Angular 8, ngx-image-cropper: "^2.0.2". I have a problem in ie11 with cropper. It is working perfectly in chrome but in ie11 when I upload an image it starts bugging component with...

Terraform invalid arn for aws provider

I'm using AWS Chalice to configure my app, and packaging this to terraform config so that I can combine with the terraform config responsible for the creation of backing services (s3 buckets,...

AWS IAM Policy required for AWS Chalice

What is the IAM role policy required AWS Chalice. There is no official documentation in Github? What are the permissions are required to run AWS Chalice?

Enabling SOFTWARE_TOKEN_MFA through Python Boto3 for a cognito user

I need to enable MFA for Cognito users as per their requirements. I tried SMS MFA & it worked perfectly, but when it comes to Software MFA (SOFTWARE_TOKEN_MFA) i couldn't find any proper documents...

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...

AWS Lambda Chalice Layers Segmentation Fault

I am deploying a Python 3.7 Lambda function via Chalice. Because the code with its environment requirements, is larger than 50 MB limit, I am using the "automatic_layer" feature of Chalice to...

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...

"Endpoint request timed out" with chalice deploy

This code works fine when deployed with 'chalice local' but when I deploy it with 'chalice deploy' and send a post request to the endpoint I am greeted with a status: 504 gateway timeout and...

How to securely set env variable for an AWS Chalice application on CI/CD?

AWS Chalice has a .chalice/config.json where env variables can be set e.g. { "version": "2.0", "app_name": "my-app", "stages": { "dev": { "environment_variables": { ...

How to deploy by stage with Chalice using CDK

I can't find any examples of how to deploy by stages (environments) when deploying a Chalice app with CDK, as spelled out here? https://aws.github.io/chalice/tutorials/cdk.html I found...

AWS chalice local works but not chalice deploy

I am pretty new to coding and aws chalice. I tried writing a code that gets messages from trading-view and executes orders depending on the signals. I tested the code locally and everything...