<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Irlancdossantos on Medium]]></title>
        <description><![CDATA[Stories by Irlancdossantos on Medium]]></description>
        <link>https://medium.com/@irlancdossantos?source=rss-1a943531d337------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nqNBzkAAK8PST8TcmPohaQ.jpeg</url>
            <title>Stories by Irlancdossantos on Medium</title>
            <link>https://medium.com/@irlancdossantos?source=rss-1a943531d337------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:18:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@irlancdossantos/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hands-on Guide: Working with EC2 Snapshots, Images, and AWS Data Lifecycle Manager]]></title>
            <link>https://medium.com/@irlancdossantos/hands-on-guide-working-with-ec2-snapshots-images-and-aws-data-lifecycle-manager-4073ed68041e?source=rss-1a943531d337------2</link>
            <guid isPermaLink="false">https://medium.com/p/4073ed68041e</guid>
            <category><![CDATA[lifecycle-management]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[snapshot]]></category>
            <dc:creator><![CDATA[Irlancdossantos]]></dc:creator>
            <pubDate>Fri, 08 Nov 2024 13:31:14 GMT</pubDate>
            <atom:updated>2024-11-08T13:34:13.913Z</atom:updated>
            <content:encoded><![CDATA[<p>As a fundamental part of AWS, understanding how to work with EC2 snapshots, create images, and utilize AWS Data Lifecycle Manager (DLM) is essential for any AWS Cloud Engineer. This guide will walk you through these processes with hands-on steps, enabling you to manage backups and automate lifecycle policies effectively.</p><h3>Learning Outcomes</h3><p>By the end of this tutorial, you will be able to:</p><ul><li>Take snapshots of EC2 instances via the AWS console.</li><li>Create Amazon Machine Images (AMIs) from EC2 instances and snapshots.</li><li>Understand the differences between snapshots and images.</li><li>Use the AWS Data Lifecycle Manager to manage backup schedules.</li><li>Copy and share AMIs across accounts and regions.</li></ul><h3>Outline</h3><ol><li>Creating an Image from an EC2 Snapshot and Launching a New Instance</li><li>Creating an Image and Launching an Instance from the Same Image</li><li>Creating an Image from the Root Volume Snapshot</li><li>Making an AMI Public</li><li>Automating Backups with Data Lifecycle Manager</li></ol><h3>Part 1: Creating an Image from an EC2 Snapshot and Launching a New Instance</h3><p>Open your AWS Console Manager and search fot EC2</p><p>1. Launch an EC2 Instance with the following configurations:</p><ul><li>Name and tag: SampleInstance (Required for Data Lifecycle Manager)</li><li>Security Group: Allow SSH and HTTP from anywhere.</li><li>User Data: Use the script below to install Nginx, remove default index and download a custom index from the github repo. Make nginx perssistent enable(service).</li></ul><pre>#! /bin/bash<br>yum update -y<br>yum install nginx -y<br>systemctl start nginx<br>cd /usr/share/nginx/html<br>chmod -R 777 /usr/share/nginx/html<br>rm index.html<br>wget https://raw.githubusercontent.com/awsdevopsteam/route-53/master/index.html<br>wget https://raw.githubusercontent.com/awsdevopsteam/route-53/master/ken.jpg<br>systemctl restart nginx<br>systemctl enable nginx</pre><h3>Create a Snapshot of the instance:</h3><p>On the left side menu, at EC2 dasboard, Go to Elastic Block Storage / Snapshots, and click <strong>Create Snapshot</strong>. Select <strong>Resource Type:</strong> Instance and choose the Nginx instance. Description:<strong>Instance-Snapshot_First</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*4Ul_VVczTTOu12ssbvVPXg.png" /></figure><h3>Create an Image from the Snapshot:</h3><p>Select SampleInstance, clicking on the checkbox, and From the snapshot’s <strong>Action</strong> menu, select <strong>Create Image</strong>. Name the image ICDSAMI_1. Launch a new instance using this AMI and verify the Nginx server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*_L_ccGqtG14MpqPWylkaWQ.png" /></figure><ul><li>On the left side menu, Instances/instances, Click lauch instances. On Amazon Machine Images(AMI), browse more AMIs. My AMIs, you will see your AMI, ICDSAMI_1. Just select and follow the launch instance process.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*DvgFa4UjU5RmEv2J56Aebw.png" /></figure><h3>Part 2: Creating an Image and Launching an Instance from the Same Image</h3><p>Select the checkbox on SampleInstance and create a new image:</p><ul><li>Click <strong>Actions → Create Image from snapshot</strong>.</li><li>Name it <strong>ICDSAMI_2</strong>.</li><li>Launch an Instance from <strong>ICDSAMI_2</strong> and verify that Nginx is working.</li></ul><h3>Part 3: Creating an Image from the Root Volume Snapshot and Launching a New Instance</h3><p>Create a Snapshot of the root volume:</p><ul><li>Go to Snapshots and select <strong>Create Snapshot</strong>.</li><li>Choose the root volume of SampleInstance and name it <strong>Snapshot_Third</strong>.</li></ul><p>Create and Launch an Image:</p><ul><li>Create an image from this snapshot, naming it <strong>ICDSAMI_3</strong>.</li><li>Launch an instance using <strong>ICDSAMI_3</strong> and verify.</li></ul><h3>Part 4: Making an AMI Public</h3><p>Make ICDSAMI_1 Public:</p><p>On EC2 Dashboard, scrow the left menu all way down and click “Settings.” On Data Protection and security, look for “Block public access for AMIs”, click “Manage” uncheck Block new public sharing and click Update.</p><ul><li>Go to Images / AMI and select <strong>ICDSAMI_1</strong>.</li><li>Click on Actions / Edit AMI permissions and choose AMI availability / <strong>Public</strong>.</li><li>Share the AMI ID for public access testing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*F3Krwdk9C-eOw-bJhvUVug.png" /></figure><h3>Part 5: Automating Backups with Data Lifecycle Manager (DLM)</h3><p>Create a Snapshot Lifecycle Policy:</p><ul><li>In EC2 Console, go to <strong>Elastic Block Store/Lifecycle Manager</strong> and select <strong>Create Snapshot Lifecycle Policy / Custom policy</strong>.</li><li><strong>Policy Type:</strong> EBS snapshot policy, next.</li><li><strong>Target Resource Tag:</strong> Instance.</li><li><strong>Target Resource Tag: </strong>Key: Name, Value: SampleInstance, click Add.</li><li><strong>Description:</strong> SampleInstance Snapshot lifecycle Policy</li><li><strong>IAM Role:</strong> Use Default Role if unsure, next.</li></ul><p>Define Schedule:</p><ul><li><strong>Schedule Name:</strong> My_schedule.</li><li><strong>Frequency:</strong> Daily, every 24 hours, starting at 03:00 UTC.</li><li><strong>Retention Retention:</strong> Coun, Keep 5 snapshots.</li></ul><p>With this hands-on guide, you should now be confident in managing EC2 snapshots, creating and sharing AMIs, and automating your backup policies with DLM. This foundational knowledge is essential for efficient resource management and data protection in AWS. Happy Cloud Engineering!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4073ed68041e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting a Static Website on AWS S3 with Version Control Using AWS CLI]]></title>
            <link>https://medium.com/@irlancdossantos/hosting-a-static-website-on-aws-s3-with-version-control-using-aws-cli-2cdb332052b4?source=rss-1a943531d337------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cdb332052b4</guid>
            <category><![CDATA[aws-s3]]></category>
            <dc:creator><![CDATA[Irlancdossantos]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 18:42:37 GMT</pubDate>
            <atom:updated>2024-11-06T19:22:51.030Z</atom:updated>
            <content:encoded><![CDATA[<p>Hosting a Static Website on AWS S3 with Version Control Using AWS CLI</p><h3>Introduction</h3><p>As cloud technology advances, building and managing scalable infrastructure with robust data governance becomes essential. Amazon S3, part of AWS’s highly reliable and scalable suite of storage services, offers a powerful way to host static websites and manage content through version control. This article walks you through setting up a static website on AWS S3, enabling version control, and securing data access — all using the AWS Command Line Interface (CLI).</p><h3>Project Goals</h3><p>This tutorial is designed for cloud engineers who want hands-on experience with S3 for static website hosting and object versioning. By the end, you’ll be able to:</p><ul><li>Create and configure S3 buckets for hosting</li><li>Implement a static website on S3</li><li>Set and manage bucket policies for access control</li><li>Enable versioning to retain historical versions of content</li><li>Use logging for enhanced data insights</li></ul><p>Each step builds foundational AWS skills that support your journey toward mastering cloud storage and data governance.</p><h3>Project Breakdown</h3><ul><li><strong>Phase 1:</strong> Setting up Basic S3 Operations</li><li><strong>Phase 2:</strong> Configuring Static Website Hosting</li><li><strong>Phase 3:</strong> Enabling Version Control</li></ul><h3>Phase 1: Setting Up an S3 Bucket in AWS CloudShell</h3><p>First, open <strong>AWS CloudShell</strong> in the AWS Console. This environment provides an AWS Linux terminal where you can execute commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m8BFkbNwGt3hXY9i" /></figure><p>It will setup a AWS-Linux which you can execute this commands bellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZshVRRqovxmdZdOl" /></figure><h3>Step 1: Create the S3 Bucket</h3><pre>aws s3api create-bucket - bucket pet.YOURNAME.static.web.hosting - region us-east-1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m4qcvcN8DEqJc_Tj" /></figure><h3>Step 2: Disable ACLs (Recommended)</h3><p>Copy this 2 lines and paste on the cloudshell:</p><pre>aws s3api put-bucket-ownership-controls - bucket pet.YOURNAME.static.web.hosting - ownership-controls &#39;Rules=[{ObjectOwnership=BucketOwnerEnforced}]&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2CgZqaA0YwlWt7YN" /></figure><h3>and Block All Public Access</h3><pre>aws s3api put-public-access-block - bucket pet.YOURNAME.static.web.hosting - public-access-block-configuration blockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mQtI6wb2TrgEuoUs" /></figure><h3>Step 3: Enable Versioning</h3><pre>aws s3api put-bucket-versioning - bucket pet.YOURNAME.static.web.hosting - versioning-configuration Status=Enabled</pre><h3>Step 4: Enable Static Website Hosting</h3><pre>aws s3 website s3://pet.YOURNAME.static.web.hosting/ - index-document index.html</pre><h3>Step 5: Adjust Public Access Settings and Set the Bucket Policy</h3><pre>aws s3api put-public-access-block - bucket pet.YOURNAME.static.web.hosting - public-access-block-configuration BlockPublicAcls=false,IgnorePublicAcls=false,BlockPublicPolicy=false,RestrictPublicBuckets=false</pre><h3>Step 6: Apply a Bucket Policy for Public Read Access</h3><p>Create a file named aws-s3-static-website-policy.json with the following json content, making sure to replace bucket-name with pet.YOURNAME.static.web.hosting:</p><pre>{<br>&quot;Version&quot;: &quot;2012–10–17&quot;,<br>&quot;Statement&quot;: [<br>{<br>&quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>&quot;Effect&quot;: &quot;Allow&quot;,<br>&quot;Principal&quot;: &quot;*&quot;,<br>&quot;Action&quot;: &quot;s3:GetObject&quot;,<br>&quot;Resource&quot;: &quot;arn:aws:s3:::pet.YOURNAME.static.web.hosting/*&quot;<br>}<br>]<br>}</pre><p>Now, apply this policy to the bucket:</p><pre>aws s3api put-bucket-policy - bucket pet.YOURNAME.static.web.hosting - policy file://aws-s3-static-website-policy.json</pre><p><strong>Upload Files to CloudShell</strong>:</p><ul><li>Within CloudShell, click on the <strong>Actions</strong> menu, then <strong>Upload file</strong>.</li><li>Select your index.html and any other files (e.g., cat.jpg) you want to upload, and upload them to CloudShell. The files will be placed in the home directory (/home/cloudshell-user/).</li></ul><p><strong>Upload Files to the S3 Bucket Using AWS CLI</strong>:</p><ul><li>Now, use the following AWS CLI command in CloudShell to upload each file to your S3 bucket:</li></ul><pre>aws s3 cp /home/cloudshell-user/index.html s3://pet.YOURNAME.static.web.hosting/</pre><pre>aws s3 cp /home/cloudshell-user/cat.jpg s3://pet.YOURNAME.static.web.hosting/</pre><h3>Enabling Version Control on S3 Bucket using AWS CLI</h3><p>This document provides step-by-step instructions to enable version control (versioning) on an Amazon S3 bucket using the AWS CLI. By enabling versioning, you can retain multiple versions of each object, which can be useful for data recovery and tracking changes over time.</p><h3>Step 1: Enable Versioning</h3><p>Run the following AWS CLI command to enable versioning on your bucket:</p><pre>aws s3api put-bucket-versioning -pet.YOURNAME.static.web.hosting -versioning-configuration Status=Enabled</pre><p>This command configures the bucket to retain multiple versions of each object, allowing you to view, restore, or delete specific versions as needed.</p><h3>Step 2: Verify Versioning</h3><p>To check that versioning is enabled, use this command:</p><pre>aws s3api get-bucket-versioning -pet.YOURNAME.static.web.hosting <br></pre><p>You should see output indicating `”Status”: “Enabled”` if versioning was successfully activated.</p><h3>Step 3: Testing Version Control</h3><p>After versioning is enabled, every time you upload a file with the same name, S3 will retain previous versions rather than overwrite them. For</p><p>example:</p><p>— **Upload a new version of a file**:</p><pre>aws s3 cp /home/cloudshell-user/index.html s3://pet.YOURNAME.static.web.hosting/</pre><p>— **View Object Versions**:</p><p>To see all versions of files in the bucket, run:</p><pre>aws s3api list-object-versions - bucket pet.YOURNAME.static.web.hosting</pre><h3>Step 4: Restore or Delete Specific Versions (Optional)</h3><p>If you want to restore or delete a specific version, locate the `VersionId` of the object from the output of the `list-object-versions` command. Then, use commands like the following to manage versions:</p><p>— **Delete a specific version**:</p><pre>aws s3api delete-object - bucket pet.YOURNAME.static.web.hosting - key index.html - version-id [VersionId]</pre><p>— **Download a specific version**:</p><pre>aws s3api get-object - bucket pet.YOURNAME.static.web.hosting - key index.html - version-id [VersionId] /home/cloudshell-user/index_versioned.html</pre><p><strong>Conclusion</strong></p><p>Congratulations! You’ve successfully set up a static website on AWS S3 with version control. By completing this project, you’ve covered essential skills for managing storage and data integrity in the cloud. This setup ensures that your website remains resilient, allowing you to recover previous versions and keep your content accessible and secure.</p><p>For those looking to expand, consider exploring advanced configurations like setting up CloudFront for content delivery, logging, or using Amazon Route 53 for custom domain hosting. With these steps, you’re well on your way to becoming proficient in AWS S3 for web hosting and beyond.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cdb332052b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>