Where is the "Settings" pane of the API Gateway console??

0

I have an AWS Lambda that takes uploaded data and streams it to S3. The file size is always wrong for binary files and I believe I need to add a binary media type in the "Binary Media Types" section of something called the "Settings" pane of the API Gateway console, as suggested by https://repost.aws/knowledge-center/api-gateway-binary-data-lambda.

For two days I've been trying to find this thing. I have an API, but there's no "Settings" pane, "Binary Types" section or anything resembling these so I'm hopelessly lost. Has the console changed?

This is what I see when I go to the API Gateway, and what I see when I select my API:

API Gateway

My API

Any help appreciated,

David

5 Answers
2

Hi,

You can't find the "Settings" option because you are creating an HTTP API instead of a REST API and the UI is different for each of them.

API types

REST API

HTTP API

profile picture
EXPERT
answered 9 months ago
0

In your first screenshot, you need to click on the hyperlink of the API, and you will see the settings on the left pane, see sample below

Enter image description here

profile pictureAWS
AWS_TAM
answered 9 months ago
0

Thanks, that looks like exactly what I need.

However clicking the hyperlink of the API in the first image leads to the screen in the second image, which doesn't have the same left pane as you've got here, and the "API: api.nocodebots.... (iw4wquo5di)" link in orange is not clickable. The cursor changes to a hand if I hover over it but clicking does nothing, and right-clicking and "open in new tab" just leads to the first screen.

Chrome and Safari both have the same issue.

Could it be a different "kind" of API or something? More explicitly, my API is a Lambda custom integration that allows a client to interact via HTTP with a particular lambda via a custom domain. So this is an "inbound" call. Do I need some a second (different kind) of API to allow the lambda to post binary data to S3?

David

dmb0058
answered 9 months ago
0

Ahh thanks! That's what I was wondering when I said "... a different kind) of API ..." and you've explained it perfectly. Even though it was a somewhat stupid question n the first place I'll leave this all here in case it helps anyone with the same problem in the future.

It finally all makes sense.

David

dmb0058
answered 9 months ago
0

OK, thinking more about this, I'm not convinced that this is the problem anyway :)

The uploaded files are being received correctly by the lambda, and match byte-for-byte.

The problem is that the file **that the lambda sends to S3 is not the same **- it's much larger, as if a text encoding is being used, e.g. test.txt is 1205768 bytes on my laptop and 1205768 bytes are received by the lambda. However the test.txt file on the S3 bucket is 1904837 bytes long, and the difference appears to be that it's got many non-breaking spaces in it. Similarly mp3/mp4/xls files are all reported as corrupt when I try to open the S3 versions.

So the problem is NOT my client -> API Gateway -> lambda process, that's all fine. It's the lambda -> S3 leg that's screwing up. I'm not sure where to go from here.

EDIT: the problem was my code. I was streaming the received content converted using:

let content = Buffer.from(recvd_content, 'base64').toString('binary');

instead of the raw base64 encoded content.

I still don't knw where the API "Settings" are :D

David

dmb0058
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions