Bird
0
0

Which of the following is the correct JSON snippet to allow GET and POST methods from any origin in an S3 bucket CORS configuration?

easy📝 Configuration Q12 of 15
AWS - API Gateway
Which of the following is the correct JSON snippet to allow GET and POST methods from any origin in an S3 bucket CORS configuration?
A{ "CORSRules": [{ "AllowedOrigins": ["http://example.com"], "AllowedMethods": ["PUT"] }] }
B{ "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["DELETE"] }] }
C{ "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "POST"] }] }
D{ "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["PATCH"] }] }
Step-by-Step Solution
Solution:
  1. Step 1: Identify AllowedOrigins and AllowedMethods

    The question asks for allowing any origin (*) and methods GET and POST.
  2. Step 2: Match JSON snippet to requirements

    { "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "POST"] }] } correctly sets AllowedOrigins to ["*"] and AllowedMethods to ["GET", "POST"].
  3. Final Answer:

    { "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "POST"] }] } -> Option C
  4. Quick Check:

    AllowedOrigins=* and AllowedMethods=GET,POST [OK]
Quick Trick: Look for AllowedOrigins '*' and methods GET, POST [OK]
Common Mistakes:
MISTAKES
  • Using wrong HTTP methods like DELETE or PATCH
  • Setting AllowedOrigins to a specific domain instead of '*'
  • Incorrect JSON structure or missing brackets

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes