<?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: Samir</title>
    <description>The latest articles on DEV Community by Samir (@abdulrahmansamir).</description>
    <link>https://dev.to/abdulrahmansamir</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%2F873758%2Faf5434cc-d0a3-4d1e-87ca-fb0738176ffd.png</url>
      <title>DEV Community: Samir</title>
      <link>https://dev.to/abdulrahmansamir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abdulrahmansamir"/>
    <language>en</language>
    <item>
      <title>Implementing OSRM Map Backend on AWS Elastic Container Service (ECS)</title>
      <dc:creator>Samir</dc:creator>
      <pubDate>Thu, 06 Jul 2023 16:31:26 +0000</pubDate>
      <link>https://dev.to/abdulrahmansamir/implementing-osrm-on-aws-elastic-container-service-ecs-21d1</link>
      <guid>https://dev.to/abdulrahmansamir/implementing-osrm-on-aws-elastic-container-service-ecs-21d1</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CI1rnMG5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/li3jwaxmvxceucyeq5so.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CI1rnMG5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/li3jwaxmvxceucyeq5so.png" alt="Image description" width="800" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;The Open Source Routing Machine (OSRM) is a powerful routing engine designed for calculating shortest paths in road networks.&lt;/p&gt;

&lt;p&gt;In this blog, we will explore the process of deploying OSRM on AWS Elastic Container Service (ECS), allowing you to leverage the scalability and flexibility of containerized environments. &lt;br&gt;
We will cover the steps to install Docker, create an OSRM Docker image, push the image to AWS Elastic Container Registry (ECR), and create an ECS cluster, task definition, and service, then publish OSRM service through AWS Application loadBalancer.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step1: Installing Docker and Creating an OSRM Docker Image:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Install Docker on Linux:&lt;/strong&gt;&lt;br&gt;
1- Run the following commands in your Admin Server:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;2- Create a demo folder and navigate to it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir demo &amp;amp;&amp;amp; cd demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3- Pull the OSRM Docker image from DockerHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull osrm/osrm-backend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4- Create a Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5- Add the following content to the Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM osrm/osrm-backend:latest

RUN mkdir /data
WORKDIR /data
ADD https://download.geofabrik.de/asia/gcc-states-latest.osm.pbf /data
RUN /usr/local/bin/osrm-extract -p /opt/car.lua /data/gcc-states-latest.osm.pbf &amp;amp;&amp;amp; \
    /usr/local/bin/osrm-partition /data/gcc-states-latest.osrm &amp;amp;&amp;amp; \
    /usr/local/bin/osrm-customize /data/gcc-states-latest.osrm

CMD [ "/usr/local/bin/osrm-routed", "--max-table-size", "100000", "--algorithm", "mld", "/data/gcc-states-latest.osrm" ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step2- Create an AWS ECR Repository and Push the OSRM Docker Image:
&lt;/h2&gt;

&lt;p&gt;1- Go to AWS ECR and click on "Repositories."&lt;br&gt;
2- Create a new repository with the name "osrm" and set the visibility to "Private."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Push the Docker image to AWS ECR:&lt;/strong&gt;&lt;br&gt;
Execute the following commands in your Admin Server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 612843029448.dkr.ecr.us-east-1.amazonaws.com
docker build -t osrm .
docker tag osrm:latest 612843029448.dkr.ecr.us-east-1.amazonaws.com/osrm:latest
docker push 612843029448.dkr.ecr.us-east-1.amazonaws.com/osrm:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step3- Creating an ECS Cluster, Task Definition, and Service:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Create an ECS Cluster:&lt;/strong&gt;&lt;br&gt;
Provide a name for the cluster (e.g., "osrm-demo").&lt;br&gt;
Choose the desired VPC and private subnets.&lt;br&gt;
Select "Amazon EC2 instances" as the infrastructure type.&lt;br&gt;
Create a new Auto Scaling group (ASG) with the following settings:&lt;br&gt;
Operating system/Architecture: Amazon Linux 2&lt;br&gt;
EC2 instance type: t3.large&lt;br&gt;
Desired capacity: Minimum (1), Maximum (1)&lt;br&gt;
Enable optional monitoring using Container Insights.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a Task Definition in JSON format:&lt;/strong&gt;&lt;br&gt;
Use the provided JSON template to define the OSRM task with the necessary configurations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "taskDefinitionArn": "arn:aws:ecs:ap-south-1:012345678901:task-definition/osrm:1",
    "containerDefinitions": [
        {
            "name": "osrm",
            "image": "012345678901.dkr.ecr.ap-south-1.amazonaws.com/osrm:latest",
            "cpu": 2048,
            "memory": 4096,
            "portMappings": [
                {
                    "name": "osrm-5000-tcp",
                    "containerPort": 5000,
                    "hostPort": 0,
                    "protocol": "tcp",
                    "appProtocol": "http"
                }
            ],
            "essential": true,
            "environment": [],
            "mountPoints": [],
            "volumesFrom": [],
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-create-group": "true",
                    "awslogs-group": "/ecs/osrm",
                    "awslogs-region": "us-east-1",
                    "awslogs-stream-prefix": "ecs"
                }
            }
        }
    ],
    "family": "osrm",
    "taskRoleArn": "arn:aws:iam::012345678901:role/ecsTaskRole",
    "executionRoleArn": "arn:aws:iam::012345678901:role/ecsTaskExecutionRole",
    "networkMode": "bridge",
    "revision": 1,
    "volumes": [],
    "status": "ACTIVE",
    "requiresAttributes": [
        {
            "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
        },
        {
            "name": "ecs.capability.execution-role-awslogs"
        },
        {
            "name": "com.amazonaws.ecs.capability.ecr-auth"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
        },
        {
            "name": "com.amazonaws.ecs.capability.task-iam-role"
        },
        {
            "name": "ecs.capability.execution-role-ecr-pull"
        },
        {
            "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
        }
    ],
    "placementConstraints": [],
    "compatibilities": [
        "EC2"
    ],
    "requiresCompatibilities": [
        "EC2"
    ],
    "cpu": "2048",
    "memory": "4096",
    "runtimePlatform": {
        "cpuArchitecture": "X86_64",
        "operatingSystemFamily": "LINUX"
    },
    "registeredAt": "2023-01-01T16:18:09.874Z",
    "registeredBy": "arn:aws:iam::012345678901:user/myuser",
    "tags": [
        {
            "key": "Name",
            "value": "osrm"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create an ECS Service:&lt;/strong&gt;&lt;br&gt;
1- In either the Task Definition or Cluster console, click on "Create Service."&lt;br&gt;
2- Select the existing ECS cluster "osrm-demo".&lt;br&gt;
3- Choose "Capacity provider strategy" under "Compute options."&lt;br&gt;
3- Set the task definition to "osrm" with revision 1 (or the latest revision).&lt;br&gt;
3- Specify the desired number of tasks (e.g., 1).&lt;br&gt;
4- Configure the deployment options and failure detection as per your requirements.&lt;br&gt;
5- Set up an Application Load Balancer (ALB) for load balancing.&lt;br&gt;
6- Create the service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xn-hAZRt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvu4uc8eahvfsnogbdsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xn-hAZRt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rvu4uc8eahvfsnogbdsw.png" alt="Image description" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating an AWS Application Load Balancer (ALB):&lt;/strong&gt;&lt;br&gt;
1- Provide a name for the ALB (e.g., "osrm-demo-ALB").&lt;br&gt;
2- Set the scheme to "Internet-facing" and IP address type to "IPv4".&lt;br&gt;
3- Choose your VPC and configure mappings for two Availability Zones with one public subnet per zone.&lt;br&gt;
4- Associate the ALB with an existing security group (e.g., "Demo-SG").&lt;br&gt;
5- Configure the ALB listener for port 5000 and protocol HTTP.&lt;br&gt;
6- Create a new target group (e.g., "osrm-tg") and set the health check path to &lt;strong&gt;"/nearest/v1/driving/13.388860%2C52.517037?number=3&amp;amp;bearings=0%2C20"&lt;/strong&gt; (URL-encoded format).&lt;br&gt;
7- Save the ALB configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yns8wGAW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oocrmdz6et1s9a7z09c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yns8wGAW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oocrmdz6et1s9a7z09c6.png" alt="Image description" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step4- Testing the OSRM Deployment:
&lt;/h2&gt;

&lt;p&gt;You can test your OSRM deployment by accessing the URL generated by your ALB, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://osrm-demo-alb-012345678901.us-east-1.elb.amazonaws.com:5000/nearest/v1/driving/13.388860%2C52.517037?number=3&amp;amp;bearings=0%2C20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;br&gt;
OSRM: &lt;a href="https://map.project-osrm.org/"&gt;https://map.project-osrm.org/&lt;/a&gt;&lt;br&gt;
osrm-backend in GitHub: &lt;a href="https://github.com/Project-OSRM/osrm-backend/tree/master"&gt;https://github.com/Project-OSRM/osrm-backend/tree/master&lt;/a&gt;&lt;br&gt;
osrm-backend image in Dockerhub: &lt;a href="https://hub.docker.com/r/osrm/osrm-backend/"&gt;https://hub.docker.com/r/osrm/osrm-backend/&lt;/a&gt;&lt;br&gt;
URL Encoding Reference: &lt;a href="https://www.w3schools.com/tags/ref_urlencode.ASP"&gt;https://www.w3schools.com/tags/ref_urlencode.ASP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
By following the steps outlined in this blog, you can successfully deploy OSRM on AWS Elastic Container Service (ECS). Leveraging the power of containers and AWS services like ECR and ECS, you can easily scale and manage your OSRM routing engine to handle routing requests efficiently. Enjoy exploring the possibilities of OSRM and building applications that leverage its robust routing capabilities!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>ecs</category>
      <category>docker</category>
    </item>
    <item>
      <title>Choosing the Right AWS Region: Considerations for Cost, Latency, and Service Availability</title>
      <dc:creator>Samir</dc:creator>
      <pubDate>Tue, 04 Jul 2023 12:07:48 +0000</pubDate>
      <link>https://dev.to/abdulrahmansamir/choosing-the-right-aws-region-considerations-for-cost-latency-and-service-availability-4g5j</link>
      <guid>https://dev.to/abdulrahmansamir/choosing-the-right-aws-region-considerations-for-cost-latency-and-service-availability-4g5j</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8sVb-9ih--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xuu3wkjiqurlb84h97l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8sVb-9ih--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xuu3wkjiqurlb84h97l.png" alt="Image description" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When deploying your applications on AWS, selecting the appropriate region is an essential decision that can impact factors such as cost, latency, and service availability. In this blog post, we will explore how to make an informed choice by considering these critical aspects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost Considerations:
&lt;/h2&gt;

&lt;p&gt;Determining the cost of running your application in different regions is crucial for optimizing your expenses. &lt;br&gt;
AWS provides a pricing calculator that enables you to estimate the costs of various resources. &lt;br&gt;
For example, you can use AWS calculator to evaluate the pricing for an EC2 m5.2xlarge instance in multiple regions.&lt;br&gt;
&lt;a href="https://calculator.aws/"&gt;https://calculator.aws/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Latency Considerations:
&lt;/h2&gt;

&lt;p&gt;Reducing latency is crucial for ensuring optimal application performance. To evaluate latency from different regions, you can check links such as  &lt;a href="https://aws-latency-test.com/"&gt;https://aws-latency-test.com/&lt;/a&gt; and CloudPing.info &lt;br&gt;
These platforms allow you to measure network latency and determine the best regions based on your specific requirements.&lt;br&gt;
By leveraging these tools, you can gain insights into network performance and select regions that offer lower latency, thereby enhancing the user experience for your application's target audience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Service Availability by Region:
&lt;/h2&gt;

&lt;p&gt;AWS's global infrastructure is spread across multiple regions, each providing a different set of services. To identify the availability of specific AWS services in different regions, you can refer to the official AWS Regional Services List.&lt;br&gt;
&lt;a href="https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/"&gt;https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/&lt;/a&gt;&lt;br&gt;
By exploring this resource, you can ensure that the services required by your application are accessible and supported in the regions you are considering. This information allows you to make informed decisions and avoid potential limitations or constraints that may arise from service unavailability in specific regions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Choosing the right AWS region involves considering several factors such as cost, latency, and service availability. By utilizing tools like the AWS pricing calculator, aws-latency-test.com, and the AWS Regional Services List, you can gather the necessary information to make informed decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember to&lt;/strong&gt; evaluate your specific requirements and priorities when selecting an AWS region. By doing so, you can optimize costs, minimize latency, and ensure that the required services are available to support your application's successful deployment and performance.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>Creating and Mounting EFS on AWS EC2 with system manager runbook</title>
      <dc:creator>Samir</dc:creator>
      <pubDate>Tue, 04 Jul 2023 11:17:26 +0000</pubDate>
      <link>https://dev.to/abdulrahmansamir/creating-and-mounting-efs-on-aws-ec2-with-system-manager-runbook-59o4</link>
      <guid>https://dev.to/abdulrahmansamir/creating-and-mounting-efs-on-aws-ec2-with-system-manager-runbook-59o4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this blog post, we will walk you through the steps to create and mount an Amazon Elastic File System (EFS) on an AWS EC2 instance using the &lt;strong&gt;AWSSupport-CheckAndMountEFS&lt;/strong&gt; system manager runbook. EFS provides scalable and shared file storage that can be accessed from multiple EC2 instances simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Systems Manager Automation runbook&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS Systems Manager provides predefined runbooks. These runbooks are maintained by Amazon Web Services, AWS Support, and AWS Config. The runbook reference describes each of the predefined runbooks provided by Systems Manager, AWS Support, and AWS Config.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWSSupport-CheckAndMountEFS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The AWSSupport-CheckAndMountEFS runbook verifies the prerequisites to mount your Amazon Elastic File System (Amazon EFS) file system and mounts the file system on the Amazon Elastic Compute Cloud (Amazon EC2) instance you specify. &lt;br&gt;
This runbook supports mounting your Amazon EFS file system with the DNS name, or using the mount target’s IP address.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Step 1: Create EFS from AWS Console
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log in to the AWS Management Console and navigate to the EFS service.&lt;/li&gt;
&lt;li&gt;Click on "Create file system" and provide a name for your EFS.&lt;/li&gt;
&lt;li&gt;Choose the VPC where your EC2 instance resides.&lt;/li&gt;
&lt;li&gt;Select the "Regional" EFS option for high availability.&lt;/li&gt;
&lt;li&gt;(Optional) In the advanced options, you can choose the storage class. For example, you can select the "Standard" storage type instead of "Infrequent Access" (IA) if desired.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2: Configure Network in EFS
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;After the EFS creation, navigate to the EFS dashboard and go to the "Network" tab, then click on "Manage".
Copy the security groups listed under "Mount targets" and navigate to the EC2 service, then go to "Security Groups".&lt;/li&gt;
&lt;li&gt;Add the EC2 instance's security group as a source under the EFS security group to allow access.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: Install EFS Utils
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Connect to your EC2 instance using SSH or AWS SSM.&lt;/li&gt;
&lt;li&gt;Run the following command based on your Linux distribution:
For SUSE: zypper install aws-efs-utils
For Amazon Linux 2: sudo yum install -y amazon-efs-utils&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 4: Create EFS with AWS SSM Document
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the AWS Systems Manager (SSM) service and go to "Documents".&lt;/li&gt;
&lt;li&gt;Search for "AWSSupport-CheckAndMountEFS" and select the corresponding document.&lt;/li&gt;
&lt;li&gt;Click on "Execute automation" in the top right corner.&lt;/li&gt;
&lt;li&gt;Choose "Simple execution".&lt;/li&gt;
&lt;li&gt;Provide the necessary input parameters:
Choose your EC2 instance (only one instance allowed at a time).
EfsId: Enter the EFS ID obtained from the EFS console.
MountPoint: Specify the desired mount point (e.g., /usr/test).
Region: Select your desired region.
Action: Choose "CheckandMount".&lt;/li&gt;
&lt;li&gt;add your tags.&lt;/li&gt;
&lt;li&gt;Click on "Execute" to run the automation.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 5: Keep Mounted File After Reboot
&lt;/h2&gt;

&lt;p&gt;In your EC2 server, navigate to the /etc/fstab file.&lt;br&gt;
Add the following line, replacing the EFS ID and directory (/usr/test) with your own:&lt;/p&gt;

&lt;p&gt;fs-0c1cf955858757bc7.efs.us-east-1.amazonaws.com:/ /usr/test efs defaults,_netdev 0 0&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Test EFS Mounting
&lt;/h2&gt;

&lt;p&gt;To unmount the EFS, run the command: umount /usr/test.&lt;br&gt;
Use the command "mount -a" to read the /etc/fstab file and mount all file systems listed in it.&lt;br&gt;
Verify the mounted EFS by running the command: df -hT&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;By following the above steps, you can create and mount an Amazon EFS on your AWS EC2 instance using the AWSSupport-CheckAndMountEFS system manager runbook. This enables you to leverage scalable and shared file storage for your applications. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awssupport-check-and-mount-efs.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awssupport-check-and-mount-efs.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/efs/latest/ug/automount-with-efs-mount-helper.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/efs/latest/ug/automount-with-efs-mount-helper.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>storage</category>
      <category>cloud</category>
      <category>ec2</category>
    </item>
    <item>
      <title>Step-by-Step Guide: Creating an AWS Client VPN Connection with Peered VPC</title>
      <dc:creator>Samir</dc:creator>
      <pubDate>Tue, 04 Jul 2023 09:45:54 +0000</pubDate>
      <link>https://dev.to/abdulrahmansamir/step-by-step-guide-creating-an-aws-client-vpn-connection-with-peered-vpc-1dgm</link>
      <guid>https://dev.to/abdulrahmansamir/step-by-step-guide-creating-an-aws-client-vpn-connection-with-peered-vpc-1dgm</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YTIseDNs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ga9vl4jv1mcewt8hmz3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YTIseDNs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ga9vl4jv1mcewt8hmz3c.png" alt="Image description" width="788" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;In this blog post, we will guide you through the process of setting up an AWS Client VPN connection with a peered VPC. &lt;br&gt;
This step-by-step tutorial will walk you through the necessary prerequisites and configuration steps to establish a secure VPN connection between your client and an AWS environment, while also enabling connectivity to resources in a peered VPC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites:
&lt;/h2&gt;

&lt;p&gt;Before we begin, make sure you have the following prerequisites in place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download Open VPN from the following link: &lt;a href="https://openvpn.net/client-connect-vpn-for-windows/"&gt;https://openvpn.net/client-connect-vpn-for-windows/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Refer to the AWS Documentation here for detailed instructions: &lt;a href="https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/client-authentication.html"&gt;https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/client-authentication.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Generate AWS Certificates
&lt;/h2&gt;

&lt;p&gt;To start, follow these steps to create the required certificates:&lt;br&gt;
(For Windows)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download the "EasyRSA releases" from the AWS documentation and extract the files to your Desktop (not on a drive).&lt;br&gt;
Open the command prompt as an administrator and execute the following commands:&lt;br&gt;
.\EasyRSA-Start.bat&lt;br&gt;
./easyrsa init-pki&lt;br&gt;
./easyrsa build-ca nopass&lt;br&gt;
./easyrsa build-server-full server nopass&lt;br&gt;
./easyrsa build-client-full client1.domain.tld nopass&lt;br&gt;
exit&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the AWS Certificate Manager (ACM) and import two certificates: one for the server and one for the client.&lt;br&gt;
&lt;strong&gt;Server files&lt;/strong&gt;&lt;br&gt;
Certificate body: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; issued &amp;gt; server.crt&lt;br&gt;
Certificate private key: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; private &amp;gt; server.key&lt;br&gt;
Certificate chain: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; ca.crt&lt;br&gt;
&lt;strong&gt;Client files&lt;/strong&gt;&lt;br&gt;
Certificate body: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; issued &amp;gt; client1.domain.tld.crt&lt;br&gt;
Certificate private key: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; private &amp;gt; client1.domain.tld.key&lt;br&gt;
Certificate chain: EasyRSA-3.1.2 &amp;gt; pki &amp;gt; ca.crt&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2: Create an AWS Client VPN
&lt;/h2&gt;

&lt;p&gt;Now, let's create the AWS Client VPN with the following configuration:&lt;/p&gt;

&lt;p&gt;Name: My-VPN&lt;br&gt;
Client IPv4 CIDR: Define an address range that does not overlap with the target network, VPC address range, or any associated routes.&lt;br&gt;
Server certificate ARN: Choose the server certificate you imported earlier.&lt;br&gt;
Authentication options: Select "Use mutual authentication."&lt;br&gt;
Client certificate ARN: Choose the client certificate you imported earlier.&lt;br&gt;
Enable log details on client connections: Yes&lt;br&gt;
CloudWatch logs log group name: Create a new CloudWatch log group.&lt;br&gt;
Client connect handler: keep default&lt;br&gt;
DNS server 1 &amp;amp; 2: keep default&lt;br&gt;
Transport protocol: TCP&lt;br&gt;
Enable split-tunnel: Yes (to maintain local internet connectivity)&lt;br&gt;
Security group IDs: Create a new security group allowing all traffic from 0.0.0.0/0&lt;br&gt;
VPN port: 1194&lt;br&gt;
Enable self-service portal: Not allowed for mutual authentication.&lt;br&gt;
Enable client login banner: "Welcome to companyVPN".&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Configure AWS Client VPN Service
&lt;/h2&gt;

&lt;p&gt;Next, configure the AWS Client VPN service as follows:&lt;/p&gt;

&lt;p&gt;Target network associations: Associate the target VPC and subnets you want to connect to.&lt;br&gt;
Authorization rules: Add an authorization rule allowing all users from the VPC CIDR.&lt;br&gt;
Route table: The route table will be added automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Download Client Configuration
&lt;/h2&gt;

&lt;p&gt;Download the client configuration file from the AWS console.&lt;br&gt;
Open the file in a text editor (e.g., Notepad or VSCode) and make the following changes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add the client certificate file "client1.domain.tld.crt" in line 2:

Contents of client certificate (.crt) file
&lt;/li&gt;
&lt;li&gt;Add the client key file "client1.domain.tld.key" in line 2:

Contents of private key (.key) file
&lt;/li&gt;
&lt;li&gt;Add a subdomain (e.g., "company") before ".cvpn" in line 4:
remote company.cvpn-endpoint-0366a1a56fdf0ef53.prod.clientvpn.ap-south-1.amazonaws.com 1194&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
After completing the configuration, share the client configuration file with your team members who will be using the VPN to access the AWS environment. They can then connect by uploading the file to OpenVPN and clicking "Connect."&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect Client VPN to Peered VPC:
&lt;/h2&gt;

&lt;p&gt;If you want to connect your Client VPN to another VPC, follow these additional steps:&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create a VPC peering between both VPCs:
&lt;/h2&gt;

&lt;p&gt;Go to "Peering connections" and create a peering connection.&lt;br&gt;
Choose the "Requester" and "Accepter" VPCs, and fill in the required details.&lt;br&gt;
Accept the peering request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configure VPN Client-to-Server (C2S):
&lt;/h2&gt;

&lt;p&gt;In the Client VPN configuration, go to Authorization rules and add an authorization rule for the peered VPC.&lt;br&gt;
Create a route for the other VPC CIDR and choose a subnet in the Client VPN VPC for the target network association.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: VPN Route Table:
&lt;/h2&gt;

&lt;p&gt;Create a route in the VPN route table for the destination VPC CIDR.&lt;br&gt;
Add the subnets in the Client VPN VPC as the target network association.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Subnets Route Table:
&lt;/h2&gt;

&lt;p&gt;In all the subnets connected with the Client VPN in the Client VPN VPC, add a route for the full destination VPC CIDR with the VPC peering as the target.&lt;br&gt;
In all the subnets connected with the peered VPC, add a route for the full Client VPN VPC CIDR with the VPC peering as the target.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Security Groups:
&lt;/h2&gt;

&lt;p&gt;For the server or service you want to connect to using the Client VPN, add an inbound rule allowing all traffic from the Client VPN VPC CIDR as the source.&lt;br&gt;
By following these steps, you can establish a VPN connection between your Client VPN and another VPC, enabling secure communication between the two environments.&lt;/p&gt;

&lt;p&gt;Remember to modify the instructions and configurations according to your specific requirements and AWS region.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
In this blog post, we have provided a comprehensive step-by-step guide to creating an AWS Client VPN connection with a peered VPC. By following these instructions, you can set up a secure VPN connection and enable communication between your client and the AWS environment, as well as connect to resources in a peered VPC. Enjoy seamless and secure connectivity to your AWS resources!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>vpn</category>
      <category>cloud</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
