[{"data":1,"prerenderedAt":64},["ShallowReactive",2],{"pattern-cloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet":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":30,"level":31,"meta":32,"patternArch":33,"resources":52,"s3URL":6,"services":6,"stem":59,"testing":60,"videoId":6,"__hash__":63},"patterns\u002Fpatterns\u002Fcloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet.json","Amazon CloudFront Distribution and Function with URI Rewrite to Amazon S3",null,{"text":8},[9],"Delete the stack: \u003Ccode>cdk destroy\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fpatrick-gryczka.json",{"text":13},[14],"cdk deploy","Create a Static Website fronted by CloudFront with CloudFront Functions routing visitors to localized content using CloudFront's Geo Location Headers.","json","AWS CDK",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fcloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet","serverless-patterns\u002Fcloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet","cloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet","src\u002FStaticSiteCDK\u002FStaticSite.cs",{"headline":25,"text":26},"How it works",[27,28,29],"This pattern shows how to create a CloudFront Distribution with a CloudFront Function for routing to different geo-localized content in an S3 statically hosted website. Implemented in AWS CDK .NET.","CloudFront Distributions can be configured to forward the 'CloudFront-Viewer-Country' header.  CloudFront Functions allow for Javascript code to execute at CloudFront edge locations, and allow you to create URL routing and rewrite rules based on request headers.  In this pattern we use the 'CloudFront-Viewer-Country' header to determine the location of the request and rewrite the URI to point to different content based on the location of the request.  Specifically in this example that means pointing to an index.html in a prefix that is applied based on the location.","This pattern deploys one CloudFront Distribution with a CloudFront Function and an S3 Static Website.",".NET","200",{},{"icon1":34,"icon2":39,"icon3":42,"line1":46,"line2":50},{"x":35,"y":36,"service":37,"label":38},20,50,"cloudfront","Amazon CloudFront",{"x":36,"y":36,"service":40,"label":41},"cf-functions","CloudFront Functions",{"x":43,"y":36,"service":44,"label":45},80,"s3","Amazon S3 bucket",{"from":47,"to":48,"label":49},"icon1","icon2","",{"from":48,"to":51,"label":49},"icon3",{"bullets":53},[54,56],{"text":41,"link":55},"(https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudFront\u002Flatest\u002FDeveloperGuide\u002Fcloudfront-functions.html",{"text":57,"link":58},"CloudFront Function Redirection Example","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudFront\u002Flatest\u002FDeveloperGuide\u002Fexample-function-redirect-url.html","patterns\u002Fcloudfront-cff-s3-geo-uri-rewrite-cdk-dotnet",{"text":61},[62],"See the GitHub repo for detailed testing instructions.","lrEJRtS0XR6TiJm18aAMckl4ReA8-_JnyQrimQSvvHM",1779273334279]