aws / aws/chalice

Proxy Forwarding with 1 resource and route inside Chalice

Open
#1,959 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Dear chalice,

I was wondering if it's possible to have only one resource in the API GATEWAY using {proxy+} integration and route the traffic inside chalice.

The point is not to create each time a new resource for each endpoint (new infrastructure to deploy). I wan't to manage the routes inside my chalice application.

When I try to route using:

```python
@app.route('/a', methods=["GET"])
def a():
return {
'statusCode': 200,
'body': json.dumps('Hello a!')
}
```

The response recieved is:
```
{
"Code": "MethodNotAllowedError",
"Message": "Unsupported method: GET"
}
```

----

When accessing the index it works:

```python
@app.route('/')
def index():
return {
'statusCode': 200,
'body': json.dumps('Hola chalice!')
}

```

Response:

```
{
"statusCode": 200,
"body": "\"Hola chalice!\""
}

```

The proxy configuration that I would like to use:
![image](https://user-images.githubusercontent.com/52964120/185458028-2bed8c9d-92e6-4222-98a6-f77b27ebdf85.png)

Thanks a lot!!!!

Contributor guide

Open the contributing guide

Research direction

Start with the @app.route('/a') and @app.route('/') entry points and compare their behavior with the shown API Gateway {proxy+} configuration. Reproduce the GET /a request and the working index request, then determine the configuration or routing change needed for both routes to work through one proxy resource.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
api, backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.