<?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>Forem: INNOMIZE</title>
    <description>The latest articles on Forem by INNOMIZE (@innomize).</description>
    <link>https://forem.com/innomize</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%2Forganization%2Fprofile_image%2F1412%2Fb1070f3f-18e0-44d6-934d-51c7fd3256b2.png</url>
      <title>Forem: INNOMIZE</title>
      <link>https://forem.com/innomize</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/innomize"/>
    <language>en</language>
    <item>
      <title>Quickly Installing And Running Neo4j Using Ansible On AWS Cloud</title>
      <dc:creator>Hoang Le</dc:creator>
      <pubDate>Mon, 28 Oct 2019 10:45:13 +0000</pubDate>
      <link>https://forem.com/innomize/quickly-installing-and-running-neo4j-using-ansible-on-aws-cloud-3fhc</link>
      <guid>https://forem.com/innomize/quickly-installing-and-running-neo4j-using-ansible-on-aws-cloud-3fhc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fneo4j-aws-ansible.png%3Fresize%3D800%252C300%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2Fneo4j-aws-ansible.png%3Fresize%3D800%252C300%26ssl%3D1" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently, we have worked on a project that uses Neo4j to store and process large graph data for our client. Our client has been asked for a solution to launch, install and configure a &lt;strong&gt;Neo4j single node&lt;/strong&gt; (for the development environment and &lt;strong&gt;High Availability&lt;/strong&gt; &lt;strong&gt;Neo4j cluster&lt;/strong&gt; (for production environment).






&lt;/p&gt;
&lt;p&gt;Before getting started, I just wanted to give you a note that there are a couple of options to deploy &lt;strong&gt;Neo4j&lt;/strong&gt; on &lt;strong&gt;AWS&lt;/strong&gt;, so you might take a look before looking for details or select the best option that works for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a rel="noreferrer noopener" href="https://aws.amazon.com/marketplace/pp/B071P26C9D?qid=1530283441386&amp;amp;sr=0-1&amp;amp;ref_=srh_res_product_title"&gt;Neo4j Community AWS Marketplace&lt;/a&gt;, easy to launch instances and configure networking such as VPCs, storage.&lt;/li&gt;
&lt;li&gt;
&lt;a rel="noreferrer noopener" href="https://aws.amazon.com/marketplace/pp/B07D441G55?qid=1530283441386&amp;amp;sr=0-2&amp;amp;ref_=srh_res_product_title"&gt;Neo4j Enterprise Causal Cluster&lt;/a&gt;, which deploys multi-node causal clusters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article provides a step by step guild on how to launch, install and configure high availability Neo4j cluster (aka HA cluster) using Ansible on AWS. We use &lt;strong&gt;&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;&lt;/strong&gt; for demonstration, but you are able to custom the playbooks and configurations for other cloud vendors such as &lt;strong&gt;Google Cloud&lt;/strong&gt;, &lt;strong&gt;Azure&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Pre-requisites&lt;/h3&gt;

&lt;p&gt;In order to use this Ansible playbook on AWS, the following is needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;&lt;a href="https://aws.amazon.com/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;&lt;/strong&gt; account with a user's access key and secret key.&lt;/li&gt;
&lt;li&gt;An IAM policy attached to the above user that allows launching new EC2 instances, authorize ports in security groups.&lt;/li&gt;
&lt;li&gt;An EC2 Key-Pair to allow SSH to EC2 instances.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;git installed on your machine&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;The steps&lt;/h3&gt;

&lt;p&gt;To deploy Neo4j, what are we going to build is the following deployment flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup security groups and authorize ports communication&lt;/li&gt;
&lt;li&gt;Launch EC2 instance(s) - optional&lt;/li&gt;
&lt;li&gt;Update OS&lt;/li&gt;
&lt;li&gt;Install Neo4j Enterprise on EC2 instance(s)&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://www.haproxy.org/" rel="noopener noreferrer"&gt;HAProxy&lt;/a&gt;  and configure HA cluster on EC2 instance(s) - only required for HA cluster&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Getting started&lt;/h3&gt;

&lt;p&gt;Before deploying, a security group needs to be created that the Neo4j cluster/instance will use. In fact, you can create multiple security groups for different purposes such as allow SSH to instance, allow Neo4j communication between each other. But to simplify the process, we will use one security groups that allow the following ports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;22 (SSH)&lt;/li&gt;
&lt;li&gt;Neo4j Ports listed on this &lt;a href="https://neo4j.com/docs/operations-manual/current/configuration/ports/" rel="noopener noreferrer"&gt;page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;8000 - HA admin port for HA cluster deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Login to &lt;a href="http://console.aws.amazon.com/" rel="noopener noreferrer"&gt;AWS Console Management&lt;/a&gt; portal and create a security group and open the above ports like below screenshot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2FScreen-Shot-2019-10-28-at-4.54.21-PM-1024x257.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2FScreen-Shot-2019-10-28-at-4.54.21-PM-1024x257.png" alt="Security group inbound ports" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;Project structure&lt;/h4&gt;

&lt;p&gt;A well-defined &lt;em&gt;project structure&lt;/em&gt; will help us easy to understand each part of the solution, allow reuse, and customizable. If you have experience in working with Ansible, you should know how to organize the Ansible project. I followed the alternative approach mentioned in &lt;a rel="noreferrer noopener" href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout"&gt;this&lt;/a&gt; article, feel free to select your own approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2FScreen-Shot-2019-10-28-at-4.54.54-PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblog.innomizetech.com%2Fwp-content%2Fuploads%2F2019%2F10%2FScreen-Shot-2019-10-28-at-4.54.54-PM.png" alt="Ansible project structure" width="800" height="400"&gt;&lt;/a&gt;Ansible Project Structure&lt;/p&gt;

&lt;p&gt;The above project structure contains the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;extension/setup&lt;/em&gt;: contain scripts to install &lt;strong&gt;Ansible&lt;/strong&gt; and required python packages&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;inventories/[env]&lt;/em&gt;: define all variables for playbooks that allow us custom for each environment&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;roles:&lt;/em&gt; predefined and reusable roles for our playbooks. In this solution, we use the following roles:&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;common&lt;/em&gt;: the common role to install common package or update the latest OS version.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;haproxy&lt;/em&gt;: the role to install and configure HAProxy.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;launch-ec2&lt;/em&gt;: the role to launch EC2 instances in multiple AZ.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;neo4j&lt;/em&gt;: install and configure Neo4j on a single instance.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;em&gt;templates: &lt;/em&gt;template files for configuring Neo4j instances as well as HAProxy config files&lt;/li&gt;

&lt;li&gt;There are two main playbooks:&lt;ul&gt;

&lt;li&gt;

&lt;em&gt;neo4j.single.yml:&lt;/em&gt; the playbook to launch and install a single Neo4j node.&lt;/li&gt;

&lt;li&gt;neo4j.cluster.yml: the playbook to launch and install an HA Neo4j cluster.&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;Preparation&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Step 1 - Clone/download source code from Github using GIT&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;clone https://github.com/innomizetech/neo4j-ansible.git&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;change directory into the newly created directory&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd neo4j-ansible&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 2 - Install Ansible and required python packages&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;chmod +x extension/setup/setup.sh
./extension/setup/setup.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 3 - Decrypt &lt;a href="https://docs.ansible.com/ansible/latest/user_guide/vault.html" rel="noopener noreferrer"&gt;Ansible Vault&lt;/a&gt; file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A vault file contains sensitive information so that we shouldn't commit to source control in plaintext. So we need to encrypt it before committing to source control. Using &lt;a href="https://docs.ansible.com/ansible/latest/user_guide/vault.html#decrypting-encrypted-files" rel="noopener noreferrer"&gt;Ansible vault&lt;/a&gt; so this problem. In this repo, we committed the password file for demo purpose, &lt;strong&gt;please note that you should not commit the password file into Source control.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run below command to decrypt the&lt;em&gt; vault.yml&lt;/em&gt; file in the inventory directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ansible-vault decrypt inventories/dev/group_vars/vault.yml --vault-password-file ansible-vault.pass&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 4 - Update vault.yml file&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;---
# Sensitive variables here are applicable to deploy application

aws_access_key: &amp;lt;&amp;lt;your access key&amp;gt;&amp;gt;
aws_secret_key: &amp;lt;&amp;lt;your secret access key&amp;gt;&amp;gt;

# The security group id to be attached to new instance
security_group: &amp;lt;&amp;lt;your security group id&amp;gt;&amp;gt;
# An Amazone Linux image
image: &amp;lt;&amp;lt;AMI id i.e. ami-048a01c78f7bae4aa&amp;gt;&amp;gt;
# The first subnet to launch instance, it should be public subnet if you allowed public access
vpc_az1_subnet_id: &amp;lt;&amp;lt;your subnet 1 id&amp;gt;&amp;gt;
# The second subnet to launch instance, it should be public subnet if you allowed public access
vpc_az2_subnet_id: &amp;lt;&amp;lt;your subnet 2 id&amp;gt;&amp;gt;

# Set initial password for Neo instances
initial_password: &amp;lt;&amp;lt;your password&amp;gt;&amp;gt;

# HAProxy configuration (requires for cluster mode with HAProxy)
stats_user: &amp;lt;&amp;lt;your HAProxy username&amp;gt;&amp;gt;
stats_pass: &amp;lt;&amp;lt;your HAProxy user password&amp;gt;&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Deploy a single Neo4j Node&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Step 1 - Update groups variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Review and update variables in the &lt;em&gt;inventory\dev\group_vars\neo4j-single.yml&lt;/em&gt; file, below are some important variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;region&lt;/em&gt;: an AWS region to launch and deploy Neo4j&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;keypair&lt;/em&gt;:  an existing key-pair on the above region&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;other variables&lt;/em&gt;: feel free to update according to your requirement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2- Run Ansible playbook&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run below command to deploy a single Neo4j instance for &lt;code&gt;dev&lt;/code&gt; environment. Replace &lt;code&gt;dev&lt;/code&gt; to any existing inventory in the &lt;code&gt;inventories&lt;/code&gt; directory (i.e. staging, prod)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ansible-playbook neo4j.single.yml -e env=dev --vault-password-file ansible-vault.pass

#  or we can use -b -K to enter SUDO password (sudo su)
ansible-playbook neo4j.single.yml -e env=dev --vault-password-file ansible-vault.pass -b -K&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wait until the command finished and access to Neo4j browser at &lt;a href="http://public-ip:7474" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="http://public-ip:7474" rel="noopener noreferrer"&gt;http://public-ip:7474&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy an HA Neo4j cluster &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Execute the same steps above with&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;neo4j-cluster.yml&lt;/em&gt; group variables file&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;neo4j.single.yml&lt;/em&gt; the Ansible playbook&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the result of each case by watching those videos on our Youtube channel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtu.be/wZccrA7ReU0" rel="noopener noreferrer"&gt;Deploy single Neo4j on AWS using Ansible&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/MIZ6knCkGq8" rel="noopener noreferrer"&gt;Deploy HA Neo4j cluster on AWS Using Ansible&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any issues when practicing this instruction, feel free to let us know by giving us our comments.&lt;/p&gt;

&lt;p&gt;Visit our &lt;a href="https://innomizetech.com/blog" rel="noopener noreferrer"&gt;blog&lt;/a&gt; for more interesting articles. If you have any questions or need help you can contact me via &lt;a href="https://twitter.com/hoangleitvn" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>devops</category>
      <category>aws</category>
      <category>database</category>
    </item>
    <item>
      <title>How do we host our static website</title>
      <dc:creator>Hoang Le</dc:creator>
      <pubDate>Sat, 26 Oct 2019 03:44:27 +0000</pubDate>
      <link>https://forem.com/innomize/how-do-we-host-our-static-website-24mj</link>
      <guid>https://forem.com/innomize/how-do-we-host-our-static-website-24mj</guid>
      <description>&lt;p&gt;You are building a static website and wanted to know how to host your site, but;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You don't want to perform manual steps.&lt;/li&gt;
&lt;li&gt;You want to host for multiple environments such as &lt;strong&gt;Development&lt;/strong&gt;, &lt;strong&gt;UAT&lt;/strong&gt;, &lt;strong&gt;Staging&lt;/strong&gt;, &lt;strong&gt;Production&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You want to reduce cost, provide high-levels of reliability, require almost no IT administration, and scale to handle enterprise-level traffic with no additional work.&lt;/li&gt;
&lt;li&gt;You wanted to deliver HTML, JavaScript, images, video and other files to your website visitors around the world with CDN.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, I will show you how to host a static website in a few minutes without manual steps, you can define the CI/CD pipeline to automate your deployment process pretty easy. &lt;a href="https://aws.amazon.com/getting-started/projects/host-static-website/" rel="noopener noreferrer"&gt;Amazon Web Services &lt;/a&gt;is the most popular public cloud vendor in the world, they provide services to simply making a website on their infrastructure around the world. Check out &lt;a href="https://aws.amazon.com/getting-started/projects/host-static-website/" rel="noopener noreferrer"&gt;this article&lt;/a&gt; to know more details. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd1.awsstatic.com%2FProjects%2Fv1%2FAWS_StaticWebsiteHosting_Architecture_4b.da7f28eb4f76da574c98a8b2898af8f5d3150e48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd1.awsstatic.com%2FProjects%2Fv1%2FAWS_StaticWebsiteHosting_Architecture_4b.da7f28eb4f76da574c98a8b2898af8f5d3150e48.png" alt="AWS_StaticWebsiteHosting_Architecture_4b" width="561" height="572"&gt;&lt;/a&gt;&lt;a href="https://aws.amazon.com/getting-started/projects/host-static-website/" rel="noopener noreferrer"&gt;Static website hosting architecture at AWS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are new to AWS, you want to practice in order to know steps to host a site on AWS, &lt;a href="https://dev.to/arswaw/host-a-serverless-static-website-with-free-ssl-in-15-minutes-hd3"&gt;this article&lt;/a&gt; will help you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DevOps&lt;/strong&gt; at &lt;a href="https://www.innomizetech.com/" rel="noopener noreferrer"&gt;Innomize&lt;/a&gt; is the most important aspect of our solutions and required for all our projects. Automation reduces time-to-market, the risk of human errors and redundancy in the system while increasing the efficiency of the project delivery. To automate the static website deployment, there are a couple of ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using&lt;strong&gt; &lt;/strong&gt;&lt;a href="https://aws-amplify.github.io/" rel="noopener noreferrer"&gt;the AWS Amplify&lt;/a&gt; framework.&lt;/li&gt;
&lt;li&gt;Using the &lt;a href="https://serverless.com" rel="noopener noreferrer"&gt;Serverless&lt;/a&gt; framework and define CloudFormation resources, then using the &lt;a href="https://www.npmjs.com/package/serverless-s3-sync" rel="noopener noreferrer"&gt;serverless-s3-sync&lt;/a&gt; plugin to sync your static files to the S3 bucket. &lt;/li&gt;
&lt;li&gt;Using the &lt;a href="https://github.com/serverless/components" rel="noopener noreferrer"&gt;Serverless Component&lt;/a&gt;, a new infrastructure provisioning technology to build, compose, and deploy apps in seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Let's get started&lt;/h4&gt;

&lt;p&gt;Now, I will show steps to build and deploy a website using &lt;strong&gt;Serverless Component.&lt;/strong&gt; Below are the reasons why I selected this approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is pretty fast, in less minute you will have a site up and running.&lt;/li&gt;
&lt;li&gt;It is an easy way to apply to our &lt;a href="https://en.wikipedia.org/wiki/Monorepo" rel="noopener noreferrer"&gt;Monorepo&lt;/a&gt; since we have multiple apps per repo.&lt;/li&gt;
&lt;li&gt;For consistency with our backend framework, we use the &lt;strong&gt;Serverless framework&lt;/strong&gt; to build backend services with &lt;strong&gt;AWS Lambda&lt;/strong&gt;, &lt;strong&gt;API Gateway&lt;/strong&gt;, &lt;strong&gt;Cognito&lt;/strong&gt;, and other AWS services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow &lt;a href="https://github.com/serverless/components/tree/master/templates/website" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;, you will able to build and deploy your site, however, the &lt;strong&gt;Serverless component&lt;/strong&gt; hasn't provided a way to deploy to multiple environments/stages using the same serverless.yml (or serverless.js) file yet. I have raised &lt;a href="https://github.com/serverless/components/issues/481" rel="noopener noreferrer"&gt;this issue&lt;/a&gt;, check out this if you want to know more details. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note, I wrote this post based on suggestments and comments from the above Github issue.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Before getting started to deploy the site, if you haven't had a domain registered, you might need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out &lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt; to register a new domain.&lt;/li&gt;
&lt;li&gt;Request a wildcard public cert by following &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After  you had the SSL certificate and Route53 issued and registered, follow the following steps to compose and deploy your site:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Install Serverless&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;npm install serverless -g&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Create a sample React application, you can skip this step if you already have your app.&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;npx create-react-app sls-dev-app&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Install serverless component packages&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;npm install @serverless/core @serverless/template -D&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;&lt;li&gt;Create &lt;em&gt;serverless.js &lt;/em&gt; file in the project root directory&lt;/li&gt;&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;&lt;li&gt;You can modify the serverless.js file based on your requirements. such as replace your domain name (i.e. change the &lt;em&gt;domain.com&lt;/em&gt; to your registered domain name). &lt;strong&gt;Note, right now if you use the full domain name for the bucketName (i.e. &lt;/strong&gt;&lt;a rel="noreferrer noopener" href="http://www.my-app.domain.com/"&gt;&lt;strong&gt;www.my-app.domain.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;), you will end up with an error related to CloudFront distribution, that is the reason why I used hyphens (-) instead of using dots (.) for bucket name.&lt;/strong&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;Deploy&lt;/li&gt;&lt;/ul&gt;

&lt;pre&gt;&lt;code&gt;# --env can be any value for your environment
sls --debug --env=dev

# then you can deploy to another environment
sls --debug --env=prod&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In a few minutes (it depends on how fast the CloudFront distribution provision and register your site), you will have your site up and running.&lt;/p&gt;

&lt;p&gt;If you have any problem, feel free to send me a DM at &lt;a href="https://twitter.com/hoangleitvn" rel="noopener noreferrer"&gt;@hoangleitvn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit our &lt;a href="https://innomizetech.com/blog" rel="noopener noreferrer"&gt;blog&lt;/a&gt; for more interesting articles. If you have any questions or need help you can contact me via &lt;a href="https://twitter.com/hoangleitvn" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>devops</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
