AWS - API GatewayWhich 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"] }] }Check Answer
Step-by-Step SolutionSolution:Step 1: Identify AllowedOrigins and AllowedMethodsThe question asks for allowing any origin (*) and methods GET and POST.Step 2: Match JSON snippet to requirements{ "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "POST"] }] } correctly sets AllowedOrigins to ["*"] and AllowedMethods to ["GET", "POST"].Final Answer:{ "CORSRules": [{ "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "POST"] }] } -> Option CQuick Check:AllowedOrigins=* and AllowedMethods=GET,POST [OK]Quick Trick: Look for AllowedOrigins '*' and methods GET, POST [OK]Common Mistakes:MISTAKESUsing wrong HTTP methods like DELETE or PATCHSetting AllowedOrigins to a specific domain instead of '*'Incorrect JSON structure or missing brackets
Master "API Gateway" in AWS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More AWS Quizzes API Gateway - REST API creation - Quiz 15hard AWS Lambda - Event triggers for Lambda - Quiz 12easy Auto Scaling - Launch templates - Quiz 7medium Auto Scaling - Minimum, maximum, and desired capacity - Quiz 10hard Auto Scaling - Auto Scaling with ELB integration - Quiz 10hard DynamoDB - Time to live (TTL) for expiration - Quiz 15hard DynamoDB - DynamoDB Streams overview - Quiz 2easy RDS and Relational Databases - Launching an RDS instance - Quiz 14medium SNS and SQS - SNS notification types (email, SMS, Lambda) - Quiz 10hard SNS and SQS - SQS queue concept - Quiz 12easy