AWS Certified Developer – Associate — Question 1
A static website is hosted in an Amazon S3 bucket. Several HTML pages on the site use JavaScript to download images from another Amazon S3 bucket. These images are not displayed when users browse the site.
What is the possible cause for the issue?
Answer options
- A. The referenced Amazon S3 bucket is in another region.
- B. The images must be stored in the same Amazon S3 bucket.
- C. Port 80 must be opened on the security group in which the Amazon S3 bucket is located.
- D. Cross Origin Resource Sharing must be enabled on the Amazon S3 bucket.
Correct answer: D
Explanation
The correct answer is D because Cross Origin Resource Sharing (CORS) allows resources to be requested from another domain, which is necessary in this case since the images are being fetched from a different S3 bucket. Option A is incorrect as buckets in different regions can still be accessed, option B is wrong because images can be hosted in different buckets, and option C is not relevant since S3 does not use traditional security groups like EC2.