2
votes

I have a usecase in which, there will be a website hosted on an AWS S3 bucket,
This S3 Website will be calling APIs to fetch data to be rendered on.

In case of an AWS serveless architecture, we usually have an API Gateway in front of AWS Lambda functions to do the processing and returning required data.

AWS Last year launched API Gateway Private Endpoints - https://aws.amazon.com/blogs/compute/introducing-amazon-api-gateway-private-endpoints/

The private API Gateway will be accessible through VPC endpoint,
I wanted to know if a private API Gateway endpoint be used by the S3 Bucket to access data internally,
Or the S3 being outside VPC will require require a Public facing API Gateway endpoint?

1

1 Answers

7
votes

No.

Any calls to an API will be made from the end-user's browser, based on HTML pages served from Amazon S3.

When the API is called, the request will come from the browser, across the Internet, to the nominated endpoint (typically API Gateway).

A private API Gateway Endpoint, on the other hand, is created within a VPC and is accessible to resources that are running in the VPC (such as Amazon EC2 instances). This is different to the situation you describe, where the API is called from a web page.

The important thing to remember is that Amazon S3 is a storage service that can also serve web pages, but no code runs on Amazon S3. This is different to a traditional web server that can run code "on the server". Amazon S3 simply serves static content.