{"id":9633,"date":"2022-09-12T18:38:13","date_gmt":"2022-09-12T13:08:13","guid":{"rendered":"https:\/\/www.skynats.com\/?p=9633"},"modified":"2023-06-15T17:09:06","modified_gmt":"2023-06-15T11:39:06","slug":"amplify-aws-access-denied","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/amplify-aws-access-denied\/","title":{"rendered":"Fixed: Amplify AWS Access Denied"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This article will examine a solution to the AWS Amplify Access Denied issue. We can resolve your AWS Amplify issues at Skynats using our <a href=\"https:\/\/www.skynats.com\/aws-management\/\" target=\"_blank\" rel=\"noreferrer noopener\">AWS Support Services<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-causes-the-error-aws-amplify-access-denied\">What Causes the Error &#8220;AWS Amplify Access Denied&#8221;?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Through the use of a set of tools and features collectively referred to as AWS Amplify, frontend web and mobile developers can build full-stack applications on AWS. They have the discretion to choose from a variety of AWS services as their use cases evolve.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Amplify allows users to connect their apps in minutes, configure a web or mobile app backend, and visually build a web frontend UI while managing app content outside of the AWS console. Deliver faster and scale with no need for cloud expertise.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, when using AWS Amplify, we might encounter the &#8220;Access Denied&#8221; error. The &#8220;Access Denied&#8221; error in AWS Amplify can appear for several reasons. Let&#8217;s look at a few of them and their solutions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 1<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the app&#8217;s distribution directory is improperly configured, we might encounter an error when deploying and hosting the app with Amplify.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To fix it, change the distribution directory using the amplify configure project tool, and then restart amplify publish.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 2<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the root directory of the website cannot initialize properly, the &#8220;Access Denied&#8221; error is displayed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Error>\n  &lt;Code>AccessDenied&lt;\/Code>\n  &lt;Message>Access Denied&lt;\/Message>\n  &lt;RequestId>4442587FB7D0A2F9&lt;\/RequestId>\n  &lt;HostId>...&lt;\/HostId>\n&lt;\/Error><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure that when manually deploying an application from Amazon S3, the zip folder contains the build output instead of the top-level folder. For instance, if the build output creates a folder with the names &#8220;build&#8221; or &#8220;public,&#8221; go into that folder, select everything inside, and zip it up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 3<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One can access the first landing page after the angular app has been deployed on AWS Amplify. The Access Denied error would appear when we attempted to access a path that was defined on the router.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Start by visiting the AWS console.<\/li><li>Choose &#8220;Rewrites and redirects.&#8221;<\/li><li>After that, make a fresh rewrite and redirect the rule.<\/li><li>Enter the following rule after clicking &#8220;Open text editor&#8221;:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n    {\n        \"source\": \"&lt;\/^&#91;^.]+$|\\\\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)(&#91;^.]+$)\/>\",\n        \"target\": \"\/index.html\",\n        \"status\": \"200\",\n        \"condition\": null\n    }\n]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, we can successfully access the URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we looked at a few situations where we might run into the AWS Amplify &#8220;Access Denied&#8221; error. Additionally, we offered the most effective fixes from our Tech Support team in each situation. <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\">Contact us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will examine a solution to the AWS Amplify Access Denied issue. We can resolve your AWS Amplify issues at Skynats using our AWS Support Services. What Causes the Error &#8220;AWS Amplify Access Denied&#8221;? Through the use of a set of tools and features collectively referred to as AWS Amplify, frontend web and mobile [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[727],"class_list":["post-9633","post","type-post","status-publish","format-standard","hentry","category-blog","tag-aws-amplify"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/9633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=9633"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/9633\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=9633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=9633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=9633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}