{"id":2017,"date":"2025-03-24T13:36:15","date_gmt":"2025-03-24T05:36:15","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=2017"},"modified":"2025-03-24T13:57:22","modified_gmt":"2025-03-24T05:57:22","slug":"aws-route-53","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=2017","title":{"rendered":"AWS Route 53"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2025\/03\/image-1742794569263.png\" alt=\"file\" \/><\/p>\n<p>In AWS Route 53, <strong>Weighted Routing<\/strong> allows you to control the distribution of traffic between multiple resources by assigning weights to DNS records. <\/p>\n<h3><strong>How Weighted Routing Works<\/strong><\/h3>\n<ul>\n<li>Each DNS record in a weighted routing policy has an associated <strong>weight<\/strong> (a number between 0 and 255).<\/li>\n<li>The proportion of traffic directed to each record is determined by its weight relative to the total weight of all records.<\/li>\n<\/ul>\n<h3><strong>Weight Value Meaning<\/strong><\/h3>\n<ul>\n<li>A higher weight means <strong>more traffic<\/strong> is routed to that resource.<\/li>\n<li>A weight of <strong>0<\/strong> means the record <strong>receives no traffic<\/strong> (but remains in DNS).<\/li>\n<li>\n<p>The traffic percentage is calculated as:<\/p>\n<p>[<br \/>\n\\frac{\\text{Record Weight}}{\\text{Total Weight of All Records}} \\times 100<br \/>\n]<\/p>\n<\/li>\n<\/ul>\n<h3><strong>Example<\/strong><\/h3>\n<p>Suppose you have two EC2 instances and set the following weights:<\/p>\n<ul>\n<li><strong>Instance A<\/strong> \u2192 Weight = 30<\/li>\n<li><strong>Instance B<\/strong> \u2192 Weight = 70<\/li>\n<\/ul>\n<p>Total weight = <strong>30 + 70 = 100<\/strong>  <\/p>\n<ul>\n<li>Instance A gets <strong>30%<\/strong> of traffic.<\/li>\n<li>Instance B gets <strong>70%<\/strong> of traffic.<\/li>\n<\/ul>\n<p>If you later change the weights to <strong>20 and 80<\/strong>, then:<\/p>\n<ul>\n<li>Instance A gets <strong>20%<\/strong> of traffic.<\/li>\n<li>Instance B gets <strong>80%<\/strong> of traffic.<\/li>\n<\/ul>\n<h3><strong>How to Set Weighted Routing in Route 53<\/strong><\/h3>\n<ol>\n<li><strong>Go to AWS Route 53 Console<\/strong> \u2192 Open <strong>Hosted Zones<\/strong>.<\/li>\n<li><strong>Choose Your Domain<\/strong> \u2192 Select the record set you want to configure.<\/li>\n<li><strong>Create or Edit a Record Set<\/strong> \u2192 Set:\n<ul>\n<li><strong>Record Type<\/strong> (e.g., A, CNAME).<\/li>\n<li><strong>Routing Policy<\/strong> \u2192 Select <strong>Weighted<\/strong>.<\/li>\n<li><strong>Set Weight Value<\/strong> (e.g., 30, 70).<\/li>\n<li><strong>Health Check (Optional)<\/strong> \u2192 Ensures traffic goes to healthy resources.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Repeat for Additional Records<\/strong> \u2192 Assign different weights.<\/li>\n<li><strong>Save Changes<\/strong>.<\/li>\n<\/ol>\n<h3><strong>Use Cases<\/strong><\/h3>\n<ul>\n<li>Gradual traffic shifting for <strong>blue\/green deployments<\/strong>.<\/li>\n<li>Load balancing across multiple resources without a load balancer.<\/li>\n<li>A\/B testing different services by sending different amounts of traffic.<\/li>\n<\/ul>\n<p>Would you like a hands-on example with Terraform or AWS CLI?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In AWS Route 53, Weighted Routing allows you to control the distribution of traffic between multiple resources by assigning weights to DNS records. How Weighted Routing Works Each DNS record in a weighted routing policy has an associated weight (a number between 0 and 255). The proportion of traffic directed to each record is determined [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=2017\" title=\"Permanent Link to: AWS Route 53\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2017","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2017"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2017"}],"version-history":[{"count":2,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2017\/revisions"}],"predecessor-version":[{"id":2020,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2017\/revisions\/2020"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}