<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jose Castaneyra</title>
    <description>The latest articles on DEV Community by Jose Castaneyra (@jcastaneyra).</description>
    <link>https://dev.to/jcastaneyra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F302375%2F5842efd3-b171-4306-a571-5a2e2a1a6db1.jpg</url>
      <title>DEV Community: Jose Castaneyra</title>
      <link>https://dev.to/jcastaneyra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jcastaneyra"/>
    <language>en</language>
    <item>
      <title>Your blog with Gatsby, AWS Amplify and a domain in Route53 in a few minutes.</title>
      <dc:creator>Jose Castaneyra</dc:creator>
      <pubDate>Wed, 16 Sep 2020 22:13:55 +0000</pubDate>
      <link>https://dev.to/jcastaneyra/your-blog-with-gatsby-aws-amplify-and-a-domain-in-route53-in-a-few-minutes-21dg</link>
      <guid>https://dev.to/jcastaneyra/your-blog-with-gatsby-aws-amplify-and-a-domain-in-route53-in-a-few-minutes-21dg</guid>
      <description>&lt;p&gt;A few weeks ago, I decided that I should re-do my blog; before creating my new stack for my blog, I researched my options. Currently, there are a lot of options, Jekyll (my old blog was in Jekyll), Hugo, Gatsby, Next.js, and a lot more.&lt;/p&gt;

&lt;p&gt;And well, I decided at the end to go with Gatsby and AWS Amplify console; the main reasons were Amplify console and React, I just wanted to experiment a little bit more on these technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Gatsby?
&lt;/h2&gt;

&lt;p&gt;Gatsby is a framework for dynamic static website generation; it uses React for the front-end and GraphQL for the queries to bring all the dynamic content and has many plugins and starters to help you out to build very fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;For this small tutorial, there are some minimal requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node version 10, Gatsby has an excellent tutorial on installing nvm and node 10 (&lt;a href="https://www.gatsbyjs.com/tutorial/part-zero/" rel="noopener noreferrer"&gt;https://www.gatsbyjs.com/tutorial/part-zero/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;GitHub account, and a repo to upload your code (&lt;a href="https://github.com/" rel="noopener noreferrer"&gt;https://github.com/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;AWS account (&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;https://aws.amazon.com/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Maybe a domain bought through Route53&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Go to the terminal and be sure you have node version 10. To install Gatsby in your system, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; gatsby-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As I mentioned, Gatsby has many plugins and starters that can help you build very fast; in this case, after reviewing different starters &lt;a href="https://www.gatsbyjs.com/starters/?v=2" rel="noopener noreferrer"&gt;https://www.gatsbyjs.com/starters/?v=2&lt;/a&gt; I decide to go with &lt;a href="https://www.gatsbyjs.com/starters/panr/gatsby-starter-hello-friend/" rel="noopener noreferrer"&gt;gatsby-starter-hello-friend&lt;/a&gt;. To use this starter and create a new project, just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gatsby new gatsby-blog https://github.com/panr/gatsby-starter-hello-friend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change to the project directory just created&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;gatsby-blog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gatsby develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running this command, in the terminal you get output about compilation and the URL in your localhost, you should see something like &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;, grab this URL and open it in your browser.&lt;/p&gt;

&lt;p&gt;Until this point, you have the basic setup using this starter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customize it
&lt;/h2&gt;

&lt;p&gt;I like the starters because you can review which start you want the most and adapt to your needs, take it, and customize it; all this is done in a few minutes.&lt;/p&gt;

&lt;p&gt;At this stage, I got Visual Studio Code and started to review the code and make some modifications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I did modify &lt;code&gt;src/posts/hello.md&lt;/code&gt; and create my first post, it is straightforward.&lt;/li&gt;
&lt;li&gt;I updated &lt;code&gt;src/pages/about.md&lt;/code&gt; and removed &lt;code&gt;src/pages/showcase.md&lt;/code&gt; and &lt;code&gt;src/posts/example.md&lt;/code&gt;, also I added some new images to &lt;code&gt;src/images&lt;/code&gt; to be used in the modified page and post.&lt;/li&gt;
&lt;li&gt;I modified siteMetadata at &lt;code&gt;gatsby-config.js&lt;/code&gt; file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At this point, I restart &lt;code&gt;gatsby develop&lt;/code&gt; command and now my blog with starter looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftehtm735z9lu09rpgb5c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftehtm735z9lu09rpgb5c.jpg" alt="Gatsby blog"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this minimal version, I think it is ready to be published, but before doing this, push to GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Push changes and deploy
&lt;/h2&gt;

&lt;p&gt;Now with this minimal version, you can push your code with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my case, I have my code in &lt;a href="https://github.com/jcastaneyra/gatsby-blog" rel="noopener noreferrer"&gt;https://github.com/jcastaneyra/gatsby-blog&lt;/a&gt;, as a disclaimer, at this moment some code in my repo is not the best, but for now this code works, it is still a work in progress.&lt;/p&gt;

&lt;p&gt;Now, go to &lt;a href="https://console.aws.amazon.com/amplify" rel="noopener noreferrer"&gt;AWSAmplify console&lt;/a&gt;, go to "GET STARTED" below "Deploy":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8p9z48w8fsc4egmf6721.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8p9z48w8fsc4egmf6721.png" alt="Amplify console"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select GitHub and press "Continue":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1tvqwyqzb950uolzedsn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1tvqwyqzb950uolzedsn.png" alt="Amplify select source"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You would require to connect your GitHub account with AWS Amplify. Once GitHub and Amplify are connected, select the repo and the branch, press "Next".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyylv4er269q7rf3pvvl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyylv4er269q7rf3pvvl5.png" alt="Amplify select repo and branch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Write an App name, and press "Next".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwqflwq3cwaf0k0y68w49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwqflwq3cwaf0k0y68w49.png" alt="Amplify write app name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Review Repository details and App settings and press "Save and deploy".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcggs7dwuwuupwyrjxqbm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcggs7dwuwuupwyrjxqbm.png" alt="Amplify review and deploy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amplify console will show the status of the deployment, you will see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8gr1d85m0s8w00ouzrzy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8gr1d85m0s8w00ouzrzy.png" alt="Amplify deployment status"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your domain in Route53
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://console.aws.amazon.com/route53/" rel="noopener noreferrer"&gt;Route53 console&lt;/a&gt;, and click below Domains on "Registered domains" press in the "Register Domain" button, you would search a domain you would like to buy, the console would guide you to fill all required info and buy the domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7e0xmzr6dzjtqv0j4elz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7e0xmzr6dzjtqv0j4elz.png" alt="blog_gatsby_route53_buy_domain"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Assign a domain to the
&lt;/h2&gt;

&lt;p&gt;Once the app is deployed with Amplify console, you will see some extra steps. One of these steps is "Add a custom domain with a free SSL certificate", click on this step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw0h1p366uqj28lhhm6tx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw0h1p366uqj28lhhm6tx.png" alt="blog_gatsby_extra_steps"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After clicking, you will see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwyzceziiuqug3s0escze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwyzceziiuqug3s0escze.png" alt="blog_gatsby_add_domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press "Add domain", choose your domain and configure, press "Save".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9b0mo6xyxsvgl5epccex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9b0mo6xyxsvgl5epccex.png" alt="blog_gatsby_configure_domain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amplify console would assign and generate certificates through AWS Certificate Manager.&lt;/p&gt;

&lt;p&gt;After a while, you would have a blog site with your domain, and AWS Amplify console would have a CI/CD (Continuous Integration/Continuous Deployment) for your application, with every commit to the branch associated with the app will trigger the deployment, and with SSL, excellent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;I know there are other services to deploy, such as Netlify and Vercel; I think I must test them in the future.&lt;/p&gt;

&lt;p&gt;For now, AWS Amplify console works for me; maybe because I feel comfortable with AWS and have been working with it for several years, it is fast to bring my web sites online, including the domain and the SSL certificate.&lt;/p&gt;

&lt;p&gt;Originally posted &lt;a href="https://www.jcastaneyra.com/my_blog_with_gatsby_aws_amplify_in_few_minutes/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;¿Quieres leer este artículo en español? Ve &lt;a href="https://www.jcastaneyra.com/es/my_blog_with_gatsby_aws_amplify_in_few_minutes/" rel="noopener noreferrer"&gt;aquí&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>amplify</category>
      <category>aws</category>
      <category>route53</category>
    </item>
  </channel>
</rss>
