<?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: Salman Sohail</title>
    <description>The latest articles on DEV Community by Salman Sohail (@saluminati).</description>
    <link>https://dev.to/saluminati</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%2F260202%2F16d4a4c7-77cd-4c49-8d79-ab72663c68ac.jpg</url>
      <title>DEV Community: Salman Sohail</title>
      <link>https://dev.to/saluminati</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saluminati"/>
    <language>en</language>
    <item>
      <title>Creating a Ruby gem using Thor generator</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Wed, 02 Mar 2022 03:33:15 +0000</pubDate>
      <link>https://dev.to/saluminati/creating-a-ruby-gem-using-thor-generator-4l56</link>
      <guid>https://dev.to/saluminati/creating-a-ruby-gem-using-thor-generator-4l56</guid>
      <description>&lt;p&gt;I have been writing ruby gems for sometime now and always wish that there could be a command that can generate the gem structure/boilerplate and the things I love pre-configured for me.&lt;/p&gt;

&lt;p&gt;This is where &lt;a href="https://github.com/rails/thor/wiki"&gt;Thor&lt;/a&gt; comes in handy. I am going to introduce you to Thor a.k.a the badass command line generator that will make your life easy when it comes to ruby gem creation.&lt;/p&gt;

&lt;p&gt;I do want to mention &lt;a href="https://medium.com/@maku_m"&gt;Mariella Miranda&lt;/a&gt; who’s article on this topic inspired me to create a project which can be used as a gem generator to save you a lot of time.&lt;/p&gt;

&lt;p&gt;just imagine this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;thor mygem age_calculator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Produces this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;age_calculator
│ README.md
│ age_calculator.gemspec
│ Gemfile
│ .gitignore
│
└───lib
│ │ age_calculator.rb
│ └───age_calculator
        │ version.rb
│   
└───spec
    └───age_calculator
    │ age_calculator_spec.rb
    │ spec_helper.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let’s do this!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iPA5CbOm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2020/01/04030038/bacha.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iPA5CbOm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2020/01/04030038/bacha.gif" alt="" width="220" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install thor
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;thor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clone my repository from github&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/saluminati/gem_generator.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Link to my repo &lt;a href="https://github.com/saluminati/gem_generator"&gt;https://github.com/saluminati/gem_generator&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting started
&lt;/h3&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;gem_generator
thor gem_generator age_calculator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3kLWaCGg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2022/03/image-1-1024x291.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3kLWaCGg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2022/03/image-1-1024x291.png" alt="" width="880" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your gem with all the required files is now created in the age_calculator directory&lt;/p&gt;

&lt;p&gt;You can also append gem generator with &lt;strong&gt;use_rspec_suit&lt;/strong&gt; and &lt;strong&gt;use_rubocop&lt;/strong&gt; options have rspec and rubocop pre-installed and configured with your&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;thor gem_generator age_calculator &lt;span class="nt"&gt;--use_rspec_suit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--use_rubocop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EEK6_wtj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2022/03/image-2-1024x437.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EEK6_wtj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2022/03/image-2-1024x437.png" alt="" width="880" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once your gem is created, make sure that you try to build it.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd age_calculator
bundle install
gem build age_calculator.gemspec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Some explanation – As I promised
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Content of gem_generator.thor file
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LXtB98js--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/31220842/meme1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LXtB98js--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/31220842/meme1.gif" alt="" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our main file is &lt;strong&gt;gem_generator.thor&lt;/strong&gt; which holds everything together.&lt;/p&gt;

&lt;p&gt;This file is extended from &lt;strong&gt;Thor::Group&lt;/strong&gt; which, in a nutshell will execute all the methods defined in this class in the order they were defined.&lt;/p&gt;

&lt;p&gt;If you look at the methods inside this class, it is creating the gem directory and copying the templates files within your gem namespace with everything per-configured.&lt;/p&gt;

&lt;p&gt;Happy coding! please let me know if you run into any issue.&lt;/p&gt;

</description>
      <category>gemgenerator</category>
      <category>rubygems</category>
      <category>rubythor</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Putting all things together using AWS Task Definition</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Fri, 27 Dec 2019 13:56:51 +0000</pubDate>
      <link>https://dev.to/saluminati/putting-all-things-together-using-aws-task-definition-4n7o</link>
      <guid>https://dev.to/saluminati/putting-all-things-together-using-aws-task-definition-4n7o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://salzam.com/wordpress-docker-aws-ecs-codepipeline-load-balancer-rds-efs/"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the previous article, We have created the ECS Task Definition which has our Docker Image container along with environment variables and we also have mounted EFS volumes for plugins and cache.&lt;/p&gt;

&lt;p&gt;In this article, our website will go live with Load Balancer and Autoscalling groups (having multiple WordPress instances on demand). This means that AWS can increase the number of WordPress instances on demand and it can scale it down too.&lt;/p&gt;

&lt;p&gt;We will do the following in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create ECS Cluster&lt;/li&gt;
&lt;li&gt;Create Service for WordPress Task Definition&lt;/li&gt;
&lt;li&gt;Configure Autoscalling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create ECS Cluster
&lt;/h2&gt;

&lt;p&gt;Go to ECS from your AWS console service tab and select Clusters, Click on Create Cluster&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IztZVbkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28222803/001-8-1024x306.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IztZVbkz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28222803/001-8-1024x306.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Select Cluster template
&lt;/h3&gt;

&lt;p&gt;Select &lt;strong&gt;EC2 Linux + Networking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28222919/002-7.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--26ZUt1b9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28222919/002-7-1024x833.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configure cluster
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28223041/003-8.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xwv7yQQo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28223041/003-8-1024x1024.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have used m5a.large instance size. You can choose whatever instance size is suitable for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28223630/004-8.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fANyguIG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28223630/004-8-965x1024.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please select the instance Security Group we created earlier. This cluster will create an EC2 instance for us. We will place our WordPress Docker image on this instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224001/005-6.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nc-TOpKm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224001/005-6-1024x766.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit Create button and it will create the Cluster for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224533/007-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kCWGgZnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224533/007-2-1024x741.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should be able to see your cluster in the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224321/006-7.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MhGVGNZM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224321/006-7-1024x495.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add Service to your Cluster
&lt;/h3&gt;

&lt;p&gt;Click on the cluster your have created and click on &lt;strong&gt;Create&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224746/008-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ex8WU3Lo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28224746/008-3-1024x849.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230433/009-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mlDHsBiI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230433/009-3-1024x684.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230453/010-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yEgmm9it--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230453/010-3-1024x812.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Load Balancer
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230540/011-4.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B3wpWC5w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230540/011-4-1024x929.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select your wordpress Load Balancer created earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yu3Go74q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230604/012-2-1024x164.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yu3Go74q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230604/012-2-1024x164.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Add to load balancer button&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230636/013-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3hYnRman--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230636/013-2-1024x685.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the target group created for the Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vh8xyIG2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230802/014-2-1024x434.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vh8xyIG2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230802/014-2-1024x434.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Un-select the Enable service discovery integration&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure Autoscaling Group
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230845/015-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BbpFI-NT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28230845/015-2-1024x313.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231043/016-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tyAA_anX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231043/016-1-1024x381.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can change these variables as per your requirements. In our case, it will create two EC2 instances for us and place our WordPress website on each of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Scale UP and Scale Down policies.
&lt;/h3&gt;

&lt;p&gt;Something has to trigger an alarm so AWS EC2 can add or reduce number of instances for us. I am using CPU Utilization in our example. There are many more options.&lt;/p&gt;

&lt;p&gt;To keep it simple, we are saying that if the CPU Utilization is above 60% for 5 minutes, add another instance. If the CPU Utilization is below 50% for 5 minutes, reduce instances to just 1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231201/017-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zOzpFdM5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231201/017-1-1024x916.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231644/018-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5Jq4uwKk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231644/018-2-1024x867.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231537/019-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WnxpanFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231537/019-1-1024x785.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231620/020-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---c0Je6Fd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28231620/020-1-1024x859.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Service and Task Tabs
&lt;/h3&gt;

&lt;p&gt;Now if you go back to your Cluster, You should be able to see that the new service and task has been added.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232054/021-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aCsvWeqh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232054/021-1-1024x364.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232107/022-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qgFDuT01--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232107/022-2-1024x402.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sucess !!!!
&lt;/h2&gt;

&lt;p&gt;if everything goes well which I hope it will, Copy and past your Load Balancer DNS URL in the browser and you should see your WordPress website setup screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3N7tLy05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28233035/WordPress-Setup-Screen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3N7tLy05--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28233035/WordPress-Setup-Screen.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If, for some reason, things don’t go well and you don’t see this page. Please check how to Trouble shoot the problem below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;If something has gone wrong, your task will fail again and again. in order to find out what is wrong, click on the task and it will take you to a screen like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232451/023.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hr3EH0RI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232451/023-1024x565.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If something went wrong inside your container, you can investigate it inside the Logs tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232615/024.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FgoCBU2Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/28232615/024-1024x442.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Otherwise expand the web container under the Details tab of the task and you will see Exit code and reason why the task has failed.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ecs</category>
    </item>
    <item>
      <title>Create Task Definition for WordPress Docker Project</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Fri, 27 Dec 2019 12:44:21 +0000</pubDate>
      <link>https://dev.to/saluminati/create-task-definition-for-wordpress-docker-project-27dp</link>
      <guid>https://dev.to/saluminati/create-task-definition-for-wordpress-docker-project-27dp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id/"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we will create an ECS task definition containing our WordPress Docker image reference from ECR, Environment variables such as Database credentials, EFS volume mount for our plugins storage (Don’t worry I will shed more light on this later) and some WordPress website constants such as WP_SITE_URL etc.&lt;/p&gt;

&lt;p&gt;If you have used Docker Compose before, ECS Task Definition concept is quite similar to that.&lt;/p&gt;

&lt;p&gt;Fasten your seat belts, there will be some steps involved to get the ECS Task Definition setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before we began
&lt;/h2&gt;

&lt;p&gt;In the task definition, we will pass some environment variables such as Database host, Database name, user, password, some WordPress constants such as website URL etc.&lt;/p&gt;

&lt;p&gt;The first thing we need is the WEBSITE_URL. In the beginning, we can use the DNS name of our Load Balancer.&lt;/p&gt;

&lt;p&gt;Go to your EC2 console and select Load Balancer. You will be able to see the DNS name of your Load Balancer here. Please take a note of this URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27132803/008-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--goppUbKg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27132803/008-1-1024x447.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can change this URL once our domain is linked to the Load Balancer. This can be easily done by using &lt;strong&gt;AWS route 53&lt;/strong&gt; later.&lt;/p&gt;

&lt;p&gt;We also need our Database credentials. Go to RDS from service tab and select Database. Click on the database you have created. Under &lt;strong&gt;Connectivity &amp;amp; security&lt;/strong&gt; section, you will find the URL there. We will be using this URL soon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Task Definition
&lt;/h2&gt;

&lt;p&gt;Go to ECS from your AWS Service tab and select Task Definitions, now click on &lt;strong&gt;Create New Task Definition&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HR1oNm0A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125238/001-6-1024x286.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HR1oNm0A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125238/001-6-1024x286.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Select launch type compatibility
&lt;/h3&gt;

&lt;p&gt;We will choose EC2 on the next step&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125404/002-6.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qlqMQWFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125404/002-6-1024x498.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configure task and container definitions
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125721/003-6.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---6UFEiDt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125721/003-6-1024x873.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125806/004-6.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--784Jgn2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125806/004-6-1024x384.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will add a container which have our Docker Project along with some configurations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e9QXRH8i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125904/005-4-1024x219.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e9QXRH8i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27125904/005-4-1024x219.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27130401/006-5.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YmRXcqZv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27130401/006-5-1024x648.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can give any name to your container, in our case we have used &lt;strong&gt;web&lt;/strong&gt;. In the image field, paste your ECR repository’s latest version link. Please refer to &lt;a href="https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c"&gt;Build and Push wordpress project to AWS ECR&lt;/a&gt; &lt;strong&gt;Push to AWS ECR !&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;The reason to add 0 -&amp;gt; 80 in the port mappings is to map any port from outside world (Load Balancer in our case) to container’s port 80.&lt;/p&gt;

&lt;h3&gt;
  
  
  Environment
&lt;/h3&gt;

&lt;p&gt;This is the most important part of our container, we will pass the Database credentials to our Docker Image file along with some other configurations.&lt;/p&gt;

&lt;p&gt;We will set the following environment variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WORDPRESS_DB_HOST (RDS end point URL)

&lt;ul&gt;
&lt;li&gt;Go to RDS from service tab and select Database. Click on the database you have created. Under &lt;strong&gt;Connectivity &amp;amp; security&lt;/strong&gt; section, you will find the URL.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;WORDPRESS_DB_NAME &lt;/li&gt;
&lt;li&gt;WORDPRESS_DB_USER&lt;/li&gt;
&lt;li&gt;WORDPRESS_DB_PASSWORD

&lt;ul&gt;
&lt;li&gt;The database name, user and password you have already set while creating the RDS DB&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;WORDPRESS_CONFIG_EXTRA&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;define&lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'WP_HOME'&lt;/span&gt;, &lt;span class="s1"&gt;'http://wwordpress-elb-1695594798.ap-southeast-2.elb.amazonaws.com
'&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; define&lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'WP_SITEURL'&lt;/span&gt;, &lt;span class="s1"&gt;'http://wwordpress-elb-1695594798.ap-southeast-2.elb.amazonaws.com
'&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; define&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'CONCATENATE_SCRIPTS'&lt;/span&gt;, &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; define&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'WPINV_USE_PHP_SESSIONS'&lt;/span&gt;, &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;define&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'FS_METHOD'&lt;/span&gt;, &lt;span class="s1"&gt;'direct'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Replace wwordpress-elb-1695594798.ap-southeast-2.elb.amazonaws.com with your Load DNS URL&lt;/p&gt;

&lt;p&gt;If your wordpress website requires setting up any constant, WORDPRESS_CONFIG_EXTRA is where you can append it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27133408/009-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Us-vFMwQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27133408/009-1-1024x770.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS Logs
&lt;/h3&gt;

&lt;p&gt;Scroll down to the STORAGE AND LOGGING section and enable AWS logs. This will help to troubleshoot if there’s any issue with your website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27133643/010-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0n8AamDN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27133643/010-1-1024x685.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Add and we’re almost done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Volumes for Cache and Plugins
&lt;/h2&gt;

&lt;p&gt;Now its time to use a centralized storage for plugins. This is one of the biggest challenges I have faced when it comes to develop a high traffic multi instance WordPress website which can scale up and scale down on demand.&lt;/p&gt;

&lt;p&gt;Now its time to use our EFS file system we have created for Plugins storage and cache.&lt;/p&gt;

&lt;p&gt;We will have to create two volumes i.e. efs-plugins and efs-cache within our container. for that, Scroll down and click on &lt;strong&gt;Configure Via JSON&lt;/strong&gt; button&lt;/p&gt;

&lt;p&gt;find “volumes”: [] and add update this JSON array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;volumes"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;
        &lt;span class="pi"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;efs-plugins"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;host"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dockerVolumeConfiguration"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;autoprovision"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;labels"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scope"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;driver"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;local"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;driverOpts"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nfs"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;device"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:/"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;o"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;addr=fs-565d626f.efs.ap-southeast-2.amazonaws.com,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport"&lt;/span&gt;
                &lt;span class="pi"&gt;}&lt;/span&gt;
            &lt;span class="pi"&gt;}&lt;/span&gt;
        &lt;span class="pi"&gt;},&lt;/span&gt;
        &lt;span class="pi"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;efs-cache"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;host"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
            &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dockerVolumeConfiguration"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;autoprovision"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;labels"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scope"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;driver"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;local"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;driverOpts"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;nfs"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;device"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:/cache"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;o"&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;addr=fs-565d626f.efs.ap-southeast-2.amazonaws.com,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport"&lt;/span&gt;
                &lt;span class="pi"&gt;}&lt;/span&gt;
            &lt;span class="pi"&gt;}&lt;/span&gt;
        &lt;span class="pi"&gt;}&lt;/span&gt;
    &lt;span class="pi"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Replace fs-565d626f.efs.ap-southeast-2.amazonaws.com with your EFS volume URL.&lt;/p&gt;

&lt;p&gt;Volumes have been added now we need to mount these volumes. find “mountPoints”: [] in the JSON and update it with the following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"mountPoints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"readOnly"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"containerPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/var/www/html/wp-content/plugins"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"sourceVolume"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"efs-plugins"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"readOnly"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"containerPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/var/www/html/wp-content/cache"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"sourceVolume"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"efs-cache"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Hit Save and then click on create. Our task definition is now created and ready to rock and roll very soon !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aHKMRuct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27134925/yass.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aHKMRuct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27134925/yass.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-load-balancer-for-wordpress-website-4f8m"&gt;Create Load Balancer for WordPress website&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/putting-all-things-together-using-aws-task-definition-4n7o/"&gt;Putting all things together using AWS Task Definition&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>ecr</category>
      <category>ecs</category>
    </item>
    <item>
      <title>Create Load Balancer for WordPress website</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Fri, 27 Dec 2019 11:32:31 +0000</pubDate>
      <link>https://dev.to/saluminati/create-load-balancer-for-wordpress-website-4f8m</link>
      <guid>https://dev.to/saluminati/create-load-balancer-for-wordpress-website-4f8m</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id/"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we will create the Load Balancer which will sit on top on WordPress instances and balance the load as per increasing the requests from users. The ultimate reason for this approach is to make your website scalable and always available for our clients.&lt;/p&gt;

&lt;p&gt;From EC2 console Select Load Balancer and click on &lt;strong&gt;Create Load Balancer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ABtLFvJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114816/001-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ABtLFvJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114816/001-5.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qb9Szgtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114826/002-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qb9Szgtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114826/002-5.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On this step, select HTTP/HTTPS&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114843/003-5.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SKy0-e60--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27114843/003-5-1024x326.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step: Configure Load Balancer and VPC
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27115300/004-5.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dELAThsn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27115300/004-5-1024x534.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you select the correct VPC on this step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step: Configure Security Groups
&lt;/h3&gt;

&lt;p&gt;On this step, we will use the Security Group we created earlier for our Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27115438/005-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1_kE7LLT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27115438/005-3-1024x259.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step: Configure Routing (Target Group)
&lt;/h3&gt;

&lt;p&gt;Target Group job is to ping your instances periodically to make sure that they are healthy. If it does not receive the response from any of the instance, it raises the alarm and the instance is marked as unhealthly by the Load Balancer and an action can be taken accordingly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27120528/006-4.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9xVSJ1em--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27120528/006-4-1024x534.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;by doing all these steps, we have successfully created the mechanism for a scalable WordPress website that can serve as thousands of clients with any amazing user experience.&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c"&gt;Build and Push wordpress project to AWS ECR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-task-definition-for-wordpress-docker-project-27dp/"&gt;Create Task Definition for WordPress Docker Project&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Create AWS EFS (Elastic File System) Plugin storage for WordPress behind Load Balancer</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Fri, 27 Dec 2019 01:54:17 +0000</pubDate>
      <link>https://dev.to/saluminati/create-aws-efs-elastic-file-system-plugin-storage-for-wordpress-behind-load-balancer-3hm0</link>
      <guid>https://dev.to/saluminati/create-aws-efs-elastic-file-system-plugin-storage-for-wordpress-behind-load-balancer-3hm0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Why do we need to use EFS for plugin storage
&lt;/h1&gt;

&lt;p&gt;We all love the fact that on WordPress, we can install plugins without a deployment. Here’s the challenge with this approach, if your WordPress website is behind a Load balancer and there are multiple instances running. You will be installing the plugin only on the instance you are connected to. It will crash for the users who are connected to other instances.&lt;/p&gt;

&lt;p&gt;One simpler solution is to deploy the WordPress website again with the plugin included. It takes away the freedom of installing or un-installing a plugin without a redeployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/efs/"&gt;AWS Elastic File System (EFS)&lt;/a&gt; is our answer, we will simple mount the plugin directory of WordPress instances to our EFS.&lt;/p&gt;

&lt;p&gt;Let’s get our hands dirty folks !!!&lt;/p&gt;

&lt;h1&gt;
  
  
  Create EFS Service
&lt;/h1&gt;

&lt;p&gt;Select EFS from the service tab of your AWS console and click on &lt;strong&gt;Create file system&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the security groups we will add efs Security group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BbqhlpaS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27022325/001-4-1024x600.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BbqhlpaS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27022325/001-4-1024x600.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AAjqCeqa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27022523/002-4-1024x1022.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AAjqCeqa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27022523/002-4-1024x1022.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please use MAX/IO option optimal performance.&lt;/p&gt;

&lt;p&gt;Go ahead and finish creating the EFS setup. It will take few minutes for AWS to create our file system.&lt;/p&gt;

&lt;p&gt;In the meantime, we will SSH into our Bastian instance and install few things. Please refer to the &lt;a href="https://dev.to/saluminati/prepare-aws-security-groups-for-wordpress-project-5ebn-temp-slug-9850075"&gt;Prepare AWS Security Groups for WordPress project&lt;/a&gt; &lt;strong&gt;Connect to Bastian Instance&lt;/strong&gt; section to connect.&lt;/p&gt;

&lt;p&gt;Once you connect to the bastian instance, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;nfs-common

&lt;span class="nb"&gt;mkdir &lt;/span&gt;efs
&lt;span class="nb"&gt;mkdir &lt;/span&gt;efs/plugins
&lt;span class="nb"&gt;mkdir &lt;/span&gt;efs/cache
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We will use the same EFS for our plugins and cache (for SEO optimization later)&lt;/p&gt;

&lt;p&gt;Go to your EFS file system and copy the DNS value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KSu9eCmX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27023541/003-4-1024x387.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KSu9eCmX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27023541/003-4-1024x387.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; nfs4 &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;nfsvers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4.1,rsize&lt;span class="o"&gt;=&lt;/span&gt;1048576,wsize&lt;span class="o"&gt;=&lt;/span&gt;1048576,hard,timeo&lt;span class="o"&gt;=&lt;/span&gt;600,retrans&lt;span class="o"&gt;=&lt;/span&gt;2 fs-6f0f3156.efs.ap-southeast-2.amazonaws.com:/ efs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Please replace &lt;strong&gt;fs-6f0f3156.efs.ap-southeast-2.amazonaws.com&lt;/strong&gt; with your own file system DNS name&lt;/p&gt;

&lt;p&gt;now run the following command to make sure that the EFS is mounted correctly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5y2ZHdNA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27024131/efs-mount-1024x374.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5y2ZHdNA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27024131/efs-mount-1024x374.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I told you earlier, It’ll get easier as we will progress. Our plugins and cache storage in completed !!!!&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-mysql-database-using-aws-rds-2p7j"&gt;Create MYSQL database using AWS RDS&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c"&gt;Build and Push wordpress project to AWS ECR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>efs</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Create IAM (User, Roles and Policies)</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Thu, 26 Dec 2019 13:47:31 +0000</pubDate>
      <link>https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm</link>
      <guid>https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id/"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we will prepare our IAM User and attach &lt;a href="https://aws.amazon.com/ecr/"&gt;Amazon Elastic Container Registry (ECR)&lt;/a&gt; policy to it. It will help us to push our local Dockerized WordPress to AWS ECR.&lt;/p&gt;

&lt;p&gt;Other than that, we will create IAM Roles for our Services such as &lt;a href="https://aws.amazon.com/codedeploy/"&gt;CodeDeploy&lt;/a&gt; and &lt;a href="https://aws.amazon.com/codepipeline/"&gt;CodePipeline&lt;/a&gt; so that code is automatically deployed on change.&lt;/p&gt;

&lt;h1&gt;
  
  
  Create ECR Policy
&lt;/h1&gt;

&lt;p&gt;Login to your AWS console search IAM from the service tab and it will take you to the IAM Management Console. Click on Policies tab and select &lt;strong&gt;Create policy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063915/Screenshot_2019-12-11-IAM-Management-Console2-1024x863.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KqWRbMnr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063915/Screenshot_2019-12-11-IAM-Management-Console2-1024x863.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064108/Screenshot_2019-12-11-IAM-Management-Console3-1024x544-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I4HlqmQp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064108/Screenshot_2019-12-11-IAM-Management-Console3-1024x544-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;choose a service&lt;/strong&gt; and select &lt;strong&gt;Elastic Container Registry&lt;/strong&gt;. In the resource section, Select all resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064334/Screenshot_2019-12-11-IAM-Management-Console4-1024x731.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ObkL_Nqv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064334/Screenshot_2019-12-11-IAM-Management-Console4-1024x731.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give your policy a name and write that name down somewhere.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064454/Screenshot_2019-12-11-IAM-Management-Console6-1024x506.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r_LAUGVG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064454/Screenshot_2019-12-11-IAM-Management-Console6-1024x506.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Create IAM User
&lt;/h1&gt;

&lt;p&gt;We will now create an IAM User and attach the ECR policy we have create earlier.&lt;/p&gt;

&lt;p&gt;From your IAM Management Console. Click on Users tab and select Add user and follow the simple steps to assign the newly created policy to the IAM User.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064522/Screenshot_2019-12-11-IAM-Management-Console-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BLm4wExX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064522/Screenshot_2019-12-11-IAM-Management-Console-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064549/Screenshot_2019-12-11-IAM-Management-Console7-1024x491.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---zv8wZwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064549/Screenshot_2019-12-11-IAM-Management-Console7-1024x491.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finish all the steps until you see the following screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064609/Screenshot_2019-12-11-IAM-Management-Console8-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wszxL937--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064609/Screenshot_2019-12-11-IAM-Management-Console8-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download the CSV file, we need the credentials in that file in order to push our wordpress docker build to AWS ECR in the next article.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>iam</category>
    </item>
    <item>
      <title>Prepare AWS Security Groups for WordPress project</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Thu, 26 Dec 2019 09:53:54 +0000</pubDate>
      <link>https://dev.to/saluminati/prepare-aws-security-groups-for-wordpress-project-5ebd</link>
      <guid>https://dev.to/saluminati/prepare-aws-security-groups-for-wordpress-project-5ebd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; We will do a lot of configuration in this article. It may look time consuming but it will lay the foundation for all the communication such as WordPress website with MYSQL and Plugins storage.&lt;/p&gt;

&lt;p&gt;We will prepare our security groups for AWS Services such as Load Balancer, RDS (MYSQL database), EFS (for plugins storage) and EC2 instances.&lt;/p&gt;

&lt;p&gt;I have created these Groups having security in mind, we should not open any unnecessary port on any service.&lt;/p&gt;

&lt;p&gt;Our main agenda is to Place Load Balancer on top to face the outside world (people who want to access our wordpress website), Load Balancer will then send that request to any of the instances hosting the WordPress website and respond with content received from the WordPress EC2 instance.&lt;/p&gt;

&lt;p&gt;Other than that, WordPress EC2 instance can talk to RDS (MYSQL), EFS (plugins storage) as per required. Please take a look at the following diagram for better understanding of this kind of architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26105856/FI.jpeg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yZXXn5vh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26105856/FI-1024x842.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Security Groups
&lt;/h2&gt;

&lt;p&gt;We will create the SGs (security groups) for our services so they can talk to each other on the same VPC.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SG for Load Balancer&lt;/li&gt;
&lt;li&gt;SG for EC2 instance&lt;/li&gt;
&lt;li&gt;SG for RDS (MYSQL)&lt;/li&gt;
&lt;li&gt;SG for EFS (storage for plugins)&lt;/li&gt;
&lt;li&gt;SG for Bastian host&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Login to your AWS console and click on EC2 from the Services menu, we will take notes of the security groups IDS while you create them.&lt;/p&gt;

&lt;p&gt;From EC2 console, click on Security groups&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uOVGJeZd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26100905/001-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uOVGJeZd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26100905/001-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Create Security Group&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jloh75JM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101001/002-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jloh75JM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101001/002-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please make sure all the Security Groups you are creating use the same VPC.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Group for Load Balancer
&lt;/h3&gt;

&lt;p&gt;The first Security Group is for the Load Balancer. For outside world, it will enable HTTP (Port 80) in the Inbound Rules. Please select the Inbound tab and click on Add Rule.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101113/003-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MUPPTuE0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101113/003-2-1024x552.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once this SG is created, we will note down its Group ID. which will be used while creating the EC2 instance (WordPress host) SG.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101152/004-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TYDbry_H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101152/004-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Group for WordPress instance
&lt;/h3&gt;

&lt;p&gt;Click on Create Security Group again, we will now create a security group for our EC2 instance where our WordPress project will be deployed. We’ll add an Inbound Rule which will open all the ports for our Load Balancer ONLY.&lt;/p&gt;

&lt;p&gt;For that, Add a rule to Inbound with All TCP as type and Custom as the source. Paste the Group ID of the Load Balancer Security group we have created earlier. This will ensure that no one else can access this instance except the Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101311/005-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZhePXNhO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26101311/005-1-1024x552.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit Create and take a note of Group ID of this SG.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Group for Bastian host
&lt;/h3&gt;

&lt;p&gt;We will create an EC2 instance (Bastian host) which we can connect from our local computer to test RDS and EFS or in some cases if we need to connect and troubleshoot our WordPress EC2 instance. This can come in very handy.&lt;/p&gt;

&lt;p&gt;This time we will Create a New Security Group with SSH (Port 22) enabled so we can connect to this instance over SSH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26102849/008.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kcxICy_o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26102849/008-1024x552.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please create a take a note of Bastian Security Group, we will reference in EFS and RDS SGs&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Group for EFS and RDS
&lt;/h3&gt;

&lt;p&gt;Now we will create Security Groups for RDS and EFS (enabling Port 3306 and 2049 respectively) and put Group ID of our WordPress and Bastian as a Custom source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27110431/sg-efs-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GHysMZZP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27110431/sg-efs-1-1024x414.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27110818/sg-rds.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WQmjRJ4z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27110818/sg-rds-1024x436.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; By adding Group ID of Bastian into the Inbound rules of EFS and RDS Security Groups will allow us to configure EFS from Bastian and will also let us connect to RDS (MYSQL) database via Bastian if required.&lt;/p&gt;

&lt;p&gt;Most of our work with Security Groups is done here except one more step which is also a good practice for security.&lt;/p&gt;

&lt;p&gt;One more tweak and we’re done with SGs I PROMISE.&lt;/p&gt;

&lt;p&gt;Please copy the Group ID of the Bastian SG we just created and select the Security Group of our WordPress instance and click on Inbound tab at the bottom. Click Edit to add a new Inbound Rule&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26103350/010.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uAski-0A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26103350/010-1024x318.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select SSH as type and Custom as Source, now past the Group ID of the Bastian Security Group we created earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eN8YcMXq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27111559/wp-instance-update-1024x380.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eN8YcMXq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27111559/wp-instance-update-1024x380.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By doing this, we add an exception for our Bastian instance so it can connect to our WordPress instance if we want to.&lt;/p&gt;

&lt;h1&gt;
  
  
  Create Bastian Instance
&lt;/h1&gt;

&lt;p&gt;In the EC2 console, Click on Key pairs and select Create Key Pair.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7fCfzS-b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111428/011.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7fCfzS-b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111428/011.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sgG2GRkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111436/012.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sgG2GRkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111436/012.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give it a and Download the .PEM file on your computer&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bYYWGUXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111708/013.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bYYWGUXw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111708/013.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is very important to keep this file safe and secure. There is no backup of this file on AWS.&lt;/p&gt;

&lt;p&gt;Let’s create our Bastian instance.&lt;/p&gt;

&lt;p&gt;Click on Instances from the EC2 console and select Launch instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7gl2GWt0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111923/014.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7gl2GWt0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111923/014.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--exhjQMml--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111930/015.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--exhjQMml--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26111930/015.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are using ubuntu 18 with Free tier. Because it is the bastian host and not doing much except enabling us to connect to it from our local machine and to let us connect to the wordpress instance for troubleshooting or testing services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112403/016.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ii6XSOUL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112403/016-1024x293.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AKnHjT4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112412/017-1024x84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AKnHjT4_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112412/017-1024x84.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select free Tier in instance type section and hit configure instance details at the bottom&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26113044/instance-type-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWjTNcJt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26113044/instance-type-1-1024x483.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the configure Instance section, make sure you select the same VPC you have used while creating all the Security groups earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112420/018.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--paKABNxL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112420/018.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to next step i.e Add tags and give your instance a name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26113358/tags.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TaNUD96q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26113358/tags-1024x412.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the section below, use the Bastian Security Group you have created earlier which enables port 22 in Inbound rules.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112429/019.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ANQAFpMe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112429/019-1024x549.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Review and you will see the following screen. Select the Key Pair you have created and it will create the instance for us.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sT-8ymMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112437/020.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sT-8ymMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112437/020.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you will go to instances, you will see that your bastian instance has been created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nyoX8nDC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112517/021-1024x139.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nyoX8nDC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26112517/021-1024x139.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Connect to Bastian Instance
&lt;/h1&gt;

&lt;p&gt;Now &lt;strong&gt;FINALLY&lt;/strong&gt; we are about to do something exciting after all this configuration. It’ll only get better from this point &lt;strong&gt;TRUST&lt;/strong&gt; me !!&lt;/p&gt;

&lt;p&gt;We have done most of the heavy lifting&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d4G0suAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media.tenor.com/images/232b0f9956bf78e8e5e10064491d27b1/tenor.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d4G0suAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media.tenor.com/images/232b0f9956bf78e8e5e10064491d27b1/tenor.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open your terminal and go the directory where you have downloaded the Key Pair PEM file. Run the following commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# To protect a file against accidental overwriting. &lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;400 wwordpress-key.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once we’re done with the chmod 400. Time to connect to our bastian instance YASSSS !!!!&lt;/p&gt;

&lt;p&gt;Click on your bastian EC2 intance and copy the public DNS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26114939/022-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yzZyPA-B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26114939/022-1-1024x253.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the following command from your directory where your PEM file is located.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; wwordpress-key.pem ubuntu@ec2-3-106-167-129.ap-southeast-2.compute.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Replace &lt;strong&gt;wwordpress-key.pem&lt;/strong&gt; and &lt;strong&gt;ec2-3-106-167-129.ap-southeast-2.compute.amazonaws.com&lt;/strong&gt; with your Key Pair PEM file name and instance public DNS. You should see the following output on your terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26115828/ssh-ubuntu.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6Va4G1dd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26115828/ssh-ubuntu.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are now connected to our Bastian Instance via SSH.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3kpvYL_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26122010/cookie.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3kpvYL_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/26122010/cookie.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4"&gt;Dockerize WordPress with themes, plugins and common configuration&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm"&gt;Create IAM (User, Roles and Policies)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>securitygroups</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>High Traffic WordPress website with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Thu, 12 Dec 2019 10:25:04 +0000</pubDate>
      <link>https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id</link>
      <guid>https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id</guid>
      <description>&lt;p&gt;This series will help you with setting up Dockerized WordPress website on you local machine and fully automate the deployment process to Amazon Web Services.&lt;/p&gt;

&lt;p&gt;The website will be ready for heavy traffic. To achieve this, I have created the following topics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;WordPress on AWS, the challenges&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4"&gt;Dockerize WordPress with themes, plugins and common configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/prepare-aws-security-groups-for-wordpress-project-5ebd"&gt;Prepare AWS Security Groups for WordPress project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm"&gt;Create IAM (User, Roles and Policies)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/create-mysql-database-using-aws-rds-2p7j"&gt;Create MYSQL database using AWS RDS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/create-aws-efs-elastic-file-system-plugin-storage-for-wordpress-behind-load-balancer-3hm0"&gt;Create AWS EFS (Elastic File System) Plugin storage for WordPress behind Load Balancer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c"&gt;Build and Push wordpress project to AWS ECR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/create-load-balancer-for-wordpress-website-4f8m"&gt;Create Load Balancer for WordPress website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/create-task-definition-for-wordpress-docker-project-27dp"&gt;Create Task Definition for WordPress Docker Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/saluminati/putting-all-things-together-using-aws-task-definition-4n7o"&gt;Putting all things together using AWS Task Definition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;AWS Codepipeline (Coming soon)&lt;/li&gt;
&lt;li&gt;Speed up your WordPress website for better SEO (Coming soon)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I know it sounds a bit harsh saying that WordPress is not civilized enough for AWS but hear me out !&lt;/p&gt;

&lt;p&gt;I have been working with modern frameworks such as Rails, Laravel and reactJS for some time now. All these frameworks have evolved so much overtime and ready for multi environments, CI/CD, Load balancers and the list goes on.&lt;/p&gt;

&lt;p&gt;Our main product is built on Rails and its fully automated with AWS CI/CD and other automation. Sound great isn’t it?&lt;/p&gt;

&lt;p&gt;We recently decided to separate our behind the paywall application and content from each other. In simple words, our complex application (built in Rails) will stay as it is. On the other hand, for content such as blog, marketing pages and few other things such as recipes will be on WordPress.&lt;/p&gt;

&lt;p&gt;I will take you through the journey of the whole process and lessons I have learnt during this process of making WordPress shine on AWS with CI/CD, Load balancers and how much WordPress is not ready for that transition by default.&lt;/p&gt;

&lt;p&gt;So Let’s make WordPress up its game !&lt;/p&gt;

&lt;p&gt;Let’s begin with the challenges I have faced and then you can make the call if these are the right series of tutorials for you or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  1 | Load balancer and bloody plugins
&lt;/h2&gt;

&lt;p&gt;We all love the fact that on WordPress, we can install plugins without a deployment. Here’s the challenge with this approach, if your WordPress website is behind a Load balancer and there are multiple instances running. You will be installing the plugin only on the instance you are connected to. It will crash for the users who are connected to other instances.&lt;/p&gt;

&lt;p&gt;One simpler solution is to deploy the WordPress website again with the plugin included. It takes away the freedom of installing or un-installing a plugin without a redeployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/efs/" rel="noopener noreferrer"&gt;AWS Elastic File System (EFS)&lt;/a&gt; is our answer, we will simple mount the plugin directory of WordPress instances to our EFS. Please take a look at the diagram below:&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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27021517%2FFI-2-1024x682.jpeg" 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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27021517%2FFI-2-1024x682.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS EFS is not just highly available, its IO operations are blazing fast. Don’t worry it won’t slow your website down at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 | Centralized MYSQL Database
&lt;/h2&gt;

&lt;p&gt;Most of the people are probably using AWS RDS already with their WordPress websites. We will be using the same too. Just a centralized database for WordPress website behind Load Balancer.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 | De-couple variables stored in Database and DO NOT configure the Apache or Ngnix every time
&lt;/h2&gt;

&lt;p&gt;Simple as it sounds, variables such as SITE_URL will not be stored in MYSQL database. You know we always have to configure Apache or Ngninx for the wordpress websites.&lt;/p&gt;

&lt;p&gt;A lot of people create/use &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html" rel="noopener noreferrer"&gt;Amazon Machine Images (AMI)&lt;/a&gt; for that purpose. the only problem with using AMI is configuration changes. You will have to create a new AMI on every change you make. Damn what a waste of time.&lt;/p&gt;

&lt;p&gt;We will have a boiler plate WordPress Docker template which can kick start any WordPress website in minutes without configuring Apache, Ngnix and other settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 | Website performance and SEO challenges
&lt;/h2&gt;

&lt;p&gt;There are so many plugins available for WordPress website performance boost. I will share the ones I have used and what have worked for us in the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 | AWS Elastic Container Service
&lt;/h2&gt;

&lt;p&gt;Finally, How to use &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html" rel="noopener noreferrer"&gt;Amazon Elastic Container Service&lt;/a&gt; which includes the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://aws.amazon.com/ecr/" rel="noopener noreferrer"&gt;Amazon Elastic Container Registry (ECR)&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Our Docker build repository that contains our most recent Dockerized WordPress project with all the server configurations&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html" rel="noopener noreferrer"&gt;Amazon ECS Task Definitions&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;This is where we use our Docker build and put all the variables for our WordPress website; Remember we’re not keeping our website variables in the database.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html" rel="noopener noreferrer"&gt;Amazon ECS Clusters&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;This is where it creates the EC2 instances of your WordPress website using the ECS Task Definitions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4"&gt;Dockerize WordPress with themes, plugins and common configuration&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>ecr</category>
      <category>ecs</category>
    </item>
    <item>
      <title>Create MYSQL database using AWS RDS</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Wed, 11 Dec 2019 05:20:47 +0000</pubDate>
      <link>https://dev.to/saluminati/create-mysql-database-using-aws-rds-2p7j</link>
      <guid>https://dev.to/saluminati/create-mysql-database-using-aws-rds-2p7j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The purpose of creating MYSQL database using AWS RDS is quite simple. Centralized, automatic backups, scalable and highly available. What else we can ask for when it comes to MYSQL.&lt;/p&gt;

&lt;p&gt;For wordpress there are two main options to choose your database from. &lt;strong&gt;Amazon Aurora&lt;/strong&gt; and &lt;strong&gt;MYSQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon Aurora&lt;/strong&gt; is also compatible with MYSQL. Aurora is better but more expensive than regular MYSQL RDS database.&lt;/p&gt;

&lt;p&gt;In our example, we are using the regular &lt;strong&gt;MYSQL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s begin creating the RDS database for our blog&lt;/p&gt;

&lt;h2&gt;
  
  
  Create RDS Database
&lt;/h2&gt;

&lt;p&gt;Find and select the RDS service under the service tab. Click on &lt;strong&gt;create database&lt;/strong&gt;. Follow the instructions below:&lt;/p&gt;

&lt;p&gt;Before we begin, please change things such as database size, names and other identifiers as per your requirements&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pDEZrZ5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012826/001-3-1024x379.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pDEZrZ5t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012826/001-3-1024x379.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d3-RNgRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012924/002-3-1024x899.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d3-RNgRq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012924/002-3-1024x899.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TtX6NzSa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012958/003-3-951x1024.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TtX6NzSa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27012958/003-3-951x1024.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DB instance identifier is not the database name&lt;/li&gt;
&lt;li&gt;Keep the Master username and password secure, we will need it later on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the Master username and password secure, we will need it later on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_sKm-DvB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27013050/004-3-1024x421.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_sKm-DvB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27013050/004-3-1024x421.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DB instance size totally depends upon your traffic. We’re just using the bare minimum.&lt;/p&gt;

&lt;p&gt;In the connectivity section below, use the rds Security Group we have created earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27014150/vpc-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--InGoRs1T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27014150/vpc-1-802x1024.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where you are creating the initial database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27014454/006-3.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SMov6HCc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27014454/006-3-1024x548.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm/"&gt;Create IAM (User, Roles and Policies)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://dev.to/saluminati/create-aws-efs-elastic-file-system-plugin-storage-for-wordpress-behind-load-balancer-3hm0/"&gt;&lt;strong&gt;Create AWS EFS (Elastic File System) Plugin storage for WordPress behind Load Balancer&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>rds</category>
    </item>
    <item>
      <title>Build and Push wordpress project to AWS ECR</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Wed, 11 Dec 2019 02:06:18 +0000</pubDate>
      <link>https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c</link>
      <guid>https://dev.to/saluminati/build-and-push-wordpress-project-to-aws-ecr-2h7c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id/"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Build and Tag WordPress Docker project
&lt;/h1&gt;

&lt;p&gt;As we have already set up our WordPress Docker project in &lt;a href="https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4"&gt;Dockerize WordPress with themes, plugins and common configuration&lt;/a&gt; article. Its time to Tag and push our WordPress project to AWS ECR.&lt;/p&gt;

&lt;p&gt;You can also download the Docker WordPress project used in this tutorial series from &lt;a href="https://github.com/saluminati/personal-docker-blog"&gt;https://github.com/saluminati/personal-docker-blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to you wordpress project root directory and execute the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;
docker build &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You should see something like that on the console&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24062939/Screen-Shot-2019-12-11-at-12.39.25-pm-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YG1ff1Xt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24062939/Screen-Shot-2019-12-11-at-12.39.25-pm-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to tag the build, for that, please run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;
docker images
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063028/Screen-Shot-2019-12-11-at-12.41.41-pm-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V91TNOGq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063028/Screen-Shot-2019-12-11-at-12.41.41-pm-1.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# for you: replace --image-- with your image_id&lt;/span&gt;
&lt;span class="c"&gt;# replace salman-docker-blog with the name your prefer&lt;/span&gt;

docker tag &lt;span class="nt"&gt;--image--&lt;/span&gt; salman-docker-blog:v0.0.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Run docker images command and you should see your image tagged properly&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063103/Screen-Shot-2019-12-11-at-12.44.46-pm-1024x89.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mawohDjl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24063103/Screen-Shot-2019-12-11-at-12.44.46-pm-1024x89.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Push the Docker build to ECR
&lt;/h1&gt;

&lt;p&gt;Please follow this &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv1.html"&gt;link&lt;/a&gt; to install AWS cli on your local machine.&lt;/p&gt;

&lt;p&gt;Once its installed, you should be able to run the following command on your console to configure AWS IAM User credentials you have recently downloaded as a CSV file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Please use the credentials from the CSV file you have downloaded in &lt;a href="https://dev.to/saluminati/create-iam-user-roles-and-policies-pmm/"&gt;Create IAM (User, Roles and Policies)&lt;/a&gt; article.&lt;/p&gt;

&lt;p&gt;It will ask for AWS Key ID, Secret Key and AWS region. Please use the appropriate region.&lt;/p&gt;

&lt;p&gt;More information about AWS regions are available &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create ECR Repository
&lt;/h2&gt;

&lt;p&gt;In this section, we will create a ECR repository on AWS and push our docker build by using AWS cli.&lt;/p&gt;

&lt;p&gt;Let’s do this !&lt;/p&gt;

&lt;p&gt;Go to AWS service tab and search ECR. Click on create repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064708/Screenshot_2019-12-11-Amazon-ECR-1.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UdYExVgx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064708/Screenshot_2019-12-11-Amazon-ECR-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you enable Tag Immutability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064746/Screenshot_2019-12-11-Amazon-ECR1-2.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m1YmRORK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064746/Screenshot_2019-12-11-Amazon-ECR1-2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the repository URI, we will use it in the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Push to AWS ECR !
&lt;/h2&gt;

&lt;p&gt;Finally !!!! we are now ready to push our Docker build to Amazon AWS&lt;/p&gt;

&lt;p&gt;Go to your console and run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-t&lt;/span&gt; salman-docker-blog

docker tag salman-docker-blog:latest &amp;lt;repouri&amp;gt;:v1.0.0&amp;lt;/repouri&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Please replace the  with your ECR repository you have created earlier.&lt;/p&gt;

&lt;p&gt;Now your docker image is tagged, time to push it. For that, you will need to run the following command on console to login to AWS ECR service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr get-login &lt;span class="nt"&gt;--no-include-email&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This command will print a long string on your console screen. Please copy that long string and paste it to your console again. That will log you in to ECR Service. Once you paste the code and hit enter, you should be able to see &lt;strong&gt;Login Succeeded&lt;/strong&gt; message.&lt;/p&gt;

&lt;p&gt;Now to final command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker push &amp;lt;repouri&amp;gt;:v1.0.0&amp;lt;/repouri&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When you will click on your repository in AWS ECR. You will be able to see that version 1.0.0 is being pushed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064815/Screenshot_2019-12-11-Amazon-ECR2-1024x332.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XCvW9mn---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24064815/Screenshot_2019-12-11-Amazon-ECR2-1024x332.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-aws-efs-elastic-file-system-plugin-storage-for-wordpress-behind-load-balancer-3hm0/"&gt;Create AWS EFS (Elastic File System) Plugin storage for WordPress behind Load Balancer&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/saluminati/create-load-balancer-for-wordpress-website-4f8m/"&gt;Create Load Balancer for WordPress website&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>ecr</category>
    </item>
    <item>
      <title>Dockerize WordPress with themes, plugins and common configuration</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Tue, 10 Dec 2019 04:37:29 +0000</pubDate>
      <link>https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4</link>
      <guid>https://dev.to/saluminati/dockerize-wordpress-with-themes-plugins-and-common-configuration-2am4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This article is the continuation of &lt;a href="https://dev.to/saluminati/high-traffic-wordpress-website-with-docker-aws-ecs-code-pipeline-load-balancer-rds-efs-complete-series-43id"&gt;WordPress with Docker, AWS (ECS, Code Pipeline, Load Balancer, RDS, EFS) Complete Series&lt;/a&gt;. For better understating, please start from the beginning of the series.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, we will create the following files and folders&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24061758/wordpress-directory-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F24061758%2Fwordpress-directory-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s create files and folders&lt;/p&gt;

&lt;p&gt;Creating Dockfile&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;touch &lt;/span&gt;Dockerfile


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Creating development directory and docker-compose file&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;mkdir &lt;/span&gt;development &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;touch &lt;/span&gt;development/docker-compose.yml


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Creating themes and plugins directories&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;mkdir &lt;/span&gt;themes &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; plugins


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Creating config directory and uploads.ini file&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;mkdir &lt;/span&gt;config &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;touch &lt;/span&gt;config/uploads.ini


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Creating entrypoint-child.sh file&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;touch &lt;/span&gt;entrypoint-child.sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Dockerfile
&lt;/h2&gt;

&lt;p&gt;Paste the following content into the Dockerfile&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;

&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; wordpress:latest&lt;/span&gt;

&lt;span class="c"&gt;# Copying Themes and Plugins into the wordpress image&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; ["themes","/usr/src/wordpress/wp-content/themes"]&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; ["plugins","/usr/src/wordpress/wp-content/plugins"]&lt;/span&gt;

&lt;span class="c"&gt;# Updating the configuration of wordpress image with our own&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; ./config/uploads.ini /usr/local/etc/php/conf.d/uploads.ini&lt;/span&gt;

&lt;span class="c"&gt;# Applying the execution right on the folders for apache&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; entrypoint-child.sh /usr/bin/&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x /usr/bin/entrypoint-child.sh
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt;&lt;span class="s"&gt; ["entrypoint-child.sh"]&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["apache2-foreground"]&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  entrypoint-child.sh
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Adding permissions"&lt;/span&gt;
&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/html/wp-content &amp;amp;amp&lt;span class="p"&gt;;&lt;/span&gt;
find /var/www/html/wp-content &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;chmod &lt;/span&gt;0755 &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; &amp;amp;amp&lt;span class="p"&gt;;&lt;/span&gt;
find /var/www/html/wp-content &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;chmod &lt;/span&gt;644 &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt; &amp;amp;amp&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Permissions added"&lt;/span&gt;

&lt;span class="nb"&gt;exec &lt;/span&gt;docker-entrypoint.sh &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Our WordPress Docker image ( &lt;strong&gt;wordpress:latest&lt;/strong&gt; ) already contains an entry point. which is called &lt;strong&gt;docker-entrypoint.sh&lt;/strong&gt;. The reason have added our custom entrypoint file into the mix is because of AWS EFS volumes for our Plugins storage on AWS. That is why we need some permissions to be added again. This entrypoint just add those permissions and then execute the image default entrypoint. Don’t worry about this for now, I will shed more light on it as we progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  uploads.ini config
&lt;/h2&gt;

&lt;p&gt;Paste the following content into config/uploads.ini file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;

&lt;span class="py"&gt;file_uploads&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;On&lt;/span&gt;
&lt;span class="py"&gt;memory_limit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;64M&lt;/span&gt;
&lt;span class="py"&gt;upload_max_filesize&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;64M&lt;/span&gt;
&lt;span class="py"&gt;post_max_size&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;64M&lt;/span&gt;
&lt;span class="py"&gt;max_execution_time&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;600&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Please change the above as per your wordpress website requirements&lt;/p&gt;

&lt;h2&gt;
  
  
  docker-compose
&lt;/h2&gt;

&lt;p&gt;Paste the following content into development/docker-compose.yml file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3'&lt;/span&gt;
&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;wordpress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;../&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8000:80"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;blog_db_name&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_CONFIG_EXTRA&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;/* If you want to add any extra wordpress config */&lt;/span&gt;
        &lt;span class="s"&gt;# define('WP_ALLOW_MULTISITE', true );&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;wordpress:/var/www/html&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mysql:5.7&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;logging&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;driver&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;none&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_USERNAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_DATABASE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;blog_db_name&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db:/var/lib/mysql&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;wordpress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We have created two service in the docker-compose file&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wordpress&lt;/li&gt;
&lt;li&gt;db&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;WordPress service is building a Docker image from the Dockerfile we have created in the begining&lt;/p&gt;

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

build: ../


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above line is telling the docker-compose to build the image from a Dockerfile which is on the root of this project&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8000:80"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above command is just mapping the 8000 port from outside world to the port 80 of this container&lt;/p&gt;

&lt;p&gt;We are also setting some environment variables such as database credentials which are initialized in the &lt;strong&gt;db&lt;/strong&gt; service&lt;/p&gt;

&lt;h2&gt;
  
  
  Time to see something on the browser !!!
&lt;/h2&gt;

&lt;p&gt;All the required files and directories have been created. Let’s start our wordpress website by running the following commands&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;development
docker-compose build
docker-compose up


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Open your web browser and type &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt; and you should be able to see this page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/24062111/Screenshot_2019-12-10-WordPress-%E2%80%BA-Installation-2.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F24062111%2FScreenshot_2019-12-10-WordPress-%25E2%2580%25BA-Installation-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Next
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://salzam.com/prepare-aws-security-groups-for-wordpress-project/" rel="noopener noreferrer"&gt;Prepare AWS Security Groups for WordPress project&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>dockercompose</category>
    </item>
    <item>
      <title>AWS – Using Multiple (Staging, UAT and Production) Accounts Under AWS Organization</title>
      <dc:creator>Salman Sohail</dc:creator>
      <pubDate>Tue, 10 Dec 2019 04:11:18 +0000</pubDate>
      <link>https://dev.to/saluminati/aws-using-multiple-staging-uat-and-production-accounts-under-aws-organization-2jng</link>
      <guid>https://dev.to/saluminati/aws-using-multiple-staging-uat-and-production-accounts-under-aws-organization-2jng</guid>
      <description>&lt;p&gt;This article assumes that you want to have separate AWS console accounts such as Staging, UAT and Production at one place.&lt;/p&gt;

&lt;p&gt;The best way to achieve this kind of separation is by using &lt;a href="https://console.aws.amazon.com/organizations/home" rel="noopener noreferrer"&gt;AWS Organizations&lt;/a&gt; and AWS Single Sign-On (SSO)&lt;/p&gt;

&lt;p&gt;AWS Organizations provides all the necessary options to achieve this goal.&lt;/p&gt;

&lt;p&gt;Okay enough talk, Lets do this !&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Organization
&lt;/h2&gt;

&lt;p&gt;Search AWS Organization in the service tab and then create your organization&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140025/001-7.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140025%2F001-7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will receive a confirmation email soon. Once you verify your master account, You’re good to go !&lt;/p&gt;

&lt;h2&gt;
  
  
  Add/Invite AWS accounts
&lt;/h2&gt;

&lt;p&gt;You can associate an existing AWS account to your organization or you can create a new one.&lt;/p&gt;

&lt;p&gt;In our example we will create a new one by clicking on Add Account&lt;/p&gt;

&lt;p&gt;You can also use Organizational Units (OUs) for more hierarchical structure. We will use a simpler approach in our example which can be easily transformed into OUs in the future.&lt;/p&gt;

&lt;p&gt;This is our structure for now&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140049/002.jpeg" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140049%2F002.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets start by adding these accounts into your organization&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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140108%2F003-7.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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140108%2F003-7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose Create account and fill Full Name (Staging, dev and production etc) and Email, leave the IAM role name for now ( we will add roles and policies on the AWS Accounr level later )&lt;/p&gt;

&lt;p&gt;Repeat the same for each account you want to create such as Staging, UAT and Production&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140158/004-7.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140158%2F004-7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Single Sign-On (SSO)
&lt;/h2&gt;

&lt;p&gt;From services tab select AWS Single Sign-On (SSO) and click on &lt;strong&gt;Enable AWS SSO&lt;/strong&gt;. Once its enabled, you should be able to see the following options&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140220/005-5.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140220%2F005-5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets start with the first step &lt;strong&gt;Choose your identity source&lt;/strong&gt;. You can click on that option and change the User portal URL. This will be a portal page for your team to login and select the AWS account they are associated with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Users and Groups
&lt;/h2&gt;

&lt;p&gt;Now lets create Users and Groups that we can associate with AWS accounts later on.&lt;/p&gt;

&lt;p&gt;Click on the &lt;strong&gt;Users&lt;/strong&gt; on the left and select &lt;strong&gt;Add User&lt;/strong&gt;&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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140246%2F006-6.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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140246%2F006-6.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill in all the details and leave &lt;strong&gt;Groups&lt;/strong&gt; as it is for now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140301/007-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140301%2F007-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add as many users you want to add by repeating the same steps.&lt;/p&gt;

&lt;p&gt;Lets create our &lt;strong&gt;Groups&lt;/strong&gt; now. In my case I have created Development and Production groups&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140322/008-2.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140322%2F008-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Time to assign the &lt;strong&gt;Users&lt;/strong&gt; to the &lt;strong&gt;Groups&lt;/strong&gt;. Click on the Users tab and select the user you want to associate with a group. Once you select the user, you’ll be able to see &lt;strong&gt;Groups&lt;/strong&gt; tabs&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140342/009-2.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140342%2F009-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Add to group&lt;/strong&gt; and assign the user to one or multiple groups&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Accounts
&lt;/h2&gt;

&lt;p&gt;This is the final step I PROMISE. Its time to associate the users with the AWS accounts ( You have created in the organization ). For that you need to click on AWS account tab on the left.&lt;/p&gt;

&lt;p&gt;Click on the on the desired AWS account and select &lt;strong&gt;Assign Users&lt;/strong&gt;&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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140403%2F010-2.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%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140403%2F010-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140424/011-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140424%2F011-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the &lt;strong&gt;Groups&lt;/strong&gt; tab and choose the User’s group you want to associate with this Account. Click on &lt;strong&gt;Next: Permission set&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140447/012-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140447%2F012-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Create new permission set&lt;/strong&gt;. You have have two options to choose from on the next page. In our example, we are selecting &lt;strong&gt;Use an existing job function policy&lt;/strong&gt; and the &lt;strong&gt;AdministratorAccess&lt;/strong&gt; policy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140506/013-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140506%2F013-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can create a custom permission set as per your policies if you want&lt;/p&gt;

&lt;p&gt;On the final page, tick on the permission set you just have created and hit Finish YEAYYYYYYYY !!!!!!!&lt;/p&gt;

&lt;p&gt;When you go to the portal ( created earlier in the post ). You will see login screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140533/014-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140533%2F014-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login with any of the user from the associated group and you be able to see the following.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://s3-ap-southeast-2.amazonaws.com/sal-blog/wp-content/uploads/2019/12/27140554/015-1.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3-ap-southeast-2.amazonaws.com%2Fsal-blog%2Fwp-content%2Fuploads%2F2019%2F12%2F27140554%2F015-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can click on the Management console of any AWS account and Bingo. you’re in that environment’s AWS account !&lt;/p&gt;

</description>
      <category>aws</category>
      <category>awsorganization</category>
      <category>slider</category>
    </item>
  </channel>
</rss>
