<?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: mostafamedhat1983</title>
    <description>The latest articles on DEV Community by mostafamedhat1983 (@mostafamedhat1983).</description>
    <link>https://dev.to/mostafamedhat1983</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%2F1112859%2Febf24423-7d26-45d5-a283-f9ed93843c4f.jpg</url>
      <title>DEV Community: mostafamedhat1983</title>
      <link>https://dev.to/mostafamedhat1983</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mostafamedhat1983"/>
    <language>en</language>
    <item>
      <title>Connect to EC2 using instance connect endpoint - A SIMPLE GUIDE</title>
      <dc:creator>mostafamedhat1983</dc:creator>
      <pubDate>Fri, 29 Sep 2023 20:47:53 +0000</pubDate>
      <link>https://dev.to/mostafamedhat1983/connect-to-ec2-using-instance-connect-endpoint-a-simple-guide-5c0j</link>
      <guid>https://dev.to/mostafamedhat1983/connect-to-ec2-using-instance-connect-endpoint-a-simple-guide-5c0j</guid>
      <description>&lt;p&gt;EC2 Instance Connect Endpoint allows you to connect to an instance without requiring the instance to have a public IPv4 address. You can connect to any instances that support TCP.&lt;br&gt;
For more info and its limitations please visit &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-using-eice.html" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To create an EC2 instance connect endpoint open VPC service from the management console, select Endpoints then Create endpoint.&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%2F35aol2vst5h245pnie2p.jpg" 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%2F35aol2vst5h245pnie2p.jpg" alt="create endpoint"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill in the endpoint name, choose EC2 Instance Connect Endpoint. then select the desired VPC.&lt;br&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%2Fvzimkrq6owqss5ggsjzg.jpg" 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%2Fvzimkrq6owqss5ggsjzg.jpg" alt="endpoint name"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can use the option "Preserve Client IP" if you want the endpoint to use your IP when establishing the connection (for example if you configured the EC2 instance's security group to only accept connections from your IP)&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%2Fc1u2tser8fi3dzjekf7x.jpg" 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%2Fc1u2tser8fi3dzjekf7x.jpg" alt="Preserve Client IP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;select desired subnet and endpoint security group, no need to open any ports in inbound rules. &lt;br&gt;
then click create endpoint. note that creation will take some time.&lt;br&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%2Faz422fip06shlj0s5qj1.jpg" 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%2Faz422fip06shlj0s5qj1.jpg" alt="ceate endpoint"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create an EC2 instance, in the management console go to EC2 service. Choose Instances then launch Instances.&lt;br&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%2F55mkxjmm5i5bxqs2zxru.jpg" 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%2F55mkxjmm5i5bxqs2zxru.jpg" alt="create an EC2 instance"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;fill in the EC2 instance name and choose the AMI&lt;br&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%2Fotevgqbt3ta1pns7oteq.jpg" 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%2Fotevgqbt3ta1pns7oteq.jpg" alt="ec2 name and ami"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;choose the key pair if you want, it is optional. and select the instance type&lt;br&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%2Fvgg6dxv1wal27mp4k9tq.jpg" 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%2Fvgg6dxv1wal27mp4k9tq.jpg" alt="key pair &amp;amp; instance type"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;choose the VPC and subnet (subnet I choose is private). I disabled the auto assign public IP options as I don't need it. Select the security group and make sure the appropriate port is enabled in the inbound rules (22 for linux and port 3389 for windows). If you limited the source connection to your IP, you need to use an endpoint with option "Preserve Client IP" enabled.&lt;br&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%2Ffc4nb4brxy8tyibg9lnz.jpg" 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%2Ffc4nb4brxy8tyibg9lnz.jpg" alt="vpc,subnet &amp;amp; sg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My EC2 instance is now created, in a private subnet with no public IP and no key pair, still I can connect to it using the ec2 instance connect endpoint.&lt;/p&gt;

&lt;p&gt;In EC2 service page select your instance and click connect&lt;br&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%2Frazk3k146hfvg7tm7m29.jpg" 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%2Frazk3k146hfvg7tm7m29.jpg" alt="select instance"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;select EC2 Instance Connect, Connect using EC2 Instance Connect Endpoint, choose the end point you created then click connect.&lt;br&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%2Fh1bgv3st3znqu2s2ln9z.jpg" 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%2Fh1bgv3st3znqu2s2ln9z.jpg" alt="EC2 Instance Connect"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you are now connected to the EC2 instance&lt;br&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%2Fk59vajpquvh9n4ej0jqf.jpg" 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%2Fk59vajpquvh9n4ej0jqf.jpg" alt="connected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To connect using CLI, you have to install AWS CLI first (check this &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html" rel="noopener noreferrer"&gt;link&lt;/a&gt; ) , create an access key (check this &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" rel="noopener noreferrer"&gt;link&lt;/a&gt; ) and configure CLI using " aws configure "command.&lt;br&gt;
Afer that use the following command to connect to your EC2 instance&lt;br&gt;
" aws ec2-instance-connect ssh --instance-id i-1234567890example --connection-type eice "&lt;br&gt;
replace i-1234567890example with your EC2 instance id&lt;br&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%2Fgi27xiz1ag7wsja0wx46.jpg" 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%2Fgi27xiz1ag7wsja0wx46.jpg" alt="CLI connect"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you face the following error:&lt;br&gt;
aws: error: argument operation: Invalid choice, valid choices are:&lt;br&gt;
send-ssh-public-key | send-serial-console-ssh-public-key help &lt;br&gt;
please update you AWS CLI and the problem will be solved.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>ec2</category>
    </item>
    <item>
      <title>Enable S3 MFA delete using AWS CLI - A SIMPLE GUIDE</title>
      <dc:creator>mostafamedhat1983</dc:creator>
      <pubDate>Tue, 26 Sep 2023 23:48:29 +0000</pubDate>
      <link>https://dev.to/mostafamedhat1983/enable-s3-mfa-delete-using-aws-cli-a-simple-guide-4267</link>
      <guid>https://dev.to/mostafamedhat1983/enable-s3-mfa-delete-using-aws-cli-a-simple-guide-4267</guid>
      <description>&lt;p&gt;&lt;strong&gt;S3 MFA delete adds another layer of security as you can't delete files unless you have the MFA device authentication code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;first you need to register MFA device with your account, check the following link to do so:&lt;br&gt;
&lt;a href="https://dev.tourl"&gt;https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_enable_virtual.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In your S3 bucket properties, bucket versioning click edit&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x2ulDZHn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nceaof6s4z1t5k459xfn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x2ulDZHn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nceaof6s4z1t5k459xfn.jpg" alt="bucket properties" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9VfDpOlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1z9bcio2y9wx62p5xkh7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9VfDpOlK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1z9bcio2y9wx62p5xkh7.jpg" alt="bucket versioning" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note that you cant enable MFA delete, it can only be enabled using AWS CLI, AWS SDk or S3 REST API.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q6AXlABG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klb91o2p4colspfhtsj5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q6AXlABG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klb91o2p4colspfhtsj5.jpg" alt="cant enable MFA delete" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;if you need to install AWS CLI check the following link :&lt;br&gt;
&lt;a href="https://dev.tourl"&gt;https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;to use AWS CLI you need to create an access key, click on your account name in the top right and then security credentials&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aXAFxNzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fcs1on09geghdp9ob48g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aXAFxNzx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fcs1on09geghdp9ob48g.jpg" alt="account security credentials" width="800" height="253"&gt;&lt;/a&gt;*copy the MFA device identifier as we will use it later.&lt;/p&gt;

&lt;p&gt;in Access Keys click Create access key.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ApgBdy6Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nigdwkkk5oitm0dtpr2o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ApgBdy6Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nigdwkkk5oitm0dtpr2o.jpg" alt="Create access key" width="800" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;mark " I understand that creating a root access key is not a best practice " and click Create access key&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ze0hLH-K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k72bsx78jwrakg2kn8y5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ze0hLH-K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k72bsx78jwrakg2kn8y5.jpg" alt="Create access key 2" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;download the csv file that contains the access key and secret access key, if you don't you will have to create another access key as you can't retrieve the secret access key later. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iTI8GJqM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg80nobe5l62qkfblpbq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iTI8GJqM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg80nobe5l62qkfblpbq.jpg" alt="download the csv file" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;open the cli and configure AWS cli using the "aws configure" command. Enter the access key, secret access key, default region and default output format.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lfbV4t-a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb6isk6nllz2571b001g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lfbV4t-a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb6isk6nllz2571b001g.jpg" alt="aws configure" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;check if AWS cli is working, use command "aws s3 ls" to show your S3 buckets.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P2FP_0be--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeiomxf4m7mg3gobtnbj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P2FP_0be--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeiomxf4m7mg3gobtnbj.jpg" alt="aws s3 ls" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;enable MFA delete using the following command:&lt;br&gt;
aws s3api put-bucket-versioning --bucket &lt;u&gt;bucket-name&lt;/u&gt; --versioning-configuration Status=Enabled,MFADelete=Enabled --mfa "&lt;u&gt;MFA-device-identifier&lt;/u&gt; &lt;u&gt;mfa-code&lt;/u&gt;".&lt;br&gt;
Replace the underlined text with its appropriate value.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WLYSCG4F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6r72dnlof58r8144icf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WLYSCG4F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6r72dnlof58r8144icf.jpg" alt="MFA command" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;check your S3 bucket properties to confirm MFA delete is enabled.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iFPbzoTb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ahlhxu0h6qg90hjeq705.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iFPbzoTb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ahlhxu0h6qg90hjeq705.jpg" alt="MFA delete is enabled" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you delete an object without showing versions a delete marker will be added to this object, but it will not be permanently deleted. you have to show versions and choose the version you want to delete.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TrW_Twm2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qq3kt6keh0f2yn9jbn27.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TrW_Twm2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qq3kt6keh0f2yn9jbn27.jpg" alt="delete marker" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try to permanently delete an object version, you will get an error.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yn6IKms---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf1u4wjwrbscut4329o1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yn6IKms---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf1u4wjwrbscut4329o1.jpg" alt="error" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trying from cli have the same result&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QheWJrcE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho1t8p4ff61wc2ha6eva.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QheWJrcE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho1t8p4ff61wc2ha6eva.jpg" alt="cli delete error" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To delete a file you need to add the MFA device ID and code, if you delete an object with a delete marker it will be shown in the result.&lt;/p&gt;

&lt;p&gt;Deleting object with delete marker.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B6Y8nUbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19imn2svimp21rdx6ogi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B6Y8nUbw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19imn2svimp21rdx6ogi.jpg" alt="Deleting object with delete marker" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deleting object with no delete marker.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UYieFO4W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itz7urckbp9d2ro7hgm4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UYieFO4W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itz7urckbp9d2ro7hgm4.jpg" alt="Deleting object with no delete marker" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To disable MFA delete use the same command as enabling it and replace " MFADelete=Enabled " with " MFADelete=Disabled " .&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;After disabling MFA delete don't forget to delete your access key.&lt;/em&gt;&lt;br&gt;
you have to deactivate the access key first then delete it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Dj8o39e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bocm2kimcwhfcamp4rn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Dj8o39e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bocm2kimcwhfcamp4rn.jpg" alt="delete the access key" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T8pH0Krc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzy605oiwafjawukmhsd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T8pH0Krc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzy605oiwafjawukmhsd.jpg" alt="deactivate the access key " width="800" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rPi1mCsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8za0f031xubkehor2j43.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rPi1mCsK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8za0f031xubkehor2j43.jpg" alt="delete the access key 2" width="800" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IFAo0lP6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyhvl6k1khieu93dhogx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IFAo0lP6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyhvl6k1khieu93dhogx.jpg" alt="confirm" width="554" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RhufmWwC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcfnlmqjfjdwa94selum.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RhufmWwC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcfnlmqjfjdwa94selum.jpg" alt="access key deleted" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Migration Strategies - 7Rs</title>
      <dc:creator>mostafamedhat1983</dc:creator>
      <pubDate>Wed, 30 Aug 2023 19:16:54 +0000</pubDate>
      <link>https://dev.to/mostafamedhat1983/migration-strategies-7rs-3p77</link>
      <guid>https://dev.to/mostafamedhat1983/migration-strategies-7rs-3p77</guid>
      <description>&lt;p&gt;&lt;strong&gt;1-Retire&lt;/strong&gt; — Get rid of&lt;br&gt;
Remove the applications that are no longer needed, or causing security risk because it is not supported any more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2-Retain&lt;/strong&gt; — “revisit” or do nothing&lt;br&gt;
keep the applications that are not ready to migrate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3-Rehost&lt;/strong&gt; — lift-and-shift&lt;br&gt;
move the applications to cloud without making any changes to them. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4-Relocate&lt;/strong&gt; — hypervisor-level lift and shift&lt;br&gt;
Move infrastructure to the cloud without purchasing new hardware, rewriting applications, or modifying. This migration scenario is specific to VMware Cloud on AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5-Repurchase&lt;/strong&gt; — drop and shop&lt;br&gt;
commonly a move to a SaaS platform. Moving a CRM to Salesforce.com, an HR system to Workday, a CMS to Drupal, and so on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6-Replatform&lt;/strong&gt; — lift and reshape&lt;br&gt;
move the application to the cloud and take advantage of the cloud optimization and capabilities. For example, replatform a Microsoft SQL Server database to Amazon RDS for SQL Server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7-Refactor/re-architect&lt;/strong&gt; &lt;br&gt;
Re-imagine how the application is architected and developed using cloud-native features. Example: Migrate on-premises Oracle database to the Amazon Aurora PostgreSQL-Compatible Edition.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>HOW TO ATTACH AND USE EBS VOLUME ON EC2 LINUX INSTANCE- A SIMPLE GUIDE</title>
      <dc:creator>mostafamedhat1983</dc:creator>
      <pubDate>Thu, 17 Aug 2023 18:28:43 +0000</pubDate>
      <link>https://dev.to/mostafamedhat1983/how-to-attach-and-use-ebs-volume-on-ec2-linux-instance-a-simple-guide-4gn7</link>
      <guid>https://dev.to/mostafamedhat1983/how-to-attach-and-use-ebs-volume-on-ec2-linux-instance-a-simple-guide-4gn7</guid>
      <description>&lt;p&gt;To create new EBS volume navigate to EC2, Elastic Block Store, Volumes then click Create volume.&lt;/p&gt;

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

&lt;p&gt;-choose the desired volume type and size, &lt;strong&gt;make sure the EBS volume is in the same AZ as the EC2 instance it will be attached to&lt;/strong&gt;. Then click Create.&lt;/p&gt;

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

&lt;p&gt;-choose the EBS volume you created, Actions then Attach volume&lt;/p&gt;

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

&lt;p&gt;-select the EC2 instance you want to attach the EBS volume to it. EBS volume name will be /dev/sdf or /dev/xvdf by default&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M9vOb_K_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/363l87wsj141pl3eiu96.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M9vOb_K_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/363l87wsj141pl3eiu96.jpg" alt="Image description" width="788" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-EBS volume is successfully attached&lt;/p&gt;

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

&lt;p&gt;-connect to your EC2 instance (to use EC2 instance connect you must allow SSH in the inbound rules of attached security group).&lt;/p&gt;

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

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

&lt;p&gt;sudo lsblk&lt;br&gt;
view your available disk devices and their mount points.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--diF0c0uR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miu9z5yzhy24pexa7abe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--diF0c0uR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miu9z5yzhy24pexa7abe.jpg" alt="Image description" width="397" height="146"&gt;&lt;/a&gt;&lt;br&gt;
the EBS volume we attached is xvdf (1G) and it has no mount point.&lt;/p&gt;

&lt;p&gt;sudo lsblk -f &lt;br&gt;
get information about all of the devices attached to the instance.&lt;/p&gt;

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

&lt;p&gt;sudo file -s /dev/xvdf&lt;br&gt;
show file system for disk xvdf&lt;/p&gt;

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

&lt;p&gt;sudo mkfs -t xfs /dev/xvdf&lt;br&gt;
create a file system xfs on the volume xdvf&lt;br&gt;
&lt;strong&gt;If you get an error that mkfs.xfs is not found, use the following command to install the XFS tools and then repeat the previous command: sudo yum install xfsprogs&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;sudo mkdir /ebs&lt;br&gt;
create directory ebs, we will use this directory to mount our EBS volume&lt;br&gt;
sudo mount /dev/xvdf /ebs&lt;br&gt;
mount the volume at the directory you created&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iE2Dqg8s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13qvihy44x16xdogy30r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iE2Dqg8s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13qvihy44x16xdogy30r.jpg" alt="Image description" width="472" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**To mount an attached EBS volume on every system reboot, add an entry for the device to the /etc/fstab file.&lt;/p&gt;

&lt;p&gt;You can use the device name, such as /dev/xvdf, in /etc/fstab, but it is recommended to use the device's 128-bit universally unique identifier (UUID) instead. Device names can change, but the UUID persists throughout the life of the partition.**&lt;/p&gt;

&lt;p&gt;sudo cp /etc/fstab /etc/fstab.orig&lt;br&gt;
Create a backup of your /etc/fstab to restore it in case of any problems&lt;/p&gt;

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

&lt;p&gt;sudo blkid&lt;br&gt;
find the UUID of the device&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4QNKg1hG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gvpphjrnma7mv8jgzk2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4QNKg1hG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gvpphjrnma7mv8jgzk2.jpg" alt="Image description" width="800" height="58"&gt;&lt;/a&gt;&lt;br&gt;
EBS volume UUID is 0bce0506-dd1d-4ee7-9aef-642eac6501bb&lt;/p&gt;

&lt;p&gt;sudo vim /etc/fstab&lt;br&gt;
edit the fstab file&lt;br&gt;
press i to enter insert mode&lt;br&gt;
Add the following entry to /etc/fstab&lt;br&gt;
UUID=0bce0506-dd1d-4ee7-9aef-642eac6501bb  /ebs  xfs  defaults,nofail  0  2&lt;br&gt;
0 to prevent the file system from being dumped, and we specify 2 to indicate that it is a non-root device.&lt;/p&gt;

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

&lt;p&gt;esc&lt;br&gt;
:wq&lt;br&gt;
w stands for write (save) and q stands for quit.&lt;/p&gt;

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

&lt;p&gt;to check unmout the device then mount all  file systems in /etc/fstab&lt;br&gt;
sudo umount /ebs&lt;br&gt;
sudo mount -a&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5m69B4LU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bvl4xl4dvenf93oe8xn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5m69B4LU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bvl4xl4dvenf93oe8xn.jpg" alt="Image description" width="413" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Errors in the /etc/fstab file can render a system unbootable. Do not shut down a system that has errors in the /etc/fstab file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;restore fstab backup in case of error&lt;br&gt;
sudo mv /etc/fstab.orig /etc/fstab&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>beginners</category>
    </item>
    <item>
      <title>CONNECT TO EC2 USING SESSION MANAGER- A SIMPLE GUIDE</title>
      <dc:creator>mostafamedhat1983</dc:creator>
      <pubDate>Wed, 16 Aug 2023 22:26:55 +0000</pubDate>
      <link>https://dev.to/mostafamedhat1983/connect-to-ec2-using-session-manager-273i</link>
      <guid>https://dev.to/mostafamedhat1983/connect-to-ec2-using-session-manager-273i</guid>
      <description>&lt;p&gt;To be able to connect to ec2 instance using session manager, SSM agent must be installed on this instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  some AMIs come with SSM agent already preinstalled:
&lt;/h2&gt;

&lt;p&gt;Amazon Linux Base AMIs dated 2017.09 and later&lt;br&gt;
Amazon Linux 2&lt;br&gt;
Amazon Linux 2 ECS-Optimized Base AMIs&lt;br&gt;
Amazon Linux 2023 (AL2023)&lt;br&gt;
Amazon EKS-Optimized Amazon Linux AMIs&lt;br&gt;
macOS 10.14.x (Mojave), 10.15.x (Catalina), and 11.x (Big Sur)&lt;br&gt;
SUSE Linux Enterprise Server (SLES) 12 and 15&lt;br&gt;
Ubuntu Server 16.04, 18.04, 20.04, and 22.04&lt;br&gt;
Windows Server 2008-2012 R2 AMIs published in November 2016 or later&lt;br&gt;
Windows Server 2016, 2019, and 2022&lt;/p&gt;

&lt;h2&gt;
  
  
  you can also check these guides to install SSM agent on your instance:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For macOS
&lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install-macos2.html"&gt;https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install-macos2.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-For win server:&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html"&gt;https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-win.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-For Linux :&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html"&gt;https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;u&gt;-first you need to create a role to enable ec2 to use AWS Systems Manager service core functionality.&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;-Navigate to IAM, Roles then create role&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dhhrFrUN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4w3bz7m47k6d33o9uv2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dhhrFrUN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4w3bz7m47k6d33o9uv2.jpg" alt="create role step 1" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-select EC2 then Next&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gQbRxDL0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yseswbnz1dx1ohmostwe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gQbRxDL0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yseswbnz1dx1ohmostwe.jpg" alt="create role step 2" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-search for AmazonSSMManagedInstanceCore policy ancd check it then Next&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1mfrCAxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ju2inggfv72o60hmvtw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1mfrCAxm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ju2inggfv72o60hmvtw.jpg" alt="create role step 3" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;enter the role name then Next&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U0TBV0Im--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwdr4ruhr37r9w77x24y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U0TBV0Im--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwdr4ruhr37r9w77x24y.jpg" alt="create role step 4.1" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6s_IMV0C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5awjr2rrzjpoqko7x6b3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6s_IMV0C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5awjr2rrzjpoqko7x6b3.jpg" alt="create role step 4.2" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;role is now created&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9Fem7I4O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u22cb13l96vyixfg31ax.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9Fem7I4O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u22cb13l96vyixfg31ax.jpg" alt="role created" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-when launching EC2 instance at the end of the page click Advanced details&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qUlK2U1F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7nf5a3tm0d647ce0chg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qUlK2U1F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7nf5a3tm0d647ce0chg.jpg" alt="EC2 launch 1" width="800" height="799"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-in advanced details select IAM instance profile and choose the role you created&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nqeNC8zn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyv7x3uh356u2gv8sfzb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nqeNC8zn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyv7x3uh356u2gv8sfzb.jpg" alt="EC2 launch 2" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-Navigate to EC2 ,instances. then check your EC2 instance and click connect&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8_3UW7iW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqtii7rmldk5xb1tr68j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8_3UW7iW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqtii7rmldk5xb1tr68j.jpg" alt="connect 1" width="800" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-choose Session Manager then Connect&lt;/p&gt;

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

&lt;p&gt;-you are now connected to your EC2 instance using session manager&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;if the EC2 instance was already created you have to modify its IAM role&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-Navigate to EC2, Instances and click on your EC2 intance , Actions , Security then Modify IAm role&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--30dw6PH7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sbyl35egifxt24esvm1c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--30dw6PH7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sbyl35egifxt24esvm1c.jpg" alt="EC2 already created 1" width="800" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-after that choose the role you created and click Update IAM role&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bdzo_SN3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prb9ggr21u6htz3gb4hn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bdzo_SN3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prb9ggr21u6htz3gb4hn.jpg" alt="EC2 already created 2" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;connecting to EC2 using session manager is more secure than using SSH as session manager doesnt need an open port to connect&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>beginners</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
