[{"data":1,"prerenderedAt":62},["ShallowReactive",2],{"pattern-apigw-cors-allowlist":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":28,"level":29,"meta":30,"patternArch":32,"resources":46,"s3URL":6,"services":6,"stem":57,"testing":58,"videoId":6,"__hash__":61},"patterns\u002Fpatterns\u002Fapigw-cors-allowlist.json","Amazon API Gateway CORS allowlist",null,{"text":8},[9],"make teardown",[11],"content\u002Fcontributors\u002Fbenjamen-pyle.json",{"text":13},[14],"make build-and-deploy","Create an allowlist of domains for CORS pre-flight requests.","json","AWS CDK",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapi-gateway-cors-whitelist-cdk","serverless-patterns\u002Fapi-gateway-cors-whitelist-cdk","api-gateway-cors-whitelist-cdk","infra\u002Flib\u002Fmain-stack.ts",{"headline":25,"text":26},"How it works",[27],"By instrumenting CORS, a browser's request will be validated against an OPTIONS request inside of API Gateway. API Gateway only allows a single domain to be registered or a `*` can be utilized to allow all domains. In the case of more restriction and more flexibility, a whitelist of allowed domains can be built using a Lambda that is executed via a Proxy Integration.","Go","200",{"content-owner":31},"jbeswick",{"icon1":33,"icon2":38,"line1":42},{"x":34,"y":35,"service":36,"label":37},20,50,"apigw","API Gateway REST API",{"x":39,"y":35,"service":40,"label":41},80,"lambda","AWS Lambda",{"from":43,"to":44,"label":45},"icon1","icon2","Options",{"bullets":47},[48,51,54],{"text":49,"link":50},"Amazon API Gateway","https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fwelcome.html",{"text":52,"link":53},"Amazon API Gateway CORS","https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fhow-to-cors.html",{"text":55,"link":56},"Go Lambda","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fgolang-handler.html","patterns\u002Fapigw-cors-allowlist",{"text":59},[60],"See the GitHub repo for detailed testing instructions.","XCDPDROLt-NtyZisNvr6eEhmQcehwnqYjP1_NN9DclQ",1778846881691]