{"id":1636,"date":"2022-06-23T14:02:50","date_gmt":"2022-06-23T14:02:50","guid":{"rendered":"https:\/\/www.checkmateq.com\/blog\/?p=1636"},"modified":"2023-08-06T15:29:22","modified_gmt":"2023-08-06T15:29:22","slug":"static-website-with-s3","status":"publish","type":"post","link":"https:\/\/www.checkmateq.com\/blog\/static-website-with-s3","title":{"rendered":"How to serve a static website with S3, Route53 and CloudFront"},"content":{"rendered":"<p><a href=\"https:\/\/www.checkmateq.com\/cloud\"><strong>CloudFront<\/strong><\/a> is a web service provided by AWS cloud that speeds up the distribution of static and dynamic web content to end-users. It is a <strong>global content delivery network<\/strong> that helps deliver websites, apps, and APIs securely at <strong>high speed<\/strong> and <strong>low latency<\/strong>.<\/p>\n<p>To deliver content to users CloudFront makes use of <strong>edge locations<\/strong>. Edge locations are data centers spread around the world. They <strong>cache<\/strong> copies of the content that they serve, so that content is closer to users and can be delivered faster.<\/p>\n<p>We will serve a static website hosted on AWS S3 with CloudFront. For that we need to follow the below steps:<\/p>\n<h3>Step1: Deploy a static website on AWS <a href=\"https:\/\/www.checkmateq.com\/cloud\">cloud<\/a> S3<\/h3>\n<ul>\n<li>Create two S3 buckets. The name of one bucket should be the same as your domain name with www and the other bucket name should be the same as the domain name without www.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1670\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-161451-300x99.png\" alt=\"\" width=\"712\" height=\"235\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-161451-300x99.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-161451-1024x339.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-161451-768x254.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-161451.png 1180w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1671\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724-300x123.png\" alt=\"\" width=\"739\" height=\"303\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724-300x123.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724-1024x421.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724-768x315.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724-1200x493.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-171724.png 1249w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>For the s3 bucket with a name without www, upload the code, enable public access and add the following bucket policy.<\/li>\n<\/ul>\n<pre><code>{\r\n    \"Version\": \"2012-10-17\",\r\n    \"Statement\": [\r\n        {\r\n            \"Sid\": \"ReadAll\",\r\n            \"Effect\": \"Allow\",\r\n            \"Principal\": {\r\n                \"AWS\": \"*\"\r\n            },\r\n            \"Action\": \"s3:GetObject\",\r\n            \"Resource\": \"arn:aws:s3:::your-bucket-name\/*\"\r\n        },\r\n    ]\r\n}<\/code><\/pre>\n<ul>\n<li>Now enable static website hosting.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1678\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647-300x179.png\" alt=\"\" width=\"731\" height=\"436\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647-300x179.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647-1024x612.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647-768x459.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647-1200x717.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143647.png 1207w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now go to AWS cloud S3 bucket having a name with www. Go to static website hosting and select redirect request as hosting type and enter the domain name without www to redirect.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1679\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143846-300x200.png\" alt=\"\" width=\"738\" height=\"492\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143846-300x200.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143846-1024x683.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143846-768x512.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-143846.png 1126w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h3>Step2: Create a hosted zone in AWS cloud Route 53 and use the AWS Certificate Manager for the SSL certificate<\/h3>\n<ul>\n<li>Now go to the <strong>Route53<\/strong> dashboard and create a hosted zone for your domain.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1681\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-153300-300x198.png\" alt=\"CloudFront\" width=\"726\" height=\"479\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-153300-300x198.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-153300-768x506.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-153300.png 915w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Replace the name servers at your hosting provider with the nameserver in the NS record created in Route 53.<\/li>\n<li>Now go to<strong> the Certificate Manager<\/strong> dashboard, select <strong>North Virginia<\/strong>(us-east-1) region, and click <strong>request a certificate<\/strong>.<\/li>\n<li>Request a public certificate and enter your domain name and click <strong>request<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1682\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-300x84.png\" alt=\"\" width=\"743\" height=\"208\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-300x84.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-1024x285.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-768x214.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-1536x428.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358-1200x334.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-22-173358.png 1674w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next copy the <strong>CNAME<\/strong> name and value for both domains and create CNAME records in Route 53 or directly click on <strong>Create records in Route 53<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1684\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-300x93.png\" alt=\"CloudFront\" width=\"739\" height=\"229\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-300x93.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-1024x317.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-768x238.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-1536x476.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756-1200x372.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-160756.png 1660w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>In few minutes you will get success status.<\/li>\n<\/ul>\n<h3>Step3: Create AWS CloudFront Distribution<\/h3>\n<ul>\n<li>Go to <strong>CloudFront dashboard<\/strong> and click on <strong>create distribution<\/strong>.<\/li>\n<li>Copy and paste the website end point from S3 bucket in origin. Remove the http from endpoint.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1685\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106-300x99.png\" alt=\"\" width=\"700\" height=\"231\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106-300x99.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106-1024x337.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106-768x253.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106-1200x395.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164106.png 1404w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1686\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164336-300x130.png\" alt=\"CloudFront\" width=\"713\" height=\"309\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164336-300x130.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164336-1024x443.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164336-768x332.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164336.png 1168w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Change viewer protocol policy to <strong>Redirect http to https<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1688\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164517-300x101.png\" alt=\"\" width=\"734\" height=\"247\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164517-300x101.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164517.png 553w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Add the alternate domain name.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1690\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165443-300x54.png\" alt=\"\" width=\"744\" height=\"134\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165443-300x54.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165443-1024x183.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165443-768x137.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165443.png 1162w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Select the SSL certificate of your domain.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1689\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164714-300x108.png\" alt=\"CloudFront\" width=\"725\" height=\"261\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164714-300x108.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164714-1024x367.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164714-768x276.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-164714.png 1062w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next, click on create distribution. It can take some time to be created.<\/li>\n<li>Once the distribution is created, copy the <strong>distribution domain name<\/strong> and go to the Route53 dashboard.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1691\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165807-300x71.png\" alt=\"\" width=\"731\" height=\"173\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165807-300x71.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-165807.png 583w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Create an A record for the domain. Select alias and route traffic to CloudFront distribution and paste the distribution domain name.<\/li>\n<li>Create another A record for the domain name with www. Route traffic to the endpoint of the S3 bucket with the www domain name and paste the endpoint link and save.<\/li>\n<li>Now we can access our website from the browser with the domain name and we will be served our website via CloudFront distribution.<\/li>\n<\/ul>\n<h3>Srep4: Set up AWS WAF for CloudFront distribution.<\/h3>\n<ul>\n<li>Go to <strong>AWS WAF<\/strong> dashboard. Click on<strong>\u00a0IP sets<\/strong>\u00a0on the left side. Next click on create IP set.<\/li>\n<li>Select the region as CloudFront globalAdd IP set as<strong>\u00a0rule type<\/strong>\u00a0and select the IP set that we created. and enter the <strong>IP address set<\/strong>\u00a0for which you want to\u00a0<strong>allow<\/strong>,<strong>\u00a0block<\/strong>\u00a0or\u00a0<strong>count<\/strong>\u00a0the received requests.<\/li>\n<li>\u00a0Click <strong>Create web ACL<\/strong>.<\/li>\n<li>Select CloudFront distribution as resource type and add it to AWS resource.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1693\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748-300x129.png\" alt=\"CloudFront\" width=\"737\" height=\"317\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748-300x129.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748-1024x440.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748-768x330.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748-1200x516.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-173748.png 1216w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Add IP set as<strong>\u00a0rule type<\/strong>\u00a0and select the IP set that we created.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1695\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355-300x152.png\" alt=\"CloudFront\" width=\"714\" height=\"362\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355-300x152.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355-1024x519.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355-768x389.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355-1200x608.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182355.png 1207w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1696\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182414-300x140.png\" alt=\"CloudFront\" width=\"726\" height=\"339\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182414-300x140.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182414-1200x558.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182414.png 1234w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Select block action and click Save.<\/li>\n<li>Now click on\u00a0<strong>Add rule\u00a0<\/strong>and select<strong>\u00a0Add managed rule groups<\/strong>.<\/li>\n<li>Add\u00a0<strong>Amazon IP reputation list\u00a0<\/strong>rule group to web ACL, scroll down click on\u00a0<strong>Add rule<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1697\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723-300x51.png\" alt=\"\" width=\"735\" height=\"125\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723-300x51.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723-1024x173.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723-768x130.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723-1200x203.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-182723.png 1246w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next select default action for requests that don\u2019t\u00a0match any rule. We will be using allow here.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1698\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220-300x75.png\" alt=\"\" width=\"740\" height=\"185\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220-300x75.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220-1024x256.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220-768x192.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220-1200x300.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183220.png 1263w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next, we have to select rule priority.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1699\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245-300x131.png\" alt=\"CloudFront\" width=\"721\" height=\"315\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245-300x131.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245-1024x446.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245-768x334.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245-1200x523.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-183245.png 1332w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Next, configure AWS cloud monitoring on <strong>CloudWatch<\/strong> with metric name and <strong>enable sampling requests<\/strong>.<\/li>\n<li>Now the requests coming from IP defined in IP set will be blocked.<\/li>\n<li>After a few minutes, we will be able to see the requests coming from the blocked IP set.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-1700\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-184737-255x300.png\" alt=\"CloudFront\" width=\"729\" height=\"858\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-184737-255x300.png 255w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/06\/Screenshot-2022-06-23-184737.png 570w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Author Information\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>This blog is written by Checkmate Global Technologies DevOps engineering team. We have got expertise to manage Cloud DevOps infrastructure Technology stack. Our cloud engineering team can ensure seamless, risk-free, secure stable production operations. Connect now with our technical Consultant to hire experienced <a href=\"https:\/\/www.checkmateq.com\/aws-cloud\">cloud engineer<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CloudFront is a web service provided by AWS cloud that speeds up the distribution of static and dynamic web content to end-users. It is a global content delivery network that helps deliver websites, apps, and APIs securely at high speed and low latency. To deliver content to users CloudFront makes use of edge locations. Edge &hellip; <a href=\"https:\/\/www.checkmateq.com\/blog\/static-website-with-s3\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to serve a static website with S3, Route53 and CloudFront&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":1702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[15,3,17,2,7,11,6],"_links":{"self":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1636"}],"collection":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/comments?post=1636"}],"version-history":[{"count":16,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions"}],"predecessor-version":[{"id":4291,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions\/4291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media\/1702"}],"wp:attachment":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media?parent=1636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/categories?post=1636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/tags?post=1636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}