<?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: Mubeen Babar</title>
    <description>The latest articles on DEV Community by Mubeen Babar (@mubeen780).</description>
    <link>https://dev.to/mubeen780</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%2F1878935%2Ff94c3c66-c3e9-4f7e-9aaa-2bc917a50809.jpg</url>
      <title>DEV Community: Mubeen Babar</title>
      <link>https://dev.to/mubeen780</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mubeen780"/>
    <language>en</language>
    <item>
      <title>🚀 Multi-Application CI/CD on AWS (Production-Style)</title>
      <dc:creator>Mubeen Babar</dc:creator>
      <pubDate>Thu, 01 Jan 2026 06:36:51 +0000</pubDate>
      <link>https://dev.to/mubeen780/devops-project-multi-application-cicd-on-aws-production-style-2924</link>
      <guid>https://dev.to/mubeen780/devops-project-multi-application-cicd-on-aws-production-style-2924</guid>
      <description>&lt;p&gt;&lt;strong&gt;🎯 Project Goal&lt;/strong&gt;&lt;br&gt;
Host multiple web applications on AWS where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Developers push code to GitHub&lt;/li&gt;
&lt;li&gt;  GitHub Actions automatically:&lt;/li&gt;
&lt;li&gt;  Tests code&lt;/li&gt;
&lt;li&gt;  Builds Docker images&lt;/li&gt;
&lt;li&gt;  Pushes images to AWS ECR&lt;/li&gt;
&lt;li&gt;  Deploys to AWS ECS (Fargate) or EC2 + Docker&lt;/li&gt;
&lt;li&gt;  End users access apps via HTTPS (ALB + ACM)&lt;/li&gt;
&lt;li&gt;  Logs &amp;amp; monitoring via CloudWatch&lt;/li&gt;
&lt;li&gt;  Supports rolling / blue-green deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🏗️ High-Level Architecture&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer
   |
   v
GitHub Repo (App1, App2, App3)
   |
GitHub Actions (CI/CD)
   |
   |-- Test
   |-- Docker Build
   |-- Push to ECR
   v
AWS ECR (Images)
   |
AWS ECS (Fargate)
   |
Application Load Balancer
   |
   v
End Users (HTTPS)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📁 Repository Structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;multi-app-devops/
├── app1/
│   ├── Dockerfile
│   └── src/
├── app2/
│   ├── Dockerfile
│   └── src/
├── app3/
│   ├── Dockerfile
│   └── src/
└── .github/
    └── workflows/
        └── deploy.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each app is independent but deployed via same pipeline logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔐 STEP 1: AWS ACCOUNT &amp;amp; IAM&lt;/strong&gt;&lt;br&gt;
Create IAM User (DevOpsUser)&lt;br&gt;
Permissions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AmazonEC2FullAccess&lt;/li&gt;
&lt;li&gt;AmazonECS_FullAccess&lt;/li&gt;
&lt;li&gt;AmazonEC2ContainerRegistryFullAccess&lt;/li&gt;
&lt;li&gt;CloudWatchFullAccess&lt;/li&gt;
&lt;li&gt;IAMReadOnlyAccess&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Create Access Key (Programmatic)&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;🌐 STEP 2: Networking (VPC)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create VPC&lt;/li&gt;
&lt;li&gt;2 Public Subnets&lt;/li&gt;
&lt;li&gt;Internet Gateway&lt;/li&gt;
&lt;li&gt;Route Table&lt;/li&gt;
&lt;li&gt;Security Groups:&lt;/li&gt;
&lt;li&gt;ALB: 80, 443&lt;/li&gt;
&lt;li&gt;ECS: 3000/5000/80 (app ports)&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;📦 STEP 3: Create ECR Repositories&lt;/strong&gt;&lt;br&gt;
Create one ECR per app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app1-ecr
app2-ecr
app3-ecr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS Account ID&lt;/li&gt;
&lt;li&gt;Region&lt;/li&gt;
&lt;li&gt;Repository URI
Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;123456789012.dkr.ecr.us-east-1.amazonaws.com/app1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;🐳 STEP 4: Dockerize Applications&lt;/strong&gt;&lt;br&gt;
Example Dockerfile (Node.js / Python)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM node:18-alpine
WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat per app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚙️ STEP 5: ECS Cluster (Fargate)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create ECS Cluster&lt;/li&gt;
&lt;li&gt;Create Task Definition per App&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Container Image: ECR URI&lt;/li&gt;
&lt;li&gt;Port Mapping&lt;/li&gt;
&lt;li&gt;CPU &amp;amp; Memory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create Service&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Launch Type: FARGATE&lt;/li&gt;
&lt;li&gt;Attach ALB&lt;/li&gt;
&lt;li&gt;Desired Tasks: 2 (HA)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🌍 STEP 6: Application Load Balancer&lt;/strong&gt;&lt;br&gt;
Create ALB&lt;br&gt;
Listener:&lt;br&gt;
HTTP → Redirect HTTPS&lt;br&gt;
HTTPS → Target Groups&lt;br&gt;
Path-based routing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/app1 → app1-service
/app2 → app2-service
/app3 → app3-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;🔑 STEP 7: GitHub Secrets&lt;/strong&gt;&lt;br&gt;
In GitHub Repo → Settings → Secrets&lt;br&gt;
&lt;code&gt;AWS_ACCESS_KEY_ID&lt;br&gt;
AWS_SECRET_ACCESS_KEY&lt;br&gt;
AWS_REGION&lt;br&gt;
AWS_ACCOUNT_ID&lt;br&gt;
ECR_REPO_APP1&lt;br&gt;
ECR_REPO_APP2&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;🔄 STEP 8: GitHub Actions CI/CD Pipeline&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI-CD Pipeline

on:
  push:
    branches: [ "main" ]

env:
  AWS_REGION: us-east-1

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Code
      uses: actions/checkout@v4

    - name: Configure AWS Credentials
      uses: aws-actions/configure-aws-credentials@v4
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: ${{ env.AWS_REGION }}

    - name: Login to Amazon ECR
      run: |
        aws ecr get-login-password --region $AWS_REGION \
        | docker login --username AWS --password-stdin \
        ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.$AWS_REGION.amazonaws.com

    - name: Build &amp;amp; Push App1
      run: |
        docker build -t app1 ./app1
        docker tag app1:latest ${{ secrets.ECR_REPO_APP1 }}:latest
        docker push ${{ secrets.ECR_REPO_APP1 }}:latest

    - name: Deploy to ECS
      run: |
        aws ecs update-service \
          --cluster devops-cluster \
          --service app1-service \
          --force-new-deployment

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

&lt;/div&gt;



&lt;p&gt;✔ Repeat build steps for app2 &amp;amp; app3.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;📊 STEP 9: Monitoring &amp;amp; Logs&lt;/strong&gt;&lt;br&gt;
Enable CloudWatch Logs in ECS Task Definition&lt;br&gt;
View:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App logs&lt;/li&gt;
&lt;li&gt;CPU/Memory&lt;/li&gt;
&lt;li&gt;Health checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🔐 STEP 10: Security &amp;amp; Best Practices&lt;/strong&gt;&lt;br&gt;
✔ HTTPS using ACM&lt;br&gt;
✔ IAM least privilege&lt;br&gt;
✔ Secrets in GitHub (not code)&lt;br&gt;
✔ Private ECR&lt;br&gt;
✔ Auto-scaling &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧪 STEP 11: Testing Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Developer changes code&lt;/li&gt;
&lt;li&gt;Push to &lt;code&gt;main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;GitHub Action triggers&lt;/li&gt;
&lt;li&gt;Docker image rebuilt&lt;/li&gt;
&lt;li&gt;Image pushed to ECR&lt;/li&gt;
&lt;li&gt;ECS pulls new image&lt;/li&gt;
&lt;li&gt;Rolling deployment&lt;/li&gt;
&lt;li&gt;End user sees updated app&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>cicd</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>🔧 Host WordPress on AWS Using LAMP</title>
      <dc:creator>Mubeen Babar</dc:creator>
      <pubDate>Mon, 21 Apr 2025 05:54:41 +0000</pubDate>
      <link>https://dev.to/mubeen780/host-wordpress-on-aws-using-lamp-32g9</link>
      <guid>https://dev.to/mubeen780/host-wordpress-on-aws-using-lamp-32g9</guid>
      <description>&lt;p&gt;🖥️ &lt;strong&gt;Step 1:&lt;/strong&gt; &lt;strong&gt;Launch EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to the EC2 Dashboard.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Launch Instance.&lt;/li&gt;
&lt;li&gt;Choose Ubuntu Server 22.04 LTS.&lt;/li&gt;
&lt;li&gt;Choose an instance type (e.g., t2.micro for free tier).&lt;/li&gt;
&lt;li&gt;Create or use an existing key pair (you’ll need it for SSH).&lt;/li&gt;
&lt;li&gt;Configure security group:&lt;/li&gt;
&lt;li&gt;Allow HTTP (80), HTTPS (443), and SSH (22) from your IP.&lt;/li&gt;
&lt;li&gt;Launch instance.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;🔗 Step 2: Connect to EC2 via SSH&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i your-key.pem ubuntu@your-ec2-public-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;📦 &lt;strong&gt;Step 3: Install Apache Web Server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="http://your-ec2-public-ip" rel="noopener noreferrer"&gt;http://your-ec2-public-ip&lt;/a&gt; to see the Apache2 Ubuntu Default Page.&lt;/p&gt;

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

&lt;p&gt;🐘 &lt;strong&gt;Step 4: Install MySQL (Database Server)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mysql-server -y
sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set a strong MySQL root password during the configuration.&lt;/p&gt;

&lt;p&gt;✈️ &lt;strong&gt;Step 5: Create a WordPress Database and User&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bash&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;SQL&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE wordpress;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;💻 Step 6: Install PHP and Extensions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bash&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip -y
sudo systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;⬇️ Step 7: Download WordPress&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy files to Apache root directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp -a wordpress/. /var/www/html/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔐 Step 8: Set Permissions&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove default index.html:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo rm /var/www/html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📝 Step 9: Configure WordPress&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www/html
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit database details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;define('DB_NAME', 'wordpress');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🌐 Step 10: Final Setup via Web UI&lt;/strong&gt;&lt;br&gt;
Now visit your public IP in the browser:&lt;br&gt;
📍 &lt;a href="http://your-ec2-public-ip" rel="noopener noreferrer"&gt;http://your-ec2-public-ip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll see the WordPress setup page. Choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language&lt;/li&gt;
&lt;li&gt;Site Title&lt;/li&gt;
&lt;li&gt;Admin Username and Password&lt;/li&gt;
&lt;li&gt;Email&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click Install WordPress 🎉&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;✅ 1. Set Up SSL Using Let’s Encrypt (HTTPS)&lt;/strong&gt;&lt;br&gt;
SSL secures your website with HTTPS (🔒). It's free with Let’s Encrypt.&lt;br&gt;
Install Certbot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install certbot python3-certbot-apache -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run Certbot for Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot --apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the prompts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose your domain (requires domain pointed to EC2 IP).&lt;/li&gt;
&lt;li&gt;Certbot auto-edits Apache config to enable SSL.
Test HTTPS:
Visit: &lt;a href="https://your-domain.com" rel="noopener noreferrer"&gt;https://your-domain.com&lt;/a&gt;
Auto-Renew SSL (runs twice daily):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status certbot.timer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📌 2. Create an Elastic IP in EC2 (Static IP)&lt;/strong&gt;&lt;br&gt;
Steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to EC2 Dashboard &amp;gt; Network &amp;amp; Security &amp;gt; Elastic IPs.&lt;/li&gt;
&lt;li&gt;Click Allocate Elastic IP address.&lt;/li&gt;
&lt;li&gt;Choose Amazon pool &amp;gt; Allocate.&lt;/li&gt;
&lt;li&gt;Select the new Elastic IP &amp;gt; Actions &amp;gt; Associate.&lt;/li&gt;
&lt;li&gt;Select your EC2 instance and network interface &amp;gt; Associate.
Now your EC2 has a fixed public IP.&lt;/li&gt;
&lt;/ul&gt;

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

</description>
    </item>
    <item>
      <title>Creating a VPC and Launching a Web Application in an Amazon EC2 Instance</title>
      <dc:creator>Mubeen Babar</dc:creator>
      <pubDate>Sun, 10 Nov 2024 12:10:26 +0000</pubDate>
      <link>https://dev.to/mubeen780/creating-a-vpc-and-launching-a-web-application-in-an-amazon-ec2-instance-jpf</link>
      <guid>https://dev.to/mubeen780/creating-a-vpc-and-launching-a-web-application-in-an-amazon-ec2-instance-jpf</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Task 1: Create a Virtual Private Cloud&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;CREATE A VPC, PUBLIC SUBNETS, ROUTE TABLE, AND INTERNET GATEWAY&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the top of the AWS Management Console, in the search bar, search for and choose VPC&lt;/li&gt;
&lt;li&gt;Choose Create VPC&lt;/li&gt;
&lt;li&gt;On the left side of the Create VPC console, locate the VPC settings section, and select  VPC and more in the Resources to create section.&lt;/li&gt;
&lt;li&gt;In the Name tag auto-generation section, select  Auto-generate, if not already selected.&lt;/li&gt;
&lt;li&gt;In the text box under the Auto-generate option, enter the name&lt;/li&gt;
&lt;li&gt;In the IPv4 CIDR block section, enter 10.0.0.0/16&lt;/li&gt;
&lt;li&gt;In the IPv6 CIDR block section, select the No IPv6 CIDR block option, if not already selected.&lt;/li&gt;
&lt;li&gt;Leave the Tenancy section set to Default.&lt;/li&gt;
&lt;li&gt;In the Number of Availability Zones (AZs) section, select 2&lt;/li&gt;
&lt;li&gt;In the Number of public subnets section, select 2&lt;/li&gt;
&lt;li&gt;In the Number of private subnets section, select 0&lt;/li&gt;
&lt;li&gt;Expand the  Customize subnets CIDR blocks option&lt;/li&gt;
&lt;li&gt;In the first text box, enter the following: 10.0.0.0/24. This CIDR range contains all IP addresses starting with 10.0.0.x.&lt;/li&gt;
&lt;li&gt;In the second text box, enter the following: 10.0.1.0/24. This CIDR range contains all IP addresses starting with 10.0.1.x.&lt;/li&gt;
&lt;li&gt;In the NAT gateways section, select None&lt;/li&gt;
&lt;li&gt;In the VPC endpoints section, select None&lt;/li&gt;
&lt;li&gt;In the DNS options section, select both Enable DNS hostnames and Enable DNS resolution.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The DNS hostnames attribute determines whether instances launched in the VPC receive public DNS hostnames that correspond to their public IP addresses. The DNS resolution attribute determines whether DNS resolution through the Amazon DNS server is supported for the VPC.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Review the Preview section on the right side of the screen. This preview should include the name of your VPC, the two subnets you created, a public route table, and an Internet gateway.&lt;/li&gt;
&lt;li&gt;If the Preview section presents the correct information, select Create VPC.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The Create VPC workflow screen appears. Wait for the workflow to finish. You should receive a message indicating everything created successfully.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Success
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Review the details of the workflow. Note that the VPC workflow created your Internet gateway, attached the Internet gateway to your VPC, and associated your subnets to your route table. An example can be found below:&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Select View VPC&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ADD A PUBLIC ROUTE TO THE ROUTE TABLE
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Choose Route tables. Refresh the selection. Select the Main route table for lab-2-vpc&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;There is currently only one route used for all internal traffic within the VPC. To access the Internet, you must first add a route to the Internet gateway.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Select Edit routes&lt;/li&gt;
&lt;li&gt;Select Add route&lt;/li&gt;
&lt;li&gt;In the Destination column, locate the text box and enter the following: 0.0.0.0/0&lt;/li&gt;
&lt;li&gt;In the Target column, locate the text box and select it. A list of options should present themselves. Select Internet Gateway. The 
id and name of your Internet Gateway should populate. Select the Internet Gateway ID named lab-2-igw&lt;/li&gt;
&lt;li&gt;Select Save changes&lt;/li&gt;
&lt;li&gt;You should receive an output message similar to the following:
Updated routes for rtb-xxxxxxxxxxxxxxxx successfully&lt;/li&gt;
&lt;li&gt;Navigate to the bottom of the VPC console and select the Routes tab, if not already selected.&lt;/li&gt;
&lt;li&gt;Note the two routes:&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;An internal route for VPC traffic&lt;/li&gt;
&lt;li&gt;A public route to the Internet by way of the Internet Gateway&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The diagram below represents your new custom VPC:&lt;/p&gt;

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

&lt;p&gt;Congratulations! You successfully created a custom VPC, Internet gateway, route table, a public route to the Internet, and two public subnets in two separate availability zones.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Task 2: Create a VPC Security Group&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In the left navigation pane, locate the Security section, and choose Security groups.&lt;/li&gt;
&lt;li&gt;In the top-right area of your window, choose Create security group.&lt;/li&gt;
&lt;li&gt;In the Basic details section, locate the Security group name text box and enter the value Web Security Group&lt;/li&gt;
&lt;li&gt;In the Basic details section, locate the Description text box and enter the value Enable HTTP access from anywhere&lt;/li&gt;
&lt;li&gt;In the Basic details section, locate the VPC text box, select the X to remove the default VPC, and choose the VPC with name lab-2-vpc. Once select, the lab-2-vpc&lt;/li&gt;
&lt;li&gt;In the Inbound rules section, choose Add rule.&lt;/li&gt;
&lt;li&gt;In the Type column, select the  dropdown and choose HTTP&lt;/li&gt;
&lt;li&gt;In the Source column, select the  dropdown and choose 
Anywhere-IPv4&lt;/li&gt;
&lt;li&gt;In the Description column, locate the text box and enter 
Allow web requests from anywhere&lt;/li&gt;
&lt;li&gt;Navigate to the bottom of the Create security group window, and choose Create security group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations! You successfully created a custom Security Group that allows inbound web traffic from anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Task 3: Launch Your Amazon EC2 Instance&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;At the top of the AWS Management Console, in the search bar, search for and choose EC2&lt;/li&gt;
&lt;li&gt;In the left navigation pane, in the Instances section, choose Instances.&lt;/li&gt;
&lt;li&gt;Choose Launch instances.&lt;/li&gt;
&lt;li&gt;In the Name and tags section, locate the Name text box, and enter the value Web Application&lt;/li&gt;
&lt;li&gt;In the Application and OS images section, locate the Quick start window, and select Amazon Linux 2023&lt;/li&gt;
&lt;li&gt;Under the Quick start window, locate the  Amazon Machine Image (AMI) dropdown and select the AMI named Amazon Linux 2023 AMI&lt;/li&gt;
&lt;li&gt;Under the Description section, locate the  Architecture dropdown and select 64-bit (x86)&lt;/li&gt;
&lt;li&gt;In the Instance type section, locate the  Instance type dropdown and select t3.micro&lt;/li&gt;
&lt;li&gt;In the Key pair (login) section, locate the  key pair name dropdown and select Proceed without a key pair (Not recommended)&lt;/li&gt;
&lt;li&gt;In the Network settings section, select Edit.&lt;/li&gt;
&lt;li&gt;Locate the  VPC dropdown and select lab-2-vpc&lt;/li&gt;
&lt;li&gt;Locate the  Subnet dropdown and select lab-2-subnet-public-1-[az-a] where [az-a] is the first availability zone in your region.&lt;/li&gt;
&lt;li&gt;Locate the Auto-assign public IP dropdown and select Enable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: This setting assigns a public IP address to the instance so you can access the application in your browser.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Firewall (security groups) section, choose
Select an existing security group&lt;/li&gt;
&lt;li&gt;Locate the Common security groups dropdown and select the security group named Web Security Group&lt;/li&gt;
&lt;li&gt;You can leave the Configure storage section set to the default values.&lt;/li&gt;
&lt;li&gt;Scroll down to the  Advanced Details section, expand, the dropdown, and locate the User data text box.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts.&lt;br&gt;
Your instance uses an Amazon Linux 2023 operating system; therefore, you need to provide a shell script that will run when the instance starts. This script installs the required application dependencies and launches the application. Without this user data script, you would need to log in to the EC2 Instance and execute all of the commands yourself.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the following script and paste it into the User data text box. To copy the script, you can use the Clipboard button, located in the top-right corner of the code box below:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash -ex

# Update yum
yum -y update

#Install nodejs
yum -y install nodejs

# Create a dedicated directory for the application
mkdir -p /var/app

# Get the app from S3
wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/ILT-TF-100-TECESS-5/app/app.zip

# Extract it to the desired folder
unzip app.zip -d /var/app/
cd /var/app/

# Install dependencies
npm install

# Start the app
npm start

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

&lt;/div&gt;



&lt;p&gt;This script performs the following tasks:&lt;br&gt;
• Install system updates&lt;br&gt;
• Install a source repository to download the Node.js installer&lt;br&gt;
• Install Node.js&lt;br&gt;
• Download the application code&lt;br&gt;
• Create a dedicated directory for the web application&lt;br&gt;
• Download and extract the application into the specified directory&lt;br&gt;
• Install the application dependencies&lt;br&gt;
• Set the listener port for the application&lt;br&gt;
• Start the web application&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Summary section, for Number of instances text box, enter the value 1, if not already done.&lt;/li&gt;
&lt;li&gt;Select Launch instance.&lt;/li&gt;
&lt;li&gt;Wait for the instance to launch. You should receive an message indicating the launch completed. See the message below:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Successfully initiated launch of instance (instance-id)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose View all instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: You may need to  refresh the Instances page for the instance to appear in the list of instances.&lt;br&gt;
The instance should appear in a  Pending or  Initializing state, which means it is launching. When the Instance state changes to  Running, the instance is booting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To see the instance details, choose your  Web Application instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To show more or less information in the Details tab, drag the window divider. You can review the instance details including the instance type, security settings, network settings, etc.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Instance window, at the top of the page, locate the Instance state and Status check columns. Wait for the values to indicate the following:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;• Instance state:  Running&lt;br&gt;
• Status check:  2/2 checks passed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Details tab, locate the Public IPv4 address section, and copy the IP address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: If you refreshed the Instances window, you may need to choose your  Web Application instance again.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a new browser tab and paste the IP address you copied in the previous step. You should see the following application screen.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Note: If you use the open address  link, your browser might try to browse to the application using &lt;br&gt;
https://, which won’t work. The application can only be accessed using &lt;br&gt;
http:// on port 80&lt;/p&gt;

&lt;p&gt;The follow diagram represents the completed lab environment:&lt;/p&gt;

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

&lt;p&gt;Once you access the web application successfully, you can close the browser tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations! You successfully created an EC2 Instance and deployed a web application using a user data script.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create a Static Website with Amazon Simple Storage Service (Amazon S3) with Public Access</title>
      <dc:creator>Mubeen Babar</dc:creator>
      <pubDate>Sat, 24 Aug 2024 23:00:51 +0000</pubDate>
      <link>https://dev.to/mubeen780/create-a-static-website-with-amazon-simple-storage-service-amazon-s3-with-public-access-29i0</link>
      <guid>https://dev.to/mubeen780/create-a-static-website-with-amazon-simple-storage-service-amazon-s3-with-public-access-29i0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;br&gt;
By the end of this lab, you will be able to do the following:&lt;br&gt;
• Create an S3 bucket.&lt;br&gt;
• Configure the S3 bucket as a static website and allow public access.&lt;br&gt;
• Add a bucket policy.&lt;br&gt;
• Create and upload the website assets.&lt;br&gt;
• Test the Amazon S3 static website.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1-Start lab&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Log in to AWS Management Console: Go to the &lt;em&gt;&lt;a href="https://aws.amazon.com/console/" rel="noopener noreferrer"&gt;https://aws.amazon.com/console/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2-Create an S3 bucket&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here you will create a Bucket simply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the top of the AWS Management Console, in the search bar, search for and choose S3.&lt;/li&gt;
&lt;li&gt;Choose Create bucket.&lt;/li&gt;
&lt;li&gt;For Bucket name, Enter a Bucket name (globally unique).&lt;/li&gt;
&lt;li&gt;To create the bucket and accept the remaining default values for Object Ownership, Block Public Access settings for this bucket, Bucket Versioning, and Default Encryption, choose Create bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3-Configure the S3 bucket as a static website and allow public access&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this task, you update the bucket’s properties to allow static website hosting. After you allow static website hosting, you also need to update the bucket’s permissions to allow public access to the bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.1-Configure the S3 bucket as a static website&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose the text link for the bucket that you just created.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose the Properties tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Under Static website hosting, choose Edit and then select the following options:&lt;br&gt;
• For the Static website hosting option, select Enable.&lt;br&gt;
• For Hosting type, select Host a static website.&lt;br&gt;
• For Index document, enter  index.html.&lt;br&gt;
• For Error document, enter  error.html&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose Save changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Return to the Static website hosting section and for later reference, copy the value for the Bucket website endpoint into a text editor.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.2Allow public access to the bucket&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, Amazon S3 blocks public access to your account and buckets. If you want to use a bucket to host a static website, you must allow public access to the bucket. Use these steps to edit permissions for the Block public access (bucket settings).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the page for the bucket you created, choose the Permissions tab.&lt;/li&gt;
&lt;li&gt;From the Block public access (bucket settings) section, choose Edit.&lt;/li&gt;
&lt;li&gt;Clear Block all public access, and choose Save changes.&lt;/li&gt;
&lt;li&gt;In the Edit Block public access (bucket settings) warning window, enter  confirm and choose Confirm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Amazon S3 console generates the following confirmation message: Successfully edited Block Public Access settings for this bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  4-Add a bucket policy to allow public access to content in your bucket
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Choose the Permissions tab.&lt;/li&gt;
&lt;li&gt;Under Bucket Policy, choose Edit .&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To grant public read access for your website, copy the following bucket policy and in the Bucket policy editor, paste the policy.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{&lt;br&gt;
"Version": "2012-10-17",&lt;br&gt;
"Statement": [&lt;br&gt;
    {&lt;br&gt;
        "Sid": "PublicReadGetObject",&lt;br&gt;
        "Effect": "Allow",&lt;br&gt;
        "Principal": "&lt;em&gt;",&lt;br&gt;
        "Action": [&lt;br&gt;
            "s3:GetObject"&lt;br&gt;
        ],&lt;br&gt;
        "Resource": [&lt;br&gt;
            "arn:aws:s3:::Bucket-Name/&lt;/em&gt;"&lt;br&gt;
        ]&lt;br&gt;
    }&lt;br&gt;
]&lt;br&gt;
}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update Resource to use your bucket name.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: In a bucket policy, the value of Resource is the Amazon Resource Name (ARN) for the bucket. (The Bucket ARN is listed above the Policy editor window.) In the preceding example policy, Bucket-Name is a placeholder for the name of your bucket. To use this bucket policy with your own bucket, you must update this name to match your bucket name. Be sure to include the trailing /* characters because they are important for the functionality of the overall policy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After you update the policy, choose Save changes &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5-Create and upload the website assets and test the website
&lt;/h2&gt;

&lt;p&gt;In this task, you create and upload the website assets to your S3 bucket. Website assets include images, style sheets, scripts, fonts, and other files that contribute to the visual and functional aspects of the website. In this lab, to help simplify the experience, the website assets include an index.html file and an error.html file. After you upload the assets to the S3 bucket, you test the website by opening a web browser to the Amazon S3 URL that you saved earlier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.1Create the website assets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create the index.html file. This file serves as the initial landing page for the website.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a text editor.&lt;/li&gt;
&lt;li&gt;Copy the following HTML code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;AMAZON S3&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }
        h1 {
            color: #007bb5; /* LinkedIn color */
        }
        a {
            color: #007bb5;
            text-decoration: none;
            font-size: 18px;
        }
        a:hover {
            text-decoration: underline;
        }
        .success-message {
            margin-top: 20px;
            font-size: 18px;
            color: green;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;AMAZON S3&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;Check out my LinkedIn profile: &amp;lt;a href="https://www.linkedin.com/in/mubeen780/" target="_blank"&amp;gt;Mubeen's LinkedIn&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;p class="success-message"&amp;gt;Successfully accessed the website!&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In your text editor, paste the code.&lt;/li&gt;
&lt;li&gt;Save the file as index.html to your desktop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, you create the error.html file. This webpage is returned when a user enters an incorrect URL for this website.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In your text editor, create a new file.&lt;/li&gt;
&lt;li&gt;Copy the following HTML code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Error - Website Access&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 50px;
        }
        h1 {
            color: #ff4d4d; /* Red color for error */
        }
        p {
            font-size: 18px;
        }
        .error-message {
            color: #ff4d4d;
            font-size: 20px;
            margin-top: 20px;
        }
        .contact-info {
            margin-top: 30px;
        }
        .contact-info a {
            color: #007bb5; /* LinkedIn color */
            text-decoration: none;
            font-size: 18px;
        }
        .contact-info a:hover {
            text-decoration: underline;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Error&amp;lt;/h1&amp;gt;
    &amp;lt;p class="error-message"&amp;gt;Unable to access the website. Please try again later.&amp;lt;/p&amp;gt;
    &amp;lt;div class="contact-info"&amp;gt;
        &amp;lt;p&amp;gt;Contact Mubeen:&amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;&amp;lt;a href="https://www.linkedin.com/in/mubeen780/" target="_blank"&amp;gt;LinkedIn Profile&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;


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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In your text editor, paste the code.&lt;/li&gt;
&lt;li&gt;Save the file as error.html to your desktop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5.2-Upload the website assets to your bucket&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that you’ve created the website assets, you can upload the assets to your bucket.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Return to the browser tab with the Amazon S3 console and choose the Objects tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose  Upload.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose Add files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to your desktop, select the index.html file and the error.html file, and choose Open.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose Upload.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To return to the root of your bucket, choose Close.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test the Amazon S3 static website&lt;/p&gt;

&lt;p&gt;Now that you’ve uploaded the index.html and error.html files, it’s time to test the Amazon S3 static website.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the URL that you saved earlier, and in a new browser tab, paste the URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following example is what you can expect the landing page of the website to look like.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;In the browser’s address bar, go to the end of the URL and add /aboutus.html to it, and press the Enter or Return key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following example is what you can expect the website’s error.html page to look like when an incorrect URL is used.&lt;/p&gt;

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

&lt;p&gt;The browser can’t find the path to the /aboutus location, so the error.html page is returned as expected.&lt;/p&gt;

&lt;p&gt;By following these steps, you can efficiently host a static website using Amazon S3, leveraging its scalability and cost-effectiveness. Amazon S3 is designed to handle large amounts of data and high traffic with ease, making it ideal for static websites that don’t require server-side processing.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>cloudcomputing</category>
      <category>website</category>
    </item>
    <item>
      <title>Amazon EC2 Instance</title>
      <dc:creator>Mubeen Babar</dc:creator>
      <pubDate>Sat, 03 Aug 2024 19:44:13 +0000</pubDate>
      <link>https://dev.to/mubeen780/amazon-ec2-instance-266e</link>
      <guid>https://dev.to/mubeen780/amazon-ec2-instance-266e</guid>
      <description>&lt;p&gt;Amazon Elastic Compute Cloud (EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers and businesses by offering virtual servers, known as instances, that can be tailored to meet specific needs. Here is a step-by-step guide to creating an EC2 instance:&lt;/p&gt;

&lt;p&gt;Step 1: Access the AWS Console&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Log into your AWS account via the &lt;a href="https://aws.amazon.com/console/" rel="noopener noreferrer"&gt;https://aws.amazon.com/console/&lt;/a&gt; &lt;br&gt;
Navigate to EC2, From the console homepage, click on Services and select EC2 under the "Compute" category.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Step 2: Launch Instance&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Click on the Launch Instance button to start the instance creation process. This will open the "Launch Instance."&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give the Name (Should be unique)&lt;/li&gt;
&lt;li&gt;Choose an Amazon Machine Image (AMI)
Select AMI: AMIs are pre-configured templates for your instances. Choose an appropriate AMI from the list of available options, such as:&lt;/li&gt;
&lt;li&gt;Amazon Linux 2 
Custom AMIs: You can also use custom AMIs if you need specific software configurations or want to launch an instance from a previous backup.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Step 3: Choose an Instance Type&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Select the instance type based on the required CPU, memory, storage, and networking capacity. Common instance types include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;t2.micro: Free tier eligible, suitable for low-traffic applications.&lt;/li&gt;
&lt;li&gt;r5.large: Memory-optimized for applications with significant memory requirements.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Specifications upto you how much you need, Each instance type has specific CPU cores, memory size, storage options, and network performance.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a key pair for getting the access to the virtual machine. There are two types of key pairs you can download.&lt;br&gt;
1- .PEM (For SSH)&lt;br&gt;
2- .PPK (For Putty)&lt;br&gt;
Here i downloaded .PEM File to access by SSH through my Command Line.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Step 4: Network Settings&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Select the Virtual Private Cloud (VPC) where the instance will reside.&lt;/li&gt;
&lt;li&gt;Choose the subnet that aligns with your instance's geographical or logical needs.&lt;/li&gt;
&lt;li&gt;Auto-assign Public IP, Decide if you need a public IP address to access the instance over the internet.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step 5: Configure Storage&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Volume Type, Specify the type of storage, such as General Purpose SSD (gp2), Provisioned IOPS SSD (io1), or Magnetic.&lt;/li&gt;
&lt;li&gt;Size: Define the storage capacity in GiB.&lt;/li&gt;
&lt;li&gt;Additional Volumes: Optionally, add more volumes for additional storage requirements. &lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Step 6: Review and Launch&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Review: Double-check all configurations to ensure they meet your requirements.&lt;/li&gt;
&lt;li&gt;Launch: Click the Launch button to start the instance creation process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Step 7: Access the Instance&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Connect: Once the instance is running, connect using the preferred method:&lt;/li&gt;
&lt;li&gt;SSH: Use the terminal or an SSH client for Linux-based instances.&lt;/li&gt;
&lt;li&gt;Public DNS: Use the public DNS name or IP address to connect remotely.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;By clicking on Connect which is located on top.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Now Choose the method to connect(SSH)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Open CMD and go to the path where .PEM file is located&lt;/li&gt;
&lt;li&gt;Copy the SSH command and paste it in CMD and press Enter.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Here you can see we get access to our Instance/Virtual Machine (Amazon Linux) we created...&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;By following these steps, you can effectively create and manage EC2 instances , providing the flexibility and scalability required for various applications and workloads.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>cloudcomputing</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
