nerdexam
Amazon

SCS-C02 · Question #313

l .amazonaws.com. You have some web pages that use Javascript that access resources in another bucket which has web site hosting also enabled. But when users access the web pages , they are getting a

The correct answer is A. Enable CORS for the bucket. Use-case Scenarios The following are example scenarios for using CORS: Scenario 1: Suppose that you are hosting a website in an Amazon S3 bucket named website as website.s3-website-us-east-1 .amazonaws.com. Now you want to use JavaScript on the webpages that are stored in this bu

Submitted by fatima_kr· Mar 6, 2026Infrastructure Security

Question

l .amazonaws.com. You have some web pages that use Javascript that access resources in another bucket which has web site hosting also enabled. But when users access the web pages , they are getting a blocked Javascript error. How can you rectify this?

Options

  • AEnable CORS for the bucket
  • BEnable versioning for the bucket
  • CEnable MFA for the bucket
  • DEnable CRR for the bucket

How the community answered

(30 responses)
  • A
    80% (24)
  • B
    13% (4)
  • C
    3% (1)
  • D
    3% (1)

Explanation

Use-case Scenarios The following are example scenarios for using CORS: Scenario 1: Suppose that you are hosting a website in an Amazon S3 bucket named website as website.s3-website-us-east-1 .amazonaws.com. Now you want to use JavaScript on the webpages that are stored in this bucket to be able to make authenticated GET and PUT requests against the same bucket by using the Amazon S3 API endpoint for the bucket website.s3.amazonaws.com. A browser would normally block JavaScript from allowing those requests, but with CORS you can configure your bucket to explicitly enable cross-origin requests from website.s3-website-us-east-1 .amazonaws.com. Scenario 2: Suppose that you want to host a web font from your S3 bucket. Again, browsers require a CORS check (also called a preflight check) for loading web fonts. You would configure the bucket that is hosting the web font to allow any origin to make these requests. Option B is invalid because versioning is only to create multiple versions of an object and can help in accidental deletion of objects Option C is invalid because this is used as an extra measure of caution for deletion of objects Option D is invalid because this is used for Cross region replication of objects https://docs.aws.amazon.com/AmazonS3/ latest/dev/cors.html

Topics

#S3 CORS#cross-origin#static website hosting#JavaScript

Community Discussion

No community discussion yet for this question.

Full SCS-C02 Practice