Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

356
Views
Returning a default value using AWS API Gateway

I need to provide some sort of REST API backed by a S3 bucket. The requirement is simple: given a certain key, it should return the contents of the file whose name is that key. If no such file is found in the bucket, then return a default content. In both cases, the response status code should be 200, because the client should not care where the result came from.

This requirement is so simple that I was trying to accomplish this without writing any code. So I tried to put an API created by Amazon API Gateway in front of the S3 bucket. But even though in the "Integration Response" section you can map a "HTTP status regex" to a "Method response status", apparently the same "Method response status" can't appear twice. So, I cannot have a default mapping to 200 while mapping 404 responses also to 200 with a custom body mapping template.

Is it possible to do this using only API Gateway?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If the only thing limiting you is number of available responses you can use 203 (forwarding content from the origin) as another successful response. Or you can write a simple lambda function behind your API Gateway to craft the response.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!