<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Barialai Farahi on Medium]]></title>
        <description><![CDATA[Stories by Barialai Farahi on Medium]]></description>
        <link>https://medium.com/@bob.farahi?source=rss-d6f1dd1b8f2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PBvRyiR1PebB3OxfGVF9Cw.jpeg</url>
            <title>Stories by Barialai Farahi on Medium</title>
            <link>https://medium.com/@bob.farahi?source=rss-d6f1dd1b8f2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 06:11:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bob.farahi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HumanGov: Deployment Of A Reusable Saas Multi-tenant AWS Infrastructure Using Terraform Modules…]]></title>
            <link>https://medium.com/@bob.farahi/humangov-deployment-of-a-reusable-saas-multi-tenant-aws-infrastructure-using-terraform-modules-a50f14c655a7?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a50f14c655a7</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[codecommit]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Wed, 24 Jul 2024 12:52:52 GMT</pubDate>
            <atom:updated>2024-07-24T12:52:52.947Z</atom:updated>
            <content:encoded><![CDATA[<p><em>HumanGov: Deployment Of A Reusable Saas Multi-tenant AWS Infrastructure Using Terraform Modules Securely Storing Terraform Configuration Files On AWS Code Commit.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9xnKV5FyT6iIa6HCXbScg.jpeg" /></figure><p>In this project based on a real-world scenario, I designed and deployed a reusable, multi-tenant SaaS infrastructure on AWS using Terraform modules.</p><p>The infrastructure was based on AWS services such as EC2 instances, DynamoDB databases, and S3 buckets. To ensure the secure storage of Terraform configuration files, I used AWS CodeCommit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sza7LJiuU52_YpnMEW7-KQ.png" /></figure><p>Create a directory named human-gov-infrastructure folder</p><p>cd human-gov-infrastructure</p><p>Create a root directory folder to store Terraform files:<br>mkdir terraform</p><p>Create a new directory called modules/aws_humangov_infrastructure to hold the module files:<br>cd terraform<br>mkdir -p modules/aws_humangov_infrastructure</p><p>​<br>Inside the modules/aws_humangov_infrastructure directory, create the following empty files:<br>cd modules/aws_humangov_infrastructure<br>touch variables.tf main.tf outputs.tf</p><p>​<br>Edit the files accordingly:<br>variables.tf<br>variable “state_name” {<br> description = “The name of the US State”<br>}</p><p>​<br>main.tf<br>resource “aws_security_group” “state_ec2_sg” {<br> name = “humangov-${var.state_name}-ec2-sg”<br> description = “Allow traffic on ports 22 and 80”</p><p>ingress {<br> from_port = 22<br> to_port = 22<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br> }</p><p>ingress {<br> from_port = 80<br> to_port = 80<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br> }</p><p>tags = {<br> Name = “humangov-${var.state_name}”<br> }<br>}</p><p>resource “aws_instance” “state_ec2” {<br> ami = “ami-007855ac798b5175e”<br> instance_type = “t2.micro”<br> key_name = “humangov-ec2-key”<br> vpc_security_group_ids = [aws_security_group.state_ec2_sg.id]</p><p>tags = {<br> Name = “humangov-${var.state_name}”<br> }<br>}</p><p>resource “aws_dynamodb_table” “state_dynamodb” {<br> name = “humangov-${var.state_name}-dynamodb”<br> billing_mode = “PAY_PER_REQUEST”<br> hash_key = “id”</p><p>attribute {<br> name = “id”<br> type = “S”<br> }</p><p>tags = {<br> Name = “humangov-${var.state_name}”<br> }<br>}</p><p>resource “random_string” “bucket_suffix” {<br> length = 4<br> special = false<br> upper = false<br>}</p><p>resource “aws_s3_bucket” “state_s3” {<br> bucket = “humangov-${var.state_name}-s3-${random_string.bucket_suffix.result}”<br> acl = “private”</p><p>tags = {<br> Name = “humangov-${var.state_name}”<br> }<br>}</p><p>​<br>outputs.tf<br>output “state_ec2_public_dns” {<br> value = aws_instance.state_ec2.public_dns<br>}</p><p>output “state_dynamodb_table” {<br> value = aws_dynamodb_table.state_dynamodb.name<br>}</p><p>output “state_s3_bucket” {<br> value = aws_s3_bucket.state_s3.bucket<br>}</p><p>​<br>In your root project directory, create a main.tf file that will consume the modules/aws_humangov_infrastructure module:<br>provider “aws” {<br> region = “us-east-1”<br>}</p><p>module “aws_humangov_infrastructure” {<br> source = “./modules/aws_humangov_infrastructure”<br> for_each = toset(var.states)<br> state_name = each.value<br>}</p><p>​<br>In your root project<br>directory, create the file variables.tf:<br>variable “states” {<br> description = “A list of state names”<br> default = [“california”]<br>}</p><p>​<br>In root project directory, create the file outputs.tf:<br>output “state_infrastructure_outputs” {<br> value = {<br> for state, infrastructure in module.aws_humangov_infrastructure :<br> state =&gt; {<br> ec2_public_dns = infrastructure.state_ec2_public_dns<br> dynamodb_table = infrastructure.state_dynamodb_table<br> s3_bucket = infrastructure.state_s3_bucket<br> }<br> }<br>}</p><p>​<br>Create the SSH key humangov-ec2-key and upload the private key humangov-ec2-key.pem to Cloud9 (for saving purposes).<br>Now, initialize and apply the Terraform configuration:<br>terraform fmt<br>terraform init<br>terraform validate<br>terraform plan<br>terraform apply</p><p>​<br>Add the module florida to provision the resources for State of Florida:<br>variable “states” {<br> description = “A list of state names”<br> default = [<br> “california”,<br> “texas”<br> # Add more states as needed<br> ]<br>}</p><p>​<br>Then apply the Terraform configuration again:<br>terraform init<br>terraform validate<br>terraform plan<br>terraform apply</p><p>Create a new S3 bucket to store the Terraform state remotely. Replace your-unique-state-bucket-name with a unique bucket name:</p><pre>aws s3api create-bucket --bucket humangov-terraform-state-x921 --region us-east-1</pre><p>Note that the backend.tf configuration also specifies a DynamoDB table (terraform-lock-table) for state locking. State locking helps prevent concurrent modification of the state file, which can lead to corruption. As we want to use state locking, let&#39;s create the DynamoDB table manually:</p><pre>aws dynamodb create-table \\\\<br>  --table-name humangov-terraform-state-lock-table \\\\<br>  --attribute-definitions AttributeName=LockID,AttributeType=S \\\\<br>  --key-schema AttributeName=LockID,KeyType=HASH \\\\<br>  --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \\\\<br>  --region us-east-1</pre><p>In your root project directory, create a backend.tf file in your project directory:</p><pre>touch backend.tf</pre><p>Edit the backend.tf file with the following content. Replace your-unique-state-bucket-name with the name of the bucket you created in step 4:</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket         = &quot;humangov-terraform-state-x921&quot;<br>    key            = &quot;terraform.tfstate&quot;<br>    region         = &quot;us-east-1&quot;<br>    encrypt        = true<br>    dynamodb_table = &quot;humangov-terraform-state-lock-table&quot;<br>  }<br>}</pre><p>Initialize Terraform:</p><pre>terraform init</pre><p>Apply the Terraform configuration:</p><pre>terraform apply</pre><p>Terraform will store the state remotely in the specified S3 bucket. You can verify this by checking the contents of the S3 bucket using the AWS CLI or the AWS Management Console.</p><pre>terraform destroy</pre><p>Switch to Git Working Directory:</p><pre>cd human-gov-infrastructure</pre><p>Add a .gitignore file to your repository to exclude sensitive information and temporary files generated by Terraform from being tracked. Some common entries to include in your .gitignore file are:</p><pre>.terraform/<br>*.tfstate<br>*.</pre><pre>tfstate.backup<br>*.tfvars<br>*.tfplan<br>*.tfr<br>*.tfstate.lock.info</pre><p>Add Terraform files to the local git repository, commit and push them to AWS CodeCommit:</p><pre>git status<br>git add .<br>git status<br>git commit -m &quot;AWS Infrastructure Terraform Configuration - first commit&quot;<br>git push -u origin</pre><p>Conclusion:</p><p>This was an amazing project. I learned a lot about Terraform and how it can used to provision resources and also to securely use AWS Code repository to store the configuration files used for Terraform. Quiet amazin to provision environments for multiple States in seconds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a50f14c655a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HumanGov: Implementation Of Git Repositories For Application And Infrastructure Code Using AWS Code…]]></title>
            <link>https://medium.com/@bob.farahi/humangov-implementation-of-git-repositories-for-application-and-infrastructure-code-using-aws-code-bd3c958e50fc?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd3c958e50fc</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 17:58:27 GMT</pubDate>
            <atom:updated>2024-07-01T19:16:22.312Z</atom:updated>
            <content:encoded><![CDATA[<p><em>HumanGov: Implementation Of Git Repositories For Application And Infrastructure Code Using AWS Code Commit + Proof Of Concept (POC) Process Of Commit, Push And Revert Code Changes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_q0fVHf2x69W2RzJJaF8w.jpeg" /></figure><p><strong>Project description:</strong></p><p>In this project based on a real-world scenario, I implemented Git repositories for application and infrastructure code using AWS CodeCommit, and got hands-on experience with the Proof of Concept (PoC) process of commit, push, and revert code changes.</p><p>My mission was to set up a Git repository using AWS CodeCommit for HumanGov, a hypothetical Software as a Service for government organization.</p><p>First create two Git repositories below on AWS CodeCommit and connect on AWS Cloud9.</p><p>human-gov-application<br>human-gov-infrastructure</p><p>Configure the AWS CLI credential helper on your AWS Cloud9 EC2 development environment</p><p>Config for DevOps Engineer:<br>git config — global user.name “John Smith — DevOps Engineer”<br>git config — global user.email smithj@gmail.com</p><p>git config — global credential.helper ‘!aws codecommit credential-helper $@’<br>git config — global credential.UseHttpPath true</p><p>In the terminal, run the git clone command, specifying the HTTPS clone URL of the repository you want to clone. Clone the repository named human-gov-infrastructure and human-gov-application:</p><p>git clone <a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-infrastructure">https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-infrastructure</a><br>git clone <a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application">https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application</a></p><p>Using AWS Cloud9, perform proof of concept (poc) process of commit, push and revert code changes.</p><p>As Software Developer 1:</p><p>Create and configure a Cloud9 environment to simulate Software Developer 1 working environment</p><p>git config — global user.name “Software Developer 1”<br>git config — global user.email <a href="/service/mailto:dev1@humangov.com">dev1@humangov.com</a></p><p>git config — global credential.helper ‘!aws codecommit credential-helper $@’<br>git config — global credential.UseHttpPath true</p><p>Clone the Code Commit repository human-gov-application</p><p>git clone <a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application">https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application</a></p><p>Create a file index.html inside of the repository</p><p>```html<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;My Website&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;header&gt;<br>&lt;h1&gt;Welcome to HumanGov!&lt;/h1&gt;<br>&lt;nav&gt;<br>&lt;ul&gt;<br>&lt;li&gt;&lt;a href=”#”&gt;Home&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=”#”&gt;About&lt;/a&gt;&lt;/li&gt;<br>&lt;li&gt;&lt;a href=”#”&gt;Contact&lt;/a&gt;&lt;/li&gt;<br>&lt;/ul&gt;<br>&lt;/nav&gt;<br>&lt;/header&gt;<br>&lt;main&gt;<br>&lt;p&gt;This is a PoC for HumanGov Git Repository.&lt;/p&gt;<br>&lt;/main&gt;<br>&lt;footer&gt;<br>&lt;p&gt;© My Website. All rights reserved.&lt;/p&gt;<br>&lt;/footer&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p><p>Commit and push the first commit</p><p>git add .<br>git commit -m “first commit”<br>git push -u origin master</p><p>Create a typo in the Header, commit and push the change</p><p>As Software Developer 2:</p><p>Create and configure a Cloud9 environment to simulate Software Developer 2 working environment</p><p>git config — global user.name “Software Developer 2”<br>git config — global user.email <a href="/service/mailto:dev2@humangov.com">dev2@humangov.com</a></p><p>git config — global credential.helper ‘!aws codecommit credential-helper $@’<br>git config — global credential.UseHttpPath true</p><p>Clone the Code Commit repository human-gov-application</p><p>git clone <a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application">https://git-codecommit.us-east-1.amazonaws.com/v1/repos/human-gov-application</a></p><p>Revert the last commit</p><p>git log<br>git revert &lt;hash&gt;</p><p>Change the Header to H2.</p><p>Commit the changes</p><p>git add .<br>git commit -m “fixed header size”</p><p>Push changes to remote repository</p><p>git status<br>git push -u origin master</p><p>Conclusion:</p><p>This was a great project. I learned how code can be version controlled through codecomit which is very similar to github but specific to AWS. It definately helps as an Engineer to see how the Code side gets handled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1fObhflzzOpwhYUBCd9Dg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd3c958e50fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of an E-Commerce System on AWS in an automated way using Terraform and Ansible]]></title>
            <link>https://medium.com/@bob.farahi/implementation-of-an-e-commerce-system-on-aws-in-an-automated-way-using-terraform-and-ansible-473019ba08dd?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/473019ba08dd</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Thu, 20 Jun 2024 13:32:23 GMT</pubDate>
            <atom:updated>2024-06-20T13:48:37.668Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Implementation of an E-Commerce System on AWS in an automated way using Terraform and Ansible</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c42Po6Sq_9iP_uAJ_-l6Xw.png" /></figure><p>In another project based in a real-world scenario, I worked as Cloud Engineer using DevOps, where I created and implemented an e-Commerce MVP (Minimum Viable Product) on AWS in less than 2 hours and in an automated way using Terraform and Ansible (Infrastructure as Code — IaC).</p><p>I provisioned the infrastructure in an automated way using Terraform and Ansible to automate the configuration management process, software installation and package management of the EC2 instance. I also used Magento, PHP, MySQL, and Redis to complete this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*maPof0YhnzOd4K1M8kIS2Q.png" /></figure><p>First create a Free Magendo Account and Access Keys.<a href="https://marketplace.magento.com/">https://marketplace.magento.com/</a></p><p>Using AWS CloudShell install packages:</p><p>Install Terraform on AWS Cloud Shell:</p><p>sudo yum install -y yum-utils</p><p>sudo yum-config-manager — add-repo <a href="https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo">https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo</a></p><p>sudo yum -y install terraform</p><p>Download the Terraform files on AWS Cloud Shell:</p><p>mkdir final_project</p><p>cd final_project</p><p>wget <a href="https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-terraform.zip">https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-terraform.zip</a></p><p>unzip final-project-terraform.zip</p><p>cd terraform</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wZtcGD_bzFFAhMAwdF83NA.png" /></figure><p>Edit main.tf with your VPC id and also your EC2 Key name.</p><p>Below Shows what the terraform main file will deploy. It will deploy an EC2 instance with TCP Port 22 open and Port 80 http (For lab purposes only).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XxE2cUTwDu60t-nqHKEfxA.png" /></figure><p>Run terraform init to download the providers for us</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*69TZl3WHoRZ6tMgKw03avg.png" /></figure><p>Run terraform plan which tells us what it is about to run for us. It will add the EC2 instance and Security Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hQs8bwIZOuHa4CjiE0Ns_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7qSRSAiAIodTCujv1cVWKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MsvZj1LC62vo7qrTsmEQDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Y-ufieox16FpQyh4RyZgMQ.png" /></figure><p>Run Terraform apply to run it. Confirm by saying yes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5MIQoCECa_h8du_789GdAQ.png" /></figure><p>A new file ‘terraform.tfstate’ was created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Vz7cMUtHScwO4-PQP7OMXw.png" /></figure><p>Terraform created EC2 instance and Security Group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*To2eUwx3qu4z_pQBtdAMow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wm6ad2GAv14ZwPa56gwLRw.png" /></figure><p>SSH into the EC2 instance by using the Public IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Nh7O22ONQ0d-4WwnyPae_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CJUIxFcAfa6yAlydZ42eYA.png" /></figure><p>Install Ansible</p><p>sudo yum-config-manager — enable epel</p><p>sudo yum install ansible -y</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lUBsfXgLHJpz-FWNJYYPIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*d5VOIcBlqz0gallW_R9o5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*X-tZ6ApgOg1xQ2XEHQ__0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3ASna3vCvgVVPI7mDNS-rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0xTtADYO_KJ0FRIveYRt0w.png" /></figure><p>Download the Ansible playbooks</p><p>wget <a href="https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-ansible-magento2.zip">https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-ansible-magento2.zip</a></p><p>unzip final-project-ansible-magento2.zip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uR7Ug9cyCMFGE7gO0Sfiqg.png" /></figure><p>Unzip the magento</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aV9q9wCQJLyfa1OXgqxpGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*F1gkjokhmNTwMsDV1uyBTQ.png" /></figure><p>Change directory into ansible-magento2 folder. Ansible will use these files to deploy the Magento Application.</p><p>cd ansible-magento2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sy3AYjt42QbBydcNNVfTDw.png" /></figure><p>vi group_vars/all.yml to make the following specific changes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*3vlAjQT6wZYd0kDpdUhaxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Q5-yxSPZ54phraX-9AwNfw.png" /></figure><p>Run Ansible to deploy the stack of tools for the e-commerce</p><p>cd ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VxNd3WG4vaWXDNTsZ8txvA.png" /></figure><p>ansible-playbook -i hosts.yml ansible-magento2.yml -k -vvv –become</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*r2ni7AYVk7E4kzX5b5MddA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Pu8KFmPXLNeUN-friVXjFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lEawf9mURZoe-Ghb8XX0ag.png" /></figure><p>Go the Web page using the Public IP address of the EC2 Instance to see if the page is loading</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UQHhTeO-frGyiXpowFUc-w.png" /></figure><p>Add securelocation to the end of the URL. <a href="http://ec2_public_ip/securelocation">http://<strong>EC2_PUBLIC_IP</strong>/<strong>securelocation</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*g_NJrzZ_-wtzvxRLb1CQZA.png" /></figure><p>Provide the Admin Credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*S4sYYqUKnurge4ZDCOeCBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*G74WRXNbcDR4E8AzcShWmw.png" /></figure><p>Download the ecommerce images and personalize the ecommerce website.</p><p><a href="https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-images.zip">https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/final-project-images.zip</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0uQBFudZIsJbVKsNnxt7OQ.png" /></figure><p>Click on Content, Configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2GtN_JqT732qjdTdUiFbPw.png" /></figure><p>Edit Default Store View</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Ge2O-pod8zHyrImvCv4MHg.png" /></figure><p>Click HTML Head</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*h-hJF6K-j6bkYB0EFStf5g.png" /></figure><p>Change the Default Page Title to The Cloud Bootcamp Store</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sERd1Nl_ehD8uvkKhwYqbA.png" /></figure><p>Click on Header and upload image and specify a Welcome message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ek-RuLtblFC55kjARZrO0g.png" /></figure><p>Save Configuration</p><p>Go to the URL again and see if the Logo is showing up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*g3xIHKHkATlqsyigsIcAzA.png" /></figure><p>Add another Product to the Ecommerce</p><p>Click on Catalog and then Products</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*S0AG6xdZDyRX7MQ28-GFRA.png" /></figure><p>Click Add Product</p><p>Input the Product name, Price and Quantity in stock</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IzF5PgDZdYclI6p2TqK2Lw.png" /></figure><p>Under Images and Video choose the T-Shirt images downloaded previously from the ZIP file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VWc_4weo13PiickqcHBoug.png" /></figure><p>Click Save</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2N2UK1kG-BlUCfxAQKgPWg.png" /></figure><p>Click Content, and then Pages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OekeE7AbJwjasdGXD6CA3w.png" /></figure><p>Change the Home Page by clicking Edit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WNHqZoJZNz2Nzuzx3bjArg.png" /></figure><p>Click on Content</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aH6CcbCoL0kfBPsGOciLOQ.png" /></figure><p>Remove the Standard Content. Click to insert Widget for Catalog New Product List.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jy2-Vj3saqIkgo59F02laA.png" /></figure><p>Save</p><p>Go to the URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*jNxwp5iMBMTgvwXxoDiJQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_k4ocjDqBsmv8Hk2ce9E2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iiD5tT-TSnHT2CG-j_FeQg.png" /></figure><p>Add to Cart</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mVaBycZiXu9LA0EVVMcNVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZOHhPgJ7SO0zBEIBnyKsfw.png" /></figure><p>Conclusion</p><p>This was a great project. I learned a lot about standing up an ecommerce application using Terraform and Ansible. This was a great demostration of the power of automation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=473019ba08dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elaboration of Executive Presentation of Infrastructure costs for an SAP Migration project from…]]></title>
            <link>https://medium.com/@bob.farahi/elaboration-of-executive-presentation-of-infrastructure-costs-for-an-sap-migration-project-from-73fd73f1766f?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/73fd73f1766f</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[presentations]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Tue, 11 Jun 2024 12:09:13 GMT</pubDate>
            <atom:updated>2024-06-11T12:19:21.863Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Elaboration of Executive Presentation of Infrastructure costs for an SAP Migration project from On-Premises to AWS</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMSfjs3oRtaM-isZHBrPzw.png" /></figure><p>In this project based on a real-world scenario, I acted as a Cloud Architect and created an executive presentation of infrastructure costs for a SAP migration project from On-Premises to AWS.</p><p>SAP workloads were running in a corporate Datacenter with the environment divided into Production, Quality Assurance — QA and Development/Test layers.</p><p>My mission was to estimate the costs of migration to AWS, considering that this infrastructure will be running on AWS for at least the next 3 years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAWiEB6UsU4Npr2a7D_c8w.png" /></figure><p>I used the AWS Calculator on the and inputted the Compute, Storage, and Database information needed along with the AWS Support. The Compute needed for EC2 was the vCPU and RAM along with the EBS Volume Sizes for Storage. Also specified the Elastic Load Balancer needed. To replace the NFS Storage for the Linux instances we also priced out Elastic File System (EFS). This was broken down by Production, Stage, and Development/testing on the AWS Calculator site. The database information was also imputed in the AWS Calculator with the AWS Support needed for each environment. The information was saved in a CSV File.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*luUtXcA02gDvbuwmzojTZA.png" /></figure><p>The numbers provided from the excel sheet which was downloaded from AWS was used to provide in a Power Point presentation to Management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SEbQ9dZ7uY4KB5T54Wvyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0odNGq3wqdLAbjMdIdcdhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxQvlxZq9t0iuq0YcSf0kA.png" /></figure><p>Conclusion</p><p>This was a great project in pricing out what the on-prem VMs would cost if it was migrated to the Cloud. The AWS Calculator made it very easy and the CSV Summary provided was very useful in creating a Presentation PowerPoint slides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73fd73f1766f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a set of EC2 instances using Terraform and AWS Systems Manager configuration with…]]></title>
            <link>https://medium.com/@bob.farahi/implementation-of-a-set-of-ec2-instances-using-terraform-and-aws-systems-manager-configuration-with-9b547c533447?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b547c533447</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[automa]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Fri, 07 Jun 2024 20:08:14 GMT</pubDate>
            <atom:updated>2024-06-11T12:16:57.958Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Implementation of a set of EC2 instances using Terraform and AWS Systems Manager configuration with Amazon Simple Notification Service for automated installation of security officers</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKdof7cu7jfz9EzF6PRNpw.png" /></figure><p><strong>Project description:</strong></p><p>In this project based on a real-world scenario, I acted as DevSecOps Engineer, and I deployed a set of EC2 instances and infrastructure in an automated way using Terraform (infrastructure as code — IaC). Also, it was necessary to install a specific security agent on all these instances in an automated way.</p><p>Once I provisioned the infrastructure, AWS System Manager and its component Command Run were used to install the security agents in an automated way. I used the Amazon Simple Notification Service — SNS to send an email informing the whole process status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5nIFDSszczl4WNhBGpnYA.png" /></figure><p>Modify Terraform Code with Default VPC and Subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*in1GdhcCPI9puxBAI3QN_A.png" /></figure><p>Create EC2 Keypair</p><p>Terraform uses SSH Key during creation process.</p><p>Create EC2 Keypair</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*AdhGC6tb2JhgiR6CECI8eA.png" /></figure><p>Log into Cloudshell on AWS or a Linux system</p><p>Copy over the Terraform code that you modifed to Cloudshell</p><p>Install the following:</p><p>sudo yum install -y yum-utils</p><p>sudo yum-config-manager — add-repo <a href="https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo">https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo</a></p><p>sudo yum -y install terraform</p><p>terraform -v</p><p>Run terraform init</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XK-Vr_SaZyaNj9JsQjQpvw.png" /></figure><p>Run terraform plan to see what terraform is about to apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SsUiq6Y5erVSV51P2ZNn-w.png" /></figure><p>Run terraform apply to execute the code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*oRZK2s31MP4xdnXnXgAotg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1KM38q2mhJPHpx9-oBW1aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*meIhKgyp1pKhLhREcqhSIg.png" /></figure><p>Create an IAM Role to Authorize System Manager to send email using SNS for notification.</p><p>Add AmazonSNSFullAccess to the Role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zsZ8inUEYaJGQaAshQWLIQ.png" /></figure><p>Create a new Topic Simple Notification Service (SNS)</p><p>Will be used to send notification email to Devops team.</p><p>Create a Standard Topic DevOpsNotification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*dRhxDi5I5aC0VGUvisMsag.png" /></figure><p>Copy the ARN from the Topic created which will used to create the Subscription. Create a new Subscription. Specify the ARN, “email” as the protocol and provide an email address for the notification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QbURj_D5gwx_xqMxMrNC4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Z2uUsANEvpEZio-QBBH4fA.png" /></figure><p>They System will send a verification email to the email specified that needs to be confirmed.</p><p>Copy the ARN from the Subscription.</p><p>Use AWS System Manager to install Agent on the EC2 instances by configuring the run command.</p><p>Search for AWS System Manager and click create. Choose Host Management. For Target choose Manual and then the EC2 instances that were created by Terraform. Choosing Manual will tell AWS to use the current Region</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*O6fJhhnlyx5TojEQmNZO6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xCOuCQbhMViMi3DoWTQNKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*M8fY9h_Mk6aAvTx7VbIhoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*O6fJhhnlyx5TojEQmNZO6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*oxzWib-xjooYa2SbgPVEJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*tzvAmBMkIZi0_ZcCsVrozQ.png" /></figure><p>Verify Session Manager can manage the two EC2 instances. Click on Session Manager and then Start Session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Ns4YmcnB1sarMzDqU0AQiA.png" /></figure><p>Under Node Management click on Run command and then run a command. Filter on “Shell” and choose AWS-RunShellScript.</p><p>Under Command Parameters specify command to be run on the EC2 instances by System Manager.</p><p>sudo wget -q <a href="https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/install_security_agent.sh">https://tcb-bootcamps.s3.amazonaws.com/bootcamp-aws/en/install_security_agent.sh</a> -P /tmp</p><p>sudo chmod +x /tmp/install_security_agent.sh</p><p>sudo /tmp/install_security_agent.sh</p><p>ls -ltr /usr/bin/security_agent</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*G65oX0C8xt2_s9KnrikONw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*TKys7Fo_XTIjZL2uhkW3wA.png" /></figure><p>Under Target choose instances manually. Then select the two EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*j7PqH6TksV6sIPJwwAvqxg.png" /></figure><p>Under Output Option deselect write to S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*voXf3qkfm_s1Q9uveIJW8w.png" /></figure><p>Enable SNS notification. Choose the Role name that was created for System Manager. Specify the Topic ARN that was copied earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Wf9TwIKatvVEw9AX-0lRcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gRoux5J1DcFlH1TtOxeIiQ.png" /></figure><p>System will send notification to the email specified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*28dYNGjjZ-rUnj-iHvz3lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*K5geO2xHN5b-oXJB2KIFDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Mr39v96YqQmPWLkaOokHyg.png" /></figure><p>Conclusion</p><p>This was an amazing project and and eye opener for me. I had never used Terraform before to provision an environment. Terraform is very powerful and there is a lot more to it and I’m looking forward to diving deeper into it. AWS Systems Manager is a great tool as well. You are able to install run time commands on many EC2 instances at ones and can also run patches. Doing these task manually will take a lot of time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b547c533447" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a Scalable Web Application using the services of AWS Elastic Beanstalk, DynamoDB…]]></title>
            <link>https://medium.com/@bob.farahi/implementation-of-a-scalable-web-application-using-the-services-of-aws-elastic-beanstalk-dynamodb-ead8f20cba3c?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ead8f20cba3c</guid>
            <category><![CDATA[atomation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 15:12:46 GMT</pubDate>
            <atom:updated>2024-06-11T12:16:03.123Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Implementation of a Scalable Web Application using the services of AWS Elastic Beanstalk, DynamoDB, CloudFront and Edge Location</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyyUmMJxKPSGow2Ns1FIsw.png" /></figure><p><strong>Project description:</strong></p><p>In this project based on a real-world scenario, I was responsible for implementing an application that needs to support the high demand of a large number of users accessing it simultaneously. This application has been used in a large conference that had more than 10,000 people, in-person and online, with participants from all over the world.</p><p>This event was broadcast online and in person and 10 vouchers were drawn for 3 Cloud certifications. At that moment, more than 10,000 people in the audience registered their e-mails to guarantee their participation in the raffle.</p><p>We used in AWS, Elastic Beanstalk services to deploy the web application, DynamoDB to store emails, CloudFront to cache static and dynamic files in an Edge Location close to the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fh-2rrUNSN2eMAFC2HaBsQ.png" /></figure><p>Create DynamoDB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ox-bWOKN1q__YYGCBIgarQ.png" /></figure><p>I created the IAM Role “aws-elasticbeanstalk-ec2-role” needed for Elastic Beanstalk first. This is needed for Permission of EC2 to write to DynamoDB. Permissions assigned to role are:</p><p>AmazonDynamoDBFullAccess<br>AWSElasticBeanstalkMulticontainerDocker<br>AWSElasticBeanstalkWebTier<br>AWSElasticBeanstalkWorkerTier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ag_9KiABJMAWVjHtqja4A.png" /></figure><p>Elastic Beanstalk Creation:</p><p>Choose Web Tier and Provide an Application name. For the Platform I choose Python as the application code. Specified the code to be imported from S3 bucket. Choose HA for the Preset.</p><p>Choose to Create a new Service role “aws-elasticbeanstalk-service-role”. Permissoins for the role:</p><p>AWSElasticBeanstalkEnhancedHealth<br>AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy</p><p>Under Trust Relationship and attached the JSON Policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eojB1TuAGIvibhHfJKfjxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*bf5kb9cOaFN_ZdNkVMgvcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCGuyAuihxj-BwUvO0Mg2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8em31aUf8iLf_GuWZ9Q2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMJCHZieZjf3eq035irizQ.png" /><figcaption>h</figcaption></figure><p>Choose default VPC and check Public IP Activation. Select all AV Zones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7hNgN1BSg1e8YJCb0Zvow.png" /></figure><p>Choose General Purpose SSD and 10GB. Choose the default CloudWatch metric time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*c2p9nKjKBlenTbgP_Nxlfg.png" /></figure><p>Auto Scaling choose 2 and 4 for the min/max of EC2 instances</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rsYgNgKwuitwGR28ceGJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4cmEmX2eM6RE1BJbBkrMLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFpBNeu_rTUiL8dQKTltKQ.png" /></figure><p>After clicking Publish the Elastic Beanstalk creates the EC2 instances automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdWIATzbrSw-EuX9YSG9rA.png" /></figure><p>Under Domain in the Elastic Beanstalk dashboard copy the URL link under the Domain and paste into the browser. Type an email address for user and click register.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZgtjay7ry8oyN8jPLOBrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r7hzj_XlELJUzRIMlJZUSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axnlgVEs0Fa574ttpggrxg.png" /></figure><p>The email address is now in the DynamoDB from the registeratin page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfWov0EQxgKpy5VZd0w2AQ.png" /></figure><p>Now Create a CloudFront Distribution. For the Domain choose the Elastic Load Balancer created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVmEO3Tg8llaMeGKuMtg8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oYpNeS2Gwmehpw0SBE2CTw.png" /></figure><p>Now Copy and paste the CloudFront Distribution URL and paste into browser. Register a new user which will store in DynamoDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vmVxWby6CF5X6IajWhJsJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kmQCRyzIelamM-eYUvf4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCs2eTB9T5nW4pkFE9NedQ.png" /></figure><p>Test Auto Scaling creating additional EC2 instances after CPU Spike of aboe 50%.</p><p>Copy one of the EC2 Public IPs and ssh into it.</p><p>Install and run the stress tool to spike the CPU</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*CDy9IBkzIT34u97WQnNPPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*ktDDZb2_C7tctzMEs3UkFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NkuWkcE7ru7ovF4GkBm-cg.png" /></figure><p>Now Auto Scaling has automatically launched a 3rd EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6UlsRWOvjF-3ozaGhEuUKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DEaMFQazuccUEM_JXOI4g.png" /></figure><p>Conclusion:</p><p>This was a great project. Learned how Elastic Beanstalk can provision leverage Auto Scaling to provision additional C2 instances when certain conditions are met.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ead8f20cba3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS…]]></title>
            <link>https://medium.com/@bob.farahi/migration-of-a-workload-running-in-a-corporate-data-center-to-aws-using-the-amazon-ec2-and-rds-8d17a6f2ae0c?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d17a6f2ae0c</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Wed, 29 May 2024 14:02:57 GMT</pubDate>
            <atom:updated>2024-05-29T15:41:15.641Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Migration of a Workload running in a Corporate Data Center to AWS using the Amazon EC2 and RDS service</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MYrkt1lvCnZ1olMs3npi1w.png" /></figure><p><strong>Project description:</strong></p><p>In another project based in a real-world scenario, I acted as the Cloud Specialist responsible for migrating a workload running in a Corporate DataCenter to AWS.<br> The application and database were migrated to AWS using the Lift &amp; Shift (rehost) model, moving both application and database data.</p><p>I followed some migration steps: Planning (sizing, prerequisites, resource naming), Execution (resource provisioning, best practices), Go-live (validation test — Dry-run, final migration — Cutover) and Post Go-live (ensure the operation of the application and user access).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Y_jNDDOvBs6UwkMYSFa2g.png" /></figure><p>Planning Stage:</p><p>A Spreadsheet was created that had the details of what was needed during the creation of EC2 and RDS instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-3kbD8hJLLBXH0Ncm3Sog.png" /></figure><p>Execution (resource provisioning, best practices) Stage:</p><p>A VPC, three Subnets, a Route Table and Internet Gateway needed to be created. For best practice the EC2 which hosts the application was in the Public Subnet. The RDS database was in Private Subnet for Security reasons. AWS Security Groups were used to only allow the needed TCP Ports from EC2 in Public Subnet to the RDS in Private Subnet. For the EC2 in public Subnet it is also good practice to only allow Trusted IPs to access and not open it up for all IPs to access the Public instance.</p><p>VPC Creation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndNz9trkC7uHcb0pqGt4rQ.png" /></figure><p>Subnet Creations:</p><p>Public Subnet for EC2 Application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECtJ8ImIHQ3nGrXbtOZxig.png" /></figure><p>Private Subnet for RDS database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7i2DY0DquthUaCmCoaPcjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFD-NRuCkL3hRaCFro6sLQ.png" /></figure><p>Internet Gateway:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1L4RZKIPqcsgl4zzSoIjMw.png" /></figure><p>Route Table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0erdD93D16JHOxzh9H7Q4A.png" /></figure><p>EC2 Creation for Application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4eV-4Vj1s_z1DamE4mBvQ.png" /></figure><p>RDS Creation for database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fa9WESlcpa4Fvzh-LRNW4A.png" /></figure><p>Security Groups:</p><p>RDS Security Group</p><p>TCP Port 3306 (MySQL) was allowed to communicate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoJkMkSrwNTlQ12V9q8gcw.png" /></figure><p>EC2 Application Security Group:</p><p>TCP Port 22 was allowed for SSH communication. TCP Port 8080 was allowed for accessing the Web Front End</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7jroJZah4YHb26DUNs7Eg.png" /></figure><p>Package Installation on Application EC2 Server:</p><p>The following packages were installed to prep the EC2 for the import of Application dump:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*N8xgaUaOA_I_fyGlnp6U_g.png" /></figure><p>Import dumps of Application and MySQL from the S3 Bucket to the EC2 instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*V7gqypx7bQ-en9FHpehu6Q.png" /></figure><p>Connect to RDS from the EC2 instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Rjl5ruku7kmr7e9RnoMHg.png" /></figure><p>Select wikidb to connect to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*4OSVasQ9E88K7XmZSFc92w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*KT2pmkmSkfu-EZDKUtRm4A.png" /></figure><p>unzip the application zip file and modify the wiki.py.</p><p>Change the on-prem hostname to the AWS RDS Endpoint for the database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*cRT0-bC603Z3JA5xIqmE3A.png" /></figure><p>Start the application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rEMz1HyutCoAeGY67l2NQ.png" /></figure><p>Copy and paste the EC2 Public IP into a browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pJZ5rYyb6CLCG1sjwqztQ.png" /></figure><p>Login with admin credentials of the application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pJZ5rYyb6CLCG1sjwqztQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bt9TZ799FZ4hm1QqRWWj6w.png" /></figure><p>Conclusion</p><p>This was a great project. I learned a lot about creating a VPC , Subnets, Internet Gateway and Route table. Mapping of the Route Table to the Internet Gateway was fun. Understanding of making sure the database is protected in the Private Subnet and only allowing connection from the Application EC2 instance was very important.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d17a6f2ae0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated user migration and management of AWS Identity and Access Management (IAM) resources]]></title>
            <link>https://medium.com/@bob.farahi/automated-user-migration-and-management-of-aws-identity-and-access-management-iam-resources-8ce25e8530f9?source=rss-d6f1dd1b8f2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce25e8530f9</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Barialai Farahi]]></dc:creator>
            <pubDate>Sun, 19 May 2024 01:45:33 GMT</pubDate>
            <atom:updated>2024-05-29T12:01:25.242Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdK6qaygPGSPH-ajQu82ow.png" /></figure><p>In this project based on a real-world scenario, I acted as Cloud Specialist with the mission to migrate users in an automated way and manage AWS IAM (Identity and Access Management) resources.</p><p>There were 100 users that needed to be migrated and have MFA (Multi-factor authentication) enabled on their accounts, as this is a security best practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AE_ZAX_PBZlbp9eByk9L8g.png" /></figure><p>To avoid repetitive and manual tasks in the AWS console, I needed to think about automating the processes.</p><p>Using GitBash with AWS CLI and Shell Script it was very easy to create multiple users in parallel without human error of doing manually. An excel spreadsheet that had a list of the users and group membership was used as input into the Script. The Script executed the IAM user creation along with group membership and default password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aa_oFSL1y1lUGzRGQsbKQw.png" /></figure><p>For MFA, a JSON Custom policy was created that enforced compliance which was attached to each group. Once the MFA policy was attached to a user the Policy would only allow Add MFA, and Change Password for the user even if the user was Administrator. Once MFA was added by the user then all permissions assigned were approved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*JIogvypESDf1ayYPMKV-3w.png" /></figure><p>To manually create 100 users it would have taken a very long time. Doing manually would also be more error prone. Scripting this task made is very easy and fast. The custom MFA Policy was fun. When MFA Policy was assigned to an Administrator, that Administrator on the next login no longer had Admin right until they set their MFA. Shows how powerful JSON Policy can be.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce25e8530f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>