Not sure where this question is from ? Is it an official one ?
Example
In either way, check out this image
https://imgur.com/a/IYsv7Hq
Imagine you have a mobile app running on a phone … its loading a serverless app from an S3 bucket (the top one) - this is the ORIGIN
SAME origin is always allowed … so things can be loaded from that bucket, without any special configuration
Cross origin by default is blocked, meaning if the serverless app is accessing the middle bucket, or the API gateway at the bottom … it would be denied.
A CORS configuration needs to be added to the middle bucket and to the API gateway … allowing other origins to access them. Its the resources being access which needs CORS.
I don’t think that answer is right that you pasted.
CORS config goes on a resource, it defines what ORIGINS can access it.
In the example you posted, the S3 bucket is the origin … so the cors configuration would go on the API gateway for example.
There are situations where CORS would be required for same bucket access, for example (credit to AWS doco) Using cross-origin resource sharing (CORS) - Amazon Simple Storage Service
if you had an S3 website …
http://website.s3-website.us-east-1.amazonaws.com
Running a serverless app, so hosting JS, which loaded in your browser, and then wanted to access that same bucket via the API endpoint (website.s3.us-east-1.amazonaws.com ) NOT the static website endpoint you would need CORS as they are different
What you would essentially be doing, is adding CORS on the bucket endpoint ( website.s3.us-east-1.amazonaws.com ) to allow requests from the static website hosting ORIGIN (http://website.s3-website.us-east-1.amazonaws.com)
This is a pretty … niche use case. Generally, you define CORS on the remote resource that your thing is calling. So if an S3 bucket stores JS, which runs in your browser and calls API gateway, then it’s API gateway which needs the CORS config.