<?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 Asma Akram on Medium]]></title>
        <description><![CDATA[Stories by Asma Akram on Medium]]></description>
        <link>https://medium.com/@akram.asma?source=rss-df6526d4372b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hzRF0AOUQaZMIAk8nKkzMQ.png</url>
            <title>Stories by Asma Akram on Medium</title>
            <link>https://medium.com/@akram.asma?source=rss-df6526d4372b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:19:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akram.asma/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[Power of Amazon Q CLI- Easy way to create Tic Tac Toe Game]]></title>
            <link>https://medium.com/@akram.asma/power-of-amazon-q-cli-easy-way-to-create-tic-tac-toe-game-2adb0254f139?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2adb0254f139</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[amazon-q-cli]]></category>
            <category><![CDATA[amazon-q]]></category>
            <category><![CDATA[gen-ai-tools]]></category>
            <category><![CDATA[gen-ai-revolution]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 15:34:28 GMT</pubDate>
            <atom:updated>2025-06-10T15:34:28.927Z</atom:updated>
            <content:encoded><![CDATA[<h3>Power of Amazon Q CLI- Easy way to create Tic Tac Toe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvJ5ZpTNvoydXOh0ZVcaqQ.png" /></figure><p>Amazon Q CLI is emerging as a game-changer in today’s emerging landscape. With its AI-powered command line interface, developers can now build applications faster and more intuitively than ever before. Amazon Q CLI simplifies the process of creating functional, interactive apps with minimal effort.</p><h3>Amazon Q:</h3><p>Amazon Q is a powerful generative AI assistant designed to revolutionize workplace productivity. Whether you’re a software developer, business analyst, contact center agent, or supply chain specialist, Amazon Q provides tailored support to help you work smarter. Built with advanced agentic capabilities, it empowers users to quickly access insights, automate complex tasks, and accelerate decision-making. By integrating seamlessly with AWS and enterprise data, Amazon Q helps organizations streamline operations and boost overall efficiency.</p><h3>Amazon Q Products:</h3><h3>1. Amazon Q Business</h3><p>Amazon Q Business makes generative AI securely accessible to everyone in your organization. Leveraging your own company’s content, data, and systems, Amazon Q Business makes it easier to get you fast, relevant answers to pressing questions, solve problems, generate content, and take actions on your behalf. Amazon Q Business easily and securely connects to commonly used systems and tools so it can synthesize everything and provide tailored assistance empowering your teams to be more data-driven, creative, and productive.</p><h3>2. Amazon Q Developer</h3><p>Amazon Q Developer is the most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI/ML. Amazon Q Developer goes beyond coding to help developers and IT professionals with all of their tasks — from coding, testing, and deploying, to troubleshooting, performing security scanning and fixes, modernizing applications, optimizing AWS resources, and creating data engineering pipelines. Data scientists can get guidance to quickly and easily build analytics, AI/ML, and generative AI applications.</p><h3><strong>Amazon Q for Command Line :</strong></h3><p>Amazon Q CLI is a developer focused tool that uses generative AI to help you build and manage applications directly from your command-line interface(CLI), powered by Amazon Q.</p><h3>What It Does:</h3><p>Amazon Q CLI helps you:</p><ul><li><strong>Generate Code</strong>: Create project templates, files, and functions automatically using natural language.</li><li><strong>Understand Code</strong>: Ask questions about your codebase and get intelligent answers.</li><li><strong>Fix Bugs</strong>: Identify and suggest fixes for errors in your code.</li><li><strong>Build Faster</strong>: Scaffold full apps (like a game or microservice) in seconds using simple prompts.</li></ul><p>In this post, I’ll walk through how you can use Amazon Q CLI to build a classic game of Tic Tac Toe — right from your terminal, with just a few prompts.</p><p>I am building this project as a part of Initative by AWS Community. Refer to the link below to get started just like me.</p><p><a href="https://community.aws/content/2xIoduO0xhkhUApQpVUIqBFGmAc/build-games-with-amazon-q-cli-and-score-a-t-shirt">Build Games with Amazon Q CLI and score a T shirt 🏆👕</a></p><h4>Installing Amazon Q CLI on Windows machine:</h4><p>I have followed the guide laid down by <br>Ricardo Sueiras to install Q CLI on Windows machine.</p><p><a href="https://community.aws/content/2v5PptEEYT2y0lRmZbFQtECA66M/the-essential-guide-to-installing-amazon-q-developer-cli-on-windows?trk=e07eca93-fa2f-4351-b567-f293b83eb635&amp;sc_channel=el_">The essential guide to installing Amazon Q Developer CLI on Windows</a></p><p>Step 1: Install WSL : In order to use Amazon Q CLI on windows machine, we need to install <strong>Windows Subsystem for Linux</strong>, or <strong>wsl </strong>for short.<br>Follow the below link to install wsl on windows machine</p><p><a href="https://learn.microsoft.com/en-us/windows/wsl/install">Install WSL</a></p><p>Open PowerShell (or Windows Command Prompt) and enter:</p><pre>wsl --install</pre><p>The — install command performs the following actions:</p><ul><li>Enables the optional WSL and Virtual Machine Platform components</li><li>Downloads and installs the latest Linux kernel</li><li>Sets WSL 2 as the default</li><li>Downloads and installs the Ubuntu Linux distribution (reboot may be required)</li></ul><p>Step 2: Once the process of installing your Linux distribution with WSL is complete, open the distribution (Ubuntu by default) using the Start menu. You will be asked to create a User Name and Password for your Linux distribution.</p><p>Step 3: Update and upgrade the packages.</p><pre>sudo apt update &amp;&amp; sudo apt upgrade</pre><p>Step 4: In order to install Amazon Q CLI we need to run the below command.</p><pre>wsl -d Ubuntu</pre><p>It is used to <strong>launch a specific Linux distribution (Ubuntu)</strong> using <strong>WSL (Windows Subsystem for Linux)</strong> on Windows.</p><p>Step 5: Run the below command</p><pre>sudo apt install unzip</pre><p>You will be asked to enter the password for the Ubuntu user you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*ALGTNK6gzE7VOzEGpC49-Q.png" /></figure><p>Now we have to download the zip file that contains the installer. From the wsl command line, we use the following command:</p><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-x86_64-linux-musl.zip -o q.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*ql_Ee02bwV7eUHjPQCggWw.png" /></figure><p>This should download the installer into your current directory, which should be the home directory.</p><p>Step 6: Now we will unzip this by using the following command:</p><p>unzip q.zip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*5KrNKvYbSmYyZozsEJOgvQ.png" /></figure><p>This creates a subdirectory named q containing all the necessary files. Before running the installer, we need to enable it by executing the following commands.</p><pre>cd q<br>chmod +x install.sh</pre><p>The chmod command in Linux is used to change file permissions. In this case, we’re making install.sh executable so we can run the installer. To do this, use the following command</p><pre>./install.sh</pre><p>During installation, you’ll be prompted to allow modifications to your shell configuration. Choose “Yes”, as this step adds a path to the Amazon Q Developer CLI executables.</p><p>Once the installation is complete, you’ll need to activate the updated shell environment. You can either restart your WSL session or simply type:</p><pre>bash</pre><p>Amazon Q Developer is now installed on our machine, Now login with builder id.</p><p><a href="https://community.aws/content/2v5PptEEYT2y0lRmZbFQtECA66M/the-essential-guide-to-installing-amazon-q-developer-cli-on-windows?trk=e07eca93-fa2f-4351-b567-f293b83eb635&amp;sc_channel=el_#logging-into-amazon-q-developer-using-a-builder-id">The essential guide to installing Amazon Q Developer CLI on Windows</a></p><p>From the command enter the following command:</p><pre>q login</pre><p>You will then see 2 options for Login, choose the option “Use for Free with Builder ID”</p><p>Once you select this option, you’ll be prompted to open a URL in your web browser. Simply copy the URL, paste it into your browser, and proceed to either <strong>sign in with an existing Builder ID</strong> or <strong>create a new one</strong> if you don’t already have an account.</p><p>After completing the login process, you’ll be signed in to Amazon Q Developer and can start using it from your WSL environment by running:</p><pre>q chat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grFDUrraVKPsDVoDdZeuGw.png" /></figure><h3>Game Building</h3><p>Step 1. Once the Amazon Q is up and running, I gave the below prompt in order to generate a Tic Tac Toe game.</p><pre>Create a simple console-based game of Tic Tac Toe in Python with pygame. <br>The game should allow two players to play by taking turns, display the <br>board after each move, check for a win or a draw, and <br>handle invalid inputs gracefully. Keep the code modular and easy to understand.<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hMirtZV6wuRYm1OS2qwL9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*m62LUJ-eBzXozrFlPGUkQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fV_gpK2USL7FRGBgFW1uUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QA6pI1qX9z2A_vZEaOe54g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obNdK4TPGZcA8mHYOmng0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-tO3kI3vrwFGuevjQI2XQ.png" /></figure><p>Step 2: The game ran correctly but the text was overlapping, so I used the below prompt to add more features.</p><pre>Add the following Features in the game.<br>- Two-player gameplay<br>- Visual board display with X&#39;s and O&#39;s<br>- Win detection (rows, columns, and diagonals)<br>- Draw detection<br>- Game restart functionality<br>- Player turn indication<br><br>Add a timer to the board to show the time remaining to make the move. <br>Make the game more interactive. Also add the difficulty levels and add the <br>the feature to play with computer.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*wv3oIUzuGo65mLZe3GLU6g.png" /></figure><p>The game ran correctly and it is more interesting now.</p><p>Step 3. I now asked Amazon Q to add a README.md file and it created it in few seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JSdrryvKfwp19okrKdKZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7iotjn0ipDCF_9986JTiNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvQ_GopYv7o9hedDtK3p5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hJDjW4g8m7hE4okfqc0Ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*oo3tQ-exunfAJClHaAp65A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKlua-EWOsY_KwPU4OZhlA.png" /></figure><p>Step 4. I asked Amazon Q to initialize a Git repo and give me the commands to push my code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0IkzOZ2xHkQ3UCaNW1t9Kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SR2V2-DvGTxzjgykgrSTHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlZ-HZBoNcux0oZ7DTnNcg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsihYTbDsRzeEXowr9j7CQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QF9_XOBCg45Ck11NDGtmqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdIboFUyM4-YuxdjnCNvgQ.png" /></figure><p>Step 5. I have added all the files and commit the code in GitHub with the help of below commands</p><pre>git remote set-url origin https:://Asma09Akram:YourToken@github.com/Asma09Akram/colorful-tic-tac-toe<br>git add .<br>git commit -m &quot;Updates&quot;<br>git push -u origin main </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pYjKKog2J5GMTVbnyLy_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*UM75go8N8gwrxpRr6gC2AQ.png" /></figure><p>So I have successfully build the Tic Tac Toe game with the below features<br>Score Tracking System: Keeps track of X wins, O wins, and draws across multiple games</p><ul><li>Turn Timer: Players have 10 seconds to make a move before their turn is skipped</li><li>Game Modes:</li><li>Player vs Player (PVP): Play against a friend on the same computer</li><li>Player vs Computer (PVC): Challenge the AI opponent</li><li>AI Difficulty Levels:</li><li>Easy: Makes random moves</li><li>Medium: Tries to win or block opponent’s winning moves</li><li>Hard: Uses strategic play (prioritizes center, corners, and edges)</li><li>Interactive Mode Toggle: Switch between PVP and PVC with a simple click</li><li>Difficulty Toggle: Cycle through AI difficulty levels with a click</li><li>Draw Detection: Game correctly identifies draws when all 9 squares are filled with no winner</li></ul><h3>My Learnings with Amazon Q CLI</h3><h4>1. Rapid Prototyping with Natural Language</h4><p>Amazon Q CLI lets you <strong>build games quickly using simple prompts</strong> in plain English. You don’t need to write every line of code — just describe what you want, and it scaffolds the structure for you. This speeds up early-stage prototyping.</p><h4>2. Modular and Clean Code Suggestions</h4><p>The generated code is often <strong>modular, well-documented, and follows good coding practices</strong> (e.g., using functions, clear variable names). It’s a great way to learn or reinforce clean coding standards while building something fun.</p><h4>3. Iterative Development is Easy</h4><p>You can <strong>refine and expand your game incrementally</strong> by continuing the conversation. For example, you can say:</p><blockquote><em>“Now add a score tracker”<br> “Turn this into a GUI using tkinter”<br> “Add sound effects”</em></blockquote><p>This makes iteration much smoother than starting from scratch every time.</p><h4>4. Boosts Learning Through Reverse Engineering</h4><p>By studying the generated code, you can <strong>learn game logic, Python structures, and design patterns</strong>. It becomes a learning assistant — especially useful for beginners or those new to game development.</p><h3>Try It Yourself:</h3><p>You can build your own game in few minutes with the help of Amazon Q CLI. Do try.</p><h3>My GitHub Repo Link:</h3><p><a href="https://github.com/Asma09Akram/colorful-tic-tac-toe">GitHub - Asma09Akram/colorful-tic-tac-toe: A visually appealing Tic Tac Toe game built with Pygame</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2adb0254f139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resizing of EBS Volumes]]></title>
            <link>https://medium.com/@akram.asma/resizing-of-ebs-volumes-d4e716d3569c?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4e716d3569c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws-ebs]]></category>
            <category><![CDATA[ebs-volume]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 14:28:55 GMT</pubDate>
            <atom:updated>2024-10-17T14:28:55.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAEuWUxwUXY7jxMwssiMwg.jpeg" /></figure><h3>What is Amazon Elastic Block Store?</h3><p>Amazon Elastic Block Store (Amazon EBS) provides scalable, high-performance block storage resources that can be used with Amazon Elastic Compute Cloud (Amazon EC2) instances. With Amazon Elastic Block Store, you can create and manage the following block storage resources:</p><ul><li><strong>Amazon EBS volumes</strong> — These are storage volumes that you attach to Amazon EC2 instances. After you attach a volume to an instance, you can use it in the same way you would use a local hard drive attached to a computer, for example to store files or to install applications.</li><li><strong>Amazon EBS snapshots</strong> — These are point-in-time backups of Amazon EBS volumes that persist independently from the volume itself. You can create snapshots to back up the data on your Amazon EBS volumes. You can then restore new volumes from those snapshots at any time.</li></ul><p>With Elastic Volumes, you can dynamically increase the size, increase or decrease the performance, and change the volume type of your Amazon EBS volumes without detaching them.</p><p>Use the following process when modifying a volume:</p><ol><li>(Optional) Before modifying a volume that contains valuable data, it is a best practice to create a snapshot of the volume in case you need to roll back your changes. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-creating-snapshot.html">Create Amazon EBS snapshots</a>.</li><li>Request the volume modification.</li><li>Monitor the progress of the volume modification. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html">Monitor the progress of Amazon EBS volume modifications</a>.</li><li>If the size of the volume was modified, extend the volume’s file system to take advantage of the increased storage capacity. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html">Extend the file system after resizing an Amazon EBS volume</a>.</li></ol><h3>Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*nr1cJnbGQia0G6pICr30iQ.png" /></figure><h3>Task Details</h3><ol><li>Sign into the AWS Management Console.</li><li>Launching Amazon EC2 instance</li><li>Resizing the EBS volume</li></ol><h4>Task 1. Sign into the AWS Management Console.</h4><h4>Task 2. Launch an EC2 instance</h4><p>2.1. Amazon Linux 2 AMI</p><p>2.2. Instance type <em>t2.micro</em></p><p>2.3 .Create a key pair</p><p>2.4. Create new security group with<strong> SSH </strong>port open from anywhere.</p><p>2.5. Click on Create instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48njSwFZBGDtW750j8wZGg.png" /></figure><h4>Task 3: Resizing the EBS Volumes</h4><p>3.1 In the EC2 dashboard, select EC2 instance for Volume resize lab and navigate to the Storage tab and then click on Volume ID present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ibecAlCKU9SM4ziMOBMNTA.png" /></figure><p>3.2 Select the Volume and then go to the <strong>Actions </strong>menu dropdown. Click on Modify Volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1Z1i9gCJC4HkjCH5_bZkQ.png" /></figure><p>3.3 Provide the new Volume Size you need to increase to, and also note that we are not able to decrease the volume size. In our case, I’m modifying from 8GiB to 20GiB and then clicking on Modify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*7Sg1uUL2t4B3LxPHuzQ-GA.png" /></figure><p>3.4 Now, after modifying the volume, we need to increase the partition and file system. To do so, we need to SSH into the server with the key we downloaded while launching the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*OcnoCNdK0RijRJgKAKohUg.png" /></figure><p>3.5 To SSH into EC2 Instance. Click on Instance and then connect</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TxYt-KRDvtv-vQ9qq8EcOg.png" /></figure><p>3.6 After connecting, run the following commands</p><pre>sudo su<br>df -h</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*-lSaDSKzH2_UxhlB4tnb0A.png" /></figure><p>The above command will list the amount of free disk space available in the server. You can also see that the drive volume which we have increased will not be added to it.</p><p>3.7 Now run the following command to see the list of all the block devices that are associated with the instance (which will show the increased size of the partition volume):</p><pre>lsblk</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*3sGm-kL08f0mUUcJIF7zMw.png" /></figure><p>The root volume has a partition /dev/xvda1 whereas the root volume (/dev/xvda) reflects the new size. This tells us the partition size needs to be extended.</p><p>3.8 Extend the size by using the following command:</p><pre>growpart /dev/xvda 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sM3PK4fpYb2Nh0a1QkHqoA.png" /></figure><p>3.9 Find the file system of the block devices associated with the EC2 instance by entering the following command:</p><pre>lsblk -f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CotPzvA026isaQd5eQ1Lsw.png" /></figure><p>The above command will provide us the file system of the block devices which will be one among the following types: ext2,ext3,ext4 or XFS</p><p>3.10 Our file system type is ext4, so for this file system, use the below command (also for ext2,ext4):</p><p>Note: If the file system is XFS then run the below command</p><pre>xfs_growfs /dev/xvda1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*9y6uayMNn49BGFdrggNDMw.png" /></figure><p>3.11 Now find the effective file system extended volume size,</p><pre>df -h</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*5GZqsGmJlH9p4t2_5Ms8Uw.png" /></figure><p>You have successfully launched an EC2 instance and re-sized the root EBS volume of the instance with zero downtime.</p><p>Similarly, we can resize the secondary volume associated with the instance in the same way.</p><p><em>In conclusion, resizing EBS volumes — whether it’s the root volume or secondary attached volumes — provides unmatched flexibility and scalability without disrupting your EC2 instance operations. By following a few simple steps, you can modify storage to suit your growing application needs while ensuring cost-efficiency and maintaining optimal performance. Whether your focus is on expanding storage or upgrading performance, EBS resizing allows seamless adjustment to match your evolving infrastructure requirements.</em></p><p><em>If you found this post helpful, please like, share, and follow for more tips on managing AWS resources and optimizing cloud performance!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4e716d3569c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering Mindfulness: Affirmations App Meets Amazon Bedrock]]></title>
            <link>https://medium.com/@akram.asma/empowering-mindfulness-affirmations-app-meets-amazon-bedrock-f1ddd6a78428?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1ddd6a78428</guid>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 17:24:03 GMT</pubDate>
            <atom:updated>2024-07-04T18:20:23.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qsfTyM7GVFQZhPhghGyPQ.png" /><figcaption>DALL·E 3</figcaption></figure><h3>🌐 What is Amazon Bedrock?</h3><p>Amazon Bedrock is a fully managed service offering top foundation models (FMs) for building generative AI applications. It simplifies development with security, privacy, and responsible AI. You can customize models with your data, create agents for tasks like booking travel or managing inventory, and integrate AI capabilities without writing any code. Being serverless, there’s no infrastructure to manage, and it seamlessly works with AWS services you’re familiar with.</p><h4>Which FMs are available on Amazon Bedrock?</h4><p>Amazon Bedrock customers can choose from some of the most cutting-edge FMs available today. This includes Anthropic’s Claude, AI21 Labs’ Jurassic-2, Stability AI’s Stable Diffusion, Cohere’s Command and Embed, Meta’s Llama 2, and the Amazon Titan language and embeddings models.</p><h4>What are the most common use cases for Amazon Bedrock?</h4><p>You can quickly get started with use cases:</p><ul><li>Create new pieces of original content, such as short stories, essays, social media posts, and web page copy.</li><li>Search, find, and synthesize information to answer questions from a large corpus of data.</li><li>Create realistic and artistic images of various subjects, environments, and scenes from language prompts.</li><li>Help customers find what they’re looking for with more relevant and contextual product recommendations than word matching.</li><li>Get a summary of textual content such as articles, blog posts, books, and documents to get the gist without having to read the full content.</li></ul><p>Explore more <a href="https://aws.amazon.com/ai/generative-ai/use-cases/">generative AI use cases</a>.</p><h4><strong>Pre-requisites</strong></h4><p>In summary, you will need:</p><ol><li>An <a href="https://aws.amazon.com/free">AWS account</a> and (so you can access your credentials).</li><li>The Amazon Bedrock models that you want to use enabled in your account. The code uses <strong>Claude 3 Sonnet</strong>, but these are examples, you can use other foundational models too.</li><li>In the below video I have show how can we get access to Claude 3 model.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdxHKY4lpHsE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdxHKY4lpHsE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdxHKY4lpHsE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/45fc1a0518329f8c30161858c898541f/href">https://medium.com/media/45fc1a0518329f8c30161858c898541f/href</a></iframe><p>4. Amazon Bedrock Runtime client from the AWS SDK for JavaScript v3.</p><p>5. The latest stable version of <a href="https://nodejs.org/">Node.js</a> and npm installed.</p><ul><li>Inorder to install node-js and npm follow the below document to install</li><li><a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm">https://docs.npmjs.com/downloading-and-installing-node-js-and-npm</a></li><li>Install nodist on your windows machine</li><li><a href="https://github.com/nodists/nodist/releases">https://github.com/nodists/nodist/releases</a></li><li>Add the path of node.exe to your machine’s environment variable “C:\Program Files\nodejs\node.exe”</li></ul><h3>Task 1. Create a web application called as “My Affirmations” by running the following command</h3><p><strong>⚛ </strong>Open VS Code in your local machine and create a folder. Open that folder in VS Code and open the new terminal and run the below command.</p><pre> npm create vite@latest my-affirmations-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*mBbq7IPoXh_BCCbJzp7XFA.png" /></figure><p><strong>⚛ </strong>Select the “Vanilla” framework and Select the variant as “JavaScript”</p><ul><li>Now run the below commands</li></ul><pre>cd my-affirmations-app<br>npm install<br>npm run dev</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*cUH-HP9E8YePFnTCfvOZgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*Ae0PFkPaTr__En4MN7D_bA.png" /></figure><p><strong>⚛ </strong>Change the index.html with the below code, save and close the file.</p><pre>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>  &lt;title&gt;My Affirmations&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>  &lt;main&gt;<br>    &lt;h1&gt;&lt;span&gt;My Affirmations&lt;/span&gt;&lt;/h1&gt;<br>    &lt;section class=&quot;text&quot;&gt;<br>      &lt;h3 id=&quot;affirmation&quot;&gt;Loading...&lt;/h3&gt;<br>    &lt;/section&gt;<br>    &lt;button id=&quot;getNewAffirmation&quot; disabled&gt;Another Please&lt;/button&gt;<br>  &lt;/main&gt;<br>  &lt;script type=&quot;module&quot; src=&quot;/main.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br><br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*9E4ubC7P9fVKz5u1_px5ng.png" /></figure><p><strong>✔️ </strong>This HTML code creates a webpage titled “My Affirmations” with a heading and a section for displaying affirmations. Initially, the affirmation section shows “Loading…”. There’s a disabled button labeled “Another Please” which suggests interactivity that’s controlled by a JavaScript file (main.js) linked with type=&quot;module&quot;. The webpage structure is basic, focusing on displaying affirmations dynamically fetched and updated via JavaScript.</p><p><strong>⚛ </strong>Change the main.js with the below code and save the file</p><pre>import &#39;./style.css&#39;<br><br>// An array of affirmations<br>const affirmations = [ &quot;You are capable of amazing things!&quot;,<br>  &quot;Believe in yourself and all that you are.&quot;,<br>  &quot;You are stronger than you think.&quot;,<br>  &quot;Every day is a fresh start.&quot;,<br>  &quot;You are worthy of all the good things that happen to you.&quot;];<br><br>async function fetchNewAffirmation() {<br>  disableButton(true);<br>  showLoadingAnimation();<br><br>  // choose a random affirmation from the array<br>  const affirmation = affirmations[Math.floor(Math.random() * affirmations.length)];<br><br>  // set the affirmation<br>  document.querySelector(&quot;#affirmation&quot;).innerHTML = affirmation;<br>  disableButton(false);<br>}<br><br>// Shows a loading animation while fetching a new affirmation<br>function showLoadingAnimation() {<br>  document.querySelector(&quot;#affirmation&quot;).innerHTML = &#39;&lt;div class=&quot;loading-spinner&quot;&gt;&lt;/div&gt;&#39;;<br>}<br><br>// Disables the button while fetching a new affirmation so we don&#39;t request several at once by clicking repeatedly<br>function disableButton(isDisabled) {<br>  const affirmationButton = document.querySelector(&quot;#getNewAffirmation&quot;);<br>  affirmationButton.disabled = isDisabled;<br>}<br><br>// Called on page load (or refresh), fetches a new affirmation<br>async function init() {<br>  await fetchNewAffirmation();<br>  <br>  const affirmationButton = document.querySelector(&quot;#getNewAffirmation&quot;);<br>  affirmationButton.addEventListener(&quot;click&quot;, fetchNewAffirmation);<br>}<br><br>init();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*z7zNxm_OS97Efh3Fj6TB_w.png" /></figure><p><strong>✔️ </strong>This JavaScript code initializes a webpage that displays affirmations randomly chosen from an array. It imports styles from a style.css file. The affirmations array holds motivational phrases. The fetchNewAffirmation function selects a random affirmation, updates the HTML to display it, and manages button state to prevent multiple clicks. The showLoadingAnimation function temporarily replaces the affirmation with a loading spinner. On page load, init calls fetchNewAffirmation to display an initial affirmation and sets up an event listener on a button (#getNewAffirmation) to fetch new affirmations when clicked.</p><p><strong>⚛ </strong>Change the style.css</p><pre>html {<br>  font-family: system-ui;<br>  background: #1c8ec867;<br>}<br><br>main {<br>  margin: auto;<br>  padding: 1.5rem;<br>  max-width: 80ch;<br>  display: flex;<br>  flex-direction: column;<br>  align-items: center;<br>  text-align: center;<br>}<br><br>h1 {<br>  color: rgb(72, 167, 148);<br>  font-size: 2rem;<br>  font-weight: 800;<br>  margin: 0;<br>}<br><br>.text {<br>  line-height: 1.8;<br>  margin: 1rem 0;<br>  border: 1px solid rgba(#0c318f, 25%);<br>  background-color: rgb(249, 248, 247);<br>  padding: 1rem;<br>  border-radius: 3rem;<br>  text-align: center;<br>  font-size: 1.5rem;<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>  width: 80%; /* Set a fixed width */<br>  height: auto; /* Allow the height to grow */<br>}<br><br>button {<br>  background-color: rgb(38, 18, 103);<br>  font-size: 1.75rem;<br>  font-weight: 600;<br>  line-height: 1.6;<br>  color: white;<br>  border: none;<br>  padding: 0.5rem 1rem;<br>  border-radius: 0.25rem;<br>  cursor: pointer;<br>}<br><br>button:disabled {<br>  opacity: 0.5;<br>  cursor: not-allowed;<br>}<br><br>.loading-spinner {<br>  margin-top: 1rem;<br>  border: 8px solid #2f239a;<br>  border-top-color: #3fbcde;<br>  border-radius: 50%;<br>  width: 60px;<br>  height: 60px;<br>  animation: spin 1s ease-in-out infinite;<br>}<br><br>@keyframes spin {<br>  0% { transform: rotate(0deg); }<br>  100% { transform: rotate(360deg); }  <br>}</pre><p><strong>✔️ </strong>This CSS code styles an HTML page for displaying affirmations:</p><ul><li>html: Sets the font family to system-ui and the background color to a light green shade.</li><li>main: Centers content with auto margins, sets maximum width, and styles it as a centered column layout with aligned text.</li><li>h1: Styles the main heading with specific color, size, and weight.</li><li>.text: Styles a container for affirmations with specific padding, background, border, and text alignment, and a centered layout using flexbox.</li><li>button: Defines the appearance of buttons with specific background, text color, padding, border radius, and cursor behavior. Disabled buttons are styled with reduced opacity and a different cursor.</li></ul><p>Additionally, there’s a loading spinner animation (loading-spinner) defined with specific dimensions, border styling, and a CSS animation (spin) for rotation, providing visual feedback during affirmation loading.</p><p><strong>⚛ </strong>Now run the below command again.</p><pre>npm run dev </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*o9UB1_nJ3ULoOMEIFRUJXA.png" /></figure><p><a href="http://localhost:5173/">http://localhost:5173/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvNs3F5QzuNhLvdTgvWlTA.png" /></figure><h3>Task 2. <strong>Adding Amazon Bedrock Claude 3 Sonnet in the Affirmation App</strong></h3><p>Now we will connect our affirmations app to Amazon Bedrock</p><p><strong>⚛</strong> Install AWS SDK Bedrock Runtime</p><pre>npm install @aws-sdk/client-bedrock-runtime</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*JnyeGqOuEl3aKG2OCMi4Fw.png" /></figure><p><strong>⚛ Configure AWS Credentials</strong></p><p>To ensure you have your AWS access key and secret access keys, follow this guide <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-configure.html">Configure the AWS CLI</a>.</p><blockquote>Note that Vite will not read shell variables directly unless each one is prefixed with VITE_ (so VITE_AWS_ACCESS_KEY_ID instead of AWS_ACCESS_KEY_ID)</blockquote><p>You can use a .env.local file to store them and expose them to Vite if pasting them into the shell and remembering to prefix them with VITE_ gets annoying. Detailed steps for creating the .env.local file can be found at the start of <a href="https://catalog.us-east-1.prod.workshops.aws/workshops/ed533291-e036-4086-8bb6-23b135f71e5d/en-US/8-workflow-3">workflow 3</a>.</p><p>Ensure you have completed this before proceeding, as Amazon Bedrock will only respond to accounts that have the correct credentials and permissions.</p><p>In <strong>Visual Studio Code Server</strong>, open the <strong>.env.local </strong>file. This file stores your environment variables so you can access Amazon Bedrock securely.</p><pre>VITE_AWS_ACCESS_KEY_ID=<br>VITE_AWS_SECRET_ACCESS_KEY=<br></pre><p><strong>Note: I have hardcoded the values directly into my </strong><strong>main.js file in the next step</strong></p><p><strong>⚛ Adding Claude 3 Sonnet API Calls</strong></p><p>* Get the access tokens from your account. You need to pass the token in main.js as shown below</p><p>* check the model ID from this <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">page</a> and update the model ID.</p><p><strong>⚛ </strong>The only file we need to edit this time is main.js. Replace the entire content with the below code</p><pre>import &#39;./style.css&#39;<br>import { BedrockRuntimeClient, ConverseCommand } from &quot;@aws-sdk/client-bedrock-runtime&quot;;<br><br>const modelId = &#39;anthropic.claude-3-sonnet-20240229-v1:0&#39;;<br>const prompt = &quot;Give a affirmation mantra personalized to career , positivity, health. Make sure the affirmation is achievable and positive, and no longer than 50 words. Include references of plants, animals, or flowers by adding emoji. Don&#39;t show the prompt, only the quote. Do not add anything like Here is an affirmation... just return the affirmation alone&quot;;const conversation = [<br>  {<br>    role: &quot;user&quot;,<br>    content: [{ text: prompt }],<br>  },<br>];<br><br>async function fetchNewAffirmation() {<br>  disableButton(true);<br>  showLoadingAnimation();<br><br>  try {<br>    const response = await client.send(new ConverseCommand({ modelId, messages: conversation }));<br>    const affirmation = response.output.message.content[0].text;<br>    // set the affirmation in HTML<br>    document.querySelector(&quot;#affirmation&quot;).innerHTML = affirmation;<br>  } catch (err) {<br>    console.error(err);<br>    document.querySelector(&quot;#affirmation&quot;).innerHTML = err;<br>  }<br><br>  disableButton(false);<br>}<br><br>// Shows a loading animation while fetching a new affirmation<br>function showLoadingAnimation() {<br>  document.querySelector(&quot;#affirmation&quot;).innerHTML = &#39;&lt;div class=&quot;loading-spinner&quot;&gt;&lt;/div&gt;&#39;;<br>}<br><br>// Disables the button while fetching a new affirmation so we don&#39;t request several at once by clicking repeatedly<br>function disableButton(isDisabled) {<br>  const affirmationButton = document.querySelector(&quot;#getNewAffirmation&quot;);<br>  affirmationButton.disabled = isDisabled;<br>}<br><br>init();<br><br>// Called on page load (or refresh), fetches a new affirmation<br>async function init() {<br>  try {<br>    // get the user&#39;s credentials from environment variables<br>    const creds = await fetchCredentials();<br>    // instantiate the BedrockRuntimeClient  <br>    client = await createBedrockClient(creds);<br>    // Once everything is setup, let&#39;s get the first affirmation<br>    await fetchNewAffirmation();<br><br>  } catch(err) {<br>    console.error(err);<br>    document.querySelector(&quot;#affirmation&quot;).innerHTML = err;<br>  }<br>  <br>  const affirmationButton = document.querySelector(&quot;#getNewAffirmation&quot;);<br>  affirmationButton.addEventListener(&quot;click&quot;, fetchNewAffirmation);<br>}<br><br>let client = null;<br>async function createBedrockClient(creds) {  <br>  client = await new BedrockRuntimeClient({<br>    credentials: creds.credentials,<br>    region: creds.region<br>  });<br>  return client;<br>}<br><br>async function fetchCredentials() {<br>  // This is necessary as we are using Vite which resticts access to environment variables unless they are prefixed with VITE_<br>  // You can set these in your shell or in a .env.local file<br>  return {<br>    region: &quot;us-east-1&quot;,  // this must match the region you enabled the model on. In my case it&#39;s us-west-2. It may not be in your case.<br>    credentials: {<br>      //accessKeyId: import.meta.env.VITE_AWS_ACCESS_KEY_ID,<br>      //secretAccessKey: import.meta.env.VITE_AWS_SECRET_ACCESS_KEY,<br>      //sessionToken: import.meta.env.VITE_AWS_SESSION_TOKEN,<br><br>// I hardcoded these, not a right approach<br>      accessKeyId: &quot;&quot;, secretAccessKey: &quot;&quot;<br>    },<br>  };<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*l3-o_dIbtPEUXdikUv_vcA.png" /></figure><h3>Task 3: Run our new code and check that new affirmations are being generated.</h3><p><strong>⚛ </strong>When you run the app with npm run dev, new affirmations should appear on load and each time you request another one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F3GFI1xPVgKTWlgfkuse7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBnjnEy9r_nKViu60dVdAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Avcg7OgddvRmt9oVD5rWHQ.png" /></figure><p>Yes, it worked! 🎉 We’re now getting new affirmations both on load and whenever we request another. 😊</p><h3>Task 4: Cancel the Claude 3 Sonnet subscription:</h3><p>🏷️ To avoid charges, cancel your subscription to the model via the AWS Marketplace.</p><ul><li>Go to Marketplace you will subscription of Claude 3 Sonnet</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*FUcwSGTPiHf3ScaQkFNHgw.png" /></figure><ul><li>Open the subscription</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yH2Pn1cDyInlzh-8LtNRUQ.png" /></figure><ul><li>Click on Cancel Subscription under Actions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_VSGJ1v4uad_U_BhVHLlaQ.png" /></figure><h4>In the blog, we explored how to seamlessly integrate a web app with Amazon Bedrock using API calls, enabling access to advanced LLM models.</h4><h4>Resources used for the tutorial:</h4><p>⚛ Link to challenge: <a href="https://catalog.us-east-1.prod.workshops.aws/workshops/ed533291-e036-4086-8bb6-23b135f71e5d/en-US">https://catalog.us-east-1.prod.workshops.aws/workshops/ed533291-e036-4086-8bb6-23b135f71e5d/en-US</a></p><p>⚛ For better understanding, you can watch the recorded session on YouTube: <a href="https://www.youtube.com/watch?v=DjhcU4uZ2VQ">https://www.youtube.com/watch?v=DjhcU4uZ2VQ</a></p><h3>Thank you!</h3><p><em>Appreciate your time reading! If you found value in this article, a round of applause (👏) would be fantastic to help others discover it. Feel free to share your insights and comments below, I’m eager to hear your thoughts!</em></p><p>#aws #foundationmodels #bedrock #webapp #machinelearning #serverless #affirmations #bootcamp #awsugdehradun #awsugpune #awsmachinelearning #claude #sonnet</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1ddd6a78428" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Insights: Exploring the Intersection of Technology and Human Intelligence]]></title>
            <link>https://medium.com/@akram.asma/ai-insights-exploring-the-intersection-of-technology-and-human-intelligence-3f14382035f8?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f14382035f8</guid>
            <category><![CDATA[aws-ai-services]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Sat, 29 Jun 2024 16:00:09 GMT</pubDate>
            <atom:updated>2024-06-29T16:00:09.106Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1WIE6-nGiYhJkbpvvWuI6Q.png" /></figure><h3>A brief overview of AI, ML , DL, Neural Networks, Gen AI &amp; GANs</h3><h4>Artificial Intelligence(AI):</h4><p>AI focuses on creating systems capable of performing tasks that typically require human intelligence. These tasks include reasoning, learning, problem-solving, perception, language understanding, and decision-making. AI aims to create machines that can mimic human cognitive functions and improve their performance through data and experience.</p><p><strong>Analogy:</strong></p><p>AI as a very smart student who learns from lots of examples, just like how a student learns from textbooks and practice. This student gets better with feedback and remembers important lessons. AI uses this knowledge to solve problems and help with tasks. Over time, the student (AI) keeps learning and improving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHyw0wkYkr9j-sk3ZBq6zw.png" /></figure><h4>Machine Learning:</h4><p>Machine learning (ML) is a specialized area within artificial intelligence (AI) dedicated to creating systems that improve their performance based on the data they process. While AI is a broad concept encompassing technologies that mimic human intelligence, machine learning is a specific subset of AI. Although the terms AI and machine learning are often used interchangeably, they are not the same: all machine learning falls under the umbrella of AI, but not all AI involves machine learning.</p><p><strong>Analogy:</strong></p><p>Machine learning is like a student learning to solve math problems. Initially, the student needs guidance and practice to understand the concepts. With continuous practice and correction of mistakes, the student gradually improves and becomes proficient at solving math problems independently. Similarly, a machine learning model learns from data and feedback to improve its performance over time.</p><h4>Deep Learning:</h4><p>Deep learning is the field of artificial intelligence (AI) that teaches computers to process data in a way inspired by the human brain. Deep learning models can recognize data patterns like complex pictures, text, and sounds to produce accurate insights and predictions.</p><h4>Neural Networks:</h4><p>Neural networks are like simplified models of how the human brain works. They consist of layers of interconnected nodes, or “neurons,” that work together to process information and make decisions. By learning from data, they can recognize patterns, make predictions, and solve complex problems, much like how our brains learn and adapt from experiences.</p><h4>Key differences: Deep learning vs. Neural networks</h4><p>The terms deep learning and neural networks are used interchangeably because all deep learning systems are made of neural networks. However, technical details vary. There are several different types of neural network technology, and all may not be used in deep learning systems.</p><p>For this comparison, the term neural network refers to a feedforward neural network. Feedforward neural networks process data in one direction, from the input node to the output node. Such networks are also called simple neural networks.</p><p><strong>Analogy:</strong></p><p>Deep learning and neural networks are like a large, intricate network of roads in a city. Each intersection represents a neuron, and each road is a connection between neurons. Just as traffic flows through various routes to reach a destination, information flows through multiple layers of neurons in a deep learning model. Over time, the network learns the most efficient routes to process and understand complex patterns in data, much like how a city’s traffic system adapts to optimize flow.</p><h4>Generative AI:</h4><p>Generative AI refers to artificial intelligence systems that create new content, such as images, text, music, or even code, by learning patterns from existing data. These models can produce original and realistic outputs that mimic the examples they were trained on. Examples include language models like GPT-4, which generate coherent text, and GANs (Generative Adversarial Networks), which create realistic images.</p><p><strong>Analogy:</strong></p><p>Generative models are like creative artists in the world of artificial intelligence. They learn from existing data, such as images, text, or music, and use that knowledge to generate new, original content that resembles the training data. These models can create anything from realistic-looking photos to believable human speech, making them powerful tools for innovation and creativity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*TsJ_xTR0fn8bnI6D8BXV-w.png" /></figure><h4>Popular Gen AI Tools:</h4><ul><li>ChatGPT: OpenAI’s Conversational AI</li><li>GPT: The Core Engine Behind OpenAI’s ChatGPT</li><li>AlphaCode: DeepMind’s AI-Powered Coding Engine</li><li>GitHub Copilot: AI Code Completion by GitHub and OpenAI</li><li>Bard: Google’s Conversational Generative AI Chatbot</li><li>Microsoft Copilot: Microsoft’s AI-Powered Assistant</li><li>DALL-E: OpenAI’s Image Generation Model</li><li>StyleGAN: NVIDIA’s High-Quality Synthetic Image Generator</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*ClkY_am1m8AXl-Ye1miOEA.png" /></figure><h4>Generative Adversarial Networks (GANs) :</h4><p>Generative Adversarial Networks (GANs) are a class of artificial intelligence models composed of two neural networks: a generator and a discriminator. The generator creates fake data that mimics real data, while the discriminator evaluates and distinguishes between real and fake data. The two networks are trained together in a competitive process, with the generator improving its outputs to fool the discriminator, leading to the creation of highly realistic data.</p><p><strong>Analogy:</strong></p><p>GANs are like a forger and an art critic. The forger (generator) creates fake paintings, trying to make them look like real masterpieces. The art critic (discriminator) examines the paintings and determines whether they are real or fake. Over time, the forger gets better at creating convincing fakes, while the critic improves at spotting them, pushing both to become increasingly skilled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJnL2_sYyVW606wRI4MNAQ.png" /></figure><h3>AWS AI Services:</h3><ul><li><strong>Amazon SageMaker</strong>: A comprehensive service that allows developers and data scientists to build, train, and deploy machine learning models quickly.</li><li><strong>Amazon Comprehend</strong>: A natural language processing (NLP) service that uses machine learning to uncover insights and relationships in text.</li><li><strong>Amazon Lex</strong>: A service for building conversational interfaces into any application using voice and text.</li><li><strong>Amazon Polly</strong>: A service that turns text into lifelike speech, allowing you to create applications that talk.</li><li><strong>Amazon Rekognition</strong>: A service that makes it easy to add image and video analysis to your applications.</li><li><strong>Amazon Translate</strong>: A neural machine translation service that delivers fast, high-quality, and affordable language translation.</li><li><strong>Amazon Transcribe</strong>: An automatic speech recognition (ASR) service that makes it easy to add speech-to-text capabilities to applications.</li><li><strong>AWS DeepLens</strong>: A deep learning-enabled video camera that allows you to run deep learning models locally on the device.</li><li><strong>Amazon Textract</strong>: A machine learning service that automatically extracts text, handwriting, and data from scanned documents.</li><li><strong>Amazon Personalize</strong>: A machine learning service that makes it easy for developers to create individualized recommendations for customers using their applications.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-2adACV_FlCRvH231QefA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJsLUErRDcsjsBRUTWV4ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIdzuYs0YWkXpQhmRHdZcg.png" /></figure><h3>Thank you!</h3><p><em>Appreciate your time reading! If you found value in this article, a round of applause (👏) would be fantastic to help others discover it. Feel free to share your insights and comments below, I’m eager to hear your thoughts!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f14382035f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coping Bucket Objects with the help of Lambda]]></title>
            <link>https://medium.com/@akram.asma/coping-bucket-objects-with-the-help-of-lambda-a1e9c80efc8b?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1e9c80efc8b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-certification]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws-s3-bucket]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Wed, 19 Jun 2024 09:29:49 GMT</pubDate>
            <atom:updated>2024-06-19T09:29:49.241Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6CJ-7dlEdM8ZYqZpRlhYQ.gif" /></figure><h3>Amazon S3</h3><p>Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance. Millions of customers of all sizes and industries store, manage, analyze, and protect any amount of data for virtually any use case, such as data lakes, cloud-native applications, and mobile apps. With cost-effective storage classes and easy-to-use management features, you can optimize costs, organize and analyze data, and configure fine-tuned access controls to meet specific business and compliance requirements.</p><h3>AWS Lambda</h3><p>✔ Run code without provisioning or managing servers, creating workload-aware cluster scaling logic, maintaining event integrations, or managing runtimes.</p><p>✔ Run code for virtually any type of application or backend service. Just upload your code as a ZIP file or container image, and Lambda automatically allocates compute execution power and runs your code based on the incoming request or event, for any scale of traffic.</p><p>✔ Write Lambda functions in your favorite language (Node.js, Python, Go, Java, and more) and use both serverless and container tools, such as AWS SAM or Docker CLI, to build, test, and deploy your functions.</p><p>In this tutorial we will be exploring the Services like Amazon S3, IAM and AWS Lamdba.</p><p>We will create 2 buckets in our account, one is the source bucket and another is destination bucket. We will then create a policy which allows permission to get objects from the S3 bucket “mysourcebucket” and put objects into the S3 bucket “mydestinationbucket”. Then we will create a new role and attach the policy which we created for S3 buckets and also AWSLambdaBasicExecutionRole policy. Next we will create a Lambda function and add the code to copy the code from source bucket to destination bucket. Here we will add S3 as trigger to our lambda function, s3 source bucket is selected for the trigger. Lastly we will upload the image files in source bucket and will verify if the Lambda function ran or not and check the destination bucket, if the newly uploaded files are present or not.</p><h4>Task 1. Sign in to the management console</h4><h4>Task 2. Create 2 buckets</h4><p>2. Search S3 bucket and click on Create Bucket</p><p>2.1. Create Source bucket, Give a unique name to the bucket “mysourcebucket222333”, Leave other settings as default and click on the Create bucket button</p><ul><li>After successful completion of bucket creation, Select your S3 bucket. Click on the Copy ARN button to copy the ARN.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S90yMw-AJ3hiGNcuVhp__A.png" /></figure><p><strong>Source Bucket —</strong>arn:aws:s3:::myawssourcebucket222333</p><p>2.2 Create Destination bucket.</p><ul><li>Leave other settings as default and click on the Create bucket button.</li><li>Once the bucket is created successfully, Select your S3 bucket.</li><li>Click on the Copy ARN button to copy the ARN.</li></ul><p><strong>Destination bucket — </strong>arn:aws:s3:::myawsdestinationbucket222333</p><h4>Task 3. Create an IAM Policy</h4><p>3.1 Go to Services and Search IAM</p><p>3.2 Click on Policies under left navigation panel, click on create policy, click on JSON.</p><pre>{<br>    &quot;Version&quot;:&quot;2012-10-17&quot;,<br>    &quot;Statement&quot;:[<br>       {<br>          &quot;Effect&quot;:&quot;Allow&quot;,<br>          &quot;Action&quot;:[<br>             &quot;s3:GetObject&quot;<br>          ],<br>          &quot;Resource&quot;:[<br>             &quot;arn:aws:s3:::mysourcebucket/*&quot;<br>          ]<br>       },<br>       {<br>          &quot;Effect&quot;:&quot;Allow&quot;,<br>          &quot;Action&quot;:[<br>             &quot;s3:PutObject&quot;<br>          ],<br>          &quot;Resource&quot;:[<br>             &quot;arn:aws:s3:::mydestinationbucket/*&quot;<br>          ]<br>       }<br>    ]<br> }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSnhKREZEUK-ZxYmtzjhrQ.png" /></figure><ul><li>Replace the Source and destination ARN name of the bucket (which you have saved before) in the option Resource. Make sure to add /* at the end of the ARN name.</li><li>Leave everything as default and click on Next button.</li><li>Give any name of your choice “mypolicy”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rsu0uSo30JcUmRTF_OXew.png" /></figure><h3>Task 4: Create an IAM Role</h3><ol><li>In the left menu, click on Roles. Click on the Create role button.</li><li>Select Lambda from AWS Services list.</li></ol><ul><li>From Trusted Entity Type: Select AWS Service</li><li>From Use case: Select Lambda</li><li>Click on Next button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0F2pR-yqVOt4mwEB7CXaw.png" /></figure><p>Filter Policies: Now you can see a list of policies. Here you have to select two policies: mypolicy and AWSLambdaBasicExecutionRole</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPRNyzbqnW4YCdzTaL2mFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pM2VpS9erJjsTT8OzRZqdA.png" /></figure><h3>Task 5: Create a Lambda Function</h3><p>In the search bar, type Lambda and click on Create function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*go0HHn4Is548Aj4cGapTzg.png" /></figure><ul><li>Select Run time as Node.js 16.x</li><li>Use an existing role.</li><li>Select the role which we have created in previous step</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*1xfuA-qf5joo2Xmb2Vsq7Q.png" /></figure><ul><li>Add the below code in place of the code given in the index.js function.</li><li>Add the correct source and destination bucket name in the code below</li></ul><pre>var AWS = require(&quot;aws-sdk&quot;);<br><br> exports.handler = async (event, context) =&gt; {<br>   var s3 = new AWS.S3();<br>   var sourceBucket = &quot;mysourcebucket12345&quot;;<br>   var destinationBucket = &quot;mydestinationbucket12345&quot;;<br>   var objectKey = event.Records[0].s3.object.key;<br>   var copySource = encodeURI(`${sourceBucket}/${objectKey}`);<br>   var copyParams = {<br>     Bucket: destinationBucket,<br>     CopySource: copySource,<br>     Key: objectKey<br>   };<br> <br>   try {<br>     var result = await s3.copyObject(copyParams).promise();<br>     console.log(&quot;S3 object copy successful.&quot;);<br>   } catch (err) {<br>     console.log(err, err.stack);<br>   }<br>};</pre><ul><li>Click on Deploy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gk6Ft4pdc0tAufnsv9acqQ.png" /></figure><h3>Task 6: Adding Triggers to Lambda Function</h3><ul><li>Click on Add triggers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5yAUuhilqGd609Rqv87VQ.png" /></figure><ul><li>Bucket: Select your source bucket — mysourcebucket12345</li><li>Event type: Select All object create events</li><li>Leave other fields as default.</li><li>And check this option of Recursive invocation to avoid failures in case you upload multiple files at once and Check the acknowledge option.</li><li>Click on Add button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PPHabmYN0sdNEf6PvCvVw.png" /></figure><ul><li>Tick the I acknowledge check box and click on Add</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*utDfNB5yRTWK0qSajdzQeQ.png" /></figure><h3>Task 7: Test Lambda function</h3><ol><li>Go to S3 Bucket list and click on source bucket — mysourcebucket222333.</li><li>Upload image to source S3 bucket.</li></ol><ul><li>Click on the Upload button.</li><li>Click on Add files button to add the files.</li><li>Select the image and click on the Upload to upload the image.</li></ul><p>3. Now go back to the S3 list and open your destination bucket — mydestinationbucket222333.</p><p>You can see a copy of your uploaded source bucket image in the destination bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*pnYhoTfwpIzTp8C_PNO6Sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*uo_lelHVxf9tzmqTM7pbhg.png" /></figure><h3>Completion and Conclusion</h3><ol><li>You created two S3 buckets acting as source and destination.</li><li>You created an IAM policy and role that will be used for the Lambda function.</li><li>You have successfully created an AWS Lambda function and configured an S3 trigger.</li><li>You have successfully triggered the Lambda function to copy an image from the source S3 bucket to the destination S3 bucket.</li></ol><h4>Remember to delete your resources (S3 buckets, Lambda Functions, IAM role and policy), so you don’t continue to get charged!</h4><h3>Thank you!</h3><p><em>Appreciate your time reading! If you found value in this article, a round of applause (👏) would be fantastic to help others discover it. Feel free to share your insights and comments below, I’m eager to hear your thoughts!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1e9c80efc8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Tier Web Application in AWS]]></title>
            <link>https://medium.com/@akram.asma/3-tier-web-application-in-aws-759d1882ed77?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/759d1882ed77</guid>
            <category><![CDATA[3-tier-architecture]]></category>
            <category><![CDATA[aws-asg]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[aws-rds]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Sat, 15 Jun 2024 06:25:16 GMT</pubDate>
            <atom:updated>2024-06-15T06:25:16.009Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*8iX4td9q70d_F4HMsG8orQ.png" /></figure><h4>What is 3 tier Architecture?</h4><p>Three tier architecture is a client server architecture pattern, that separates Application into 3 interconnected layers or tiers.</p><h4>Presentation or Web Tier:</h4><p>This is the topmost level of the application responsible for displaying the user interface and handling user interactions. It provides a graphical or web-based interface through which users can interact with the application.</p><h4>Application Tier:</h4><p>This middle layer contains the core functionality of the application, processing the business logic, making logical decisions, and performing computations. It acts as a bridge between the presentation tier and the data tier.</p><h4>Data Tier:</h4><p>The bottommost layer is responsible for data storage and management. It handles database operations such as querying, updating, and storing data.</p><h4>Lets start implementing:</h4><p>Task 1. Create VPC</p><p>Task 2. Create Subnets</p><p>Task 3. Setting up Internet GW: Create an Internet Gateway and attach it to your VPC.</p><p>Task 4. Create NAT GW: <br>1. Create a NAT Gateway in the public subnet with an Elastic IP.<br>2. Create a route in the private subnet route table to direct internet traffic to the NAT Gateway.</p><p>Task 5.Create Route Tables :</p><p>#### Public Route Table<br>1. Create a route table for the public subnet.<br>2. Add a route for `0.0.0.0/0` pointing to the Internet Gateway.</p><p>#### Private Route Table<br>1. Create a route table for the private subnet.<br>2. Add a route for `0.0.0.0/0` pointing to the NAT Gateway.</p><p>Task 6. Configure Launch Templates: 6.1. Create a Launch Template for the web tier EC2 instances, with User Data script.</p><p>6.2. Create a Launch Template for the application tier EC2 instances.</p><p>Task 7. Auto scaling groups:</p><p>1. Create an Auto Scaling Group for the web tier using the web tier Launch Template and specify the public subnet.<br>2. Create an Auto Scaling Group for the application tier using the application tier Launch Template and specify the private subnet.</p><p>Task 8. Database Tier: <br>1. Create an RDS instance in the database subnet.<br>2. Configure the RDS instance to use the Database Security Group.</p><p>Task 9. Testing the setup</p><h4>Architecture Diagram of above implementation:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*dP8oDKT3m9nUxBbO.png" /></figure><h4>Task 1. Creating VPC:</h4><ul><li>Login to AWS Management Console, in the search bar type VPC, once the page is open click on Create VPC</li><li>Select VPC only</li><li>Give a name of your choice</li><li>IPv4 CIDR as 10.0.0.0/16</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XRMG1gTdB0f8vEbIgTv8zQ.png" /></figure><p>. Click on Create VPC</p><h4>Task 2. Create a Subnet</h4><ul><li>Click on Create Subnet</li><li>Select VPC Id as 3TierApp</li></ul><p><strong>Note : Here we will create 6 Subnets 2 Subnets for Web Tier, 2 Private Subnets for Application Tier and 2 Private subnets for Database Tier</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSbXrJflm1xFe3W3_Z2smA.png" /></figure><ul><li>Give the name of Subnet of your choice “webtier1-public”</li><li>IPv4 Subnet CIDR Block “10.0.32.0/24”</li><li>Enable Auto-assign IP settings</li></ul><p>Click on Create Subnet</p><h4>Note : Similarly create 5 new subnets</h4><p>2nd Subnet with name “webtier2-public”, IPv4 subnet CIDR Block “10.0.0.0/24”, Enable Auto-assign IP settings</p><p>3rd Subnet with name “applicationtier1-private”, IPv4 subnet CIDR Block “10.0.160.0/24”</p><p>4th Subnet with name “applicationtier2-private” and IPv4 subnet CIDR Block “10.0.128.0/24”</p><p>5th Subnet with name “databasetier1-private” IPv4 subnet CIDR Block “10.0.96.0/24”</p><p>6th Subnet with name “databasetier2-private” IPv4 subnet CIDR Block “10.0.64.0/24” , select different AZ as us-east-1a</p><p>All the subnets are successfully created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*LDo9Y93NP3Fv-t7iKzl4fQ.png" /></figure><h4>Task 3. Setting up Internet GW</h4><ul><li>Go to Internet Gateway from left Navigation Panel and click on click Internet GW</li><li>Give the name of your choice “igw-3tierapplication”</li><li>Click on Create Internet GW</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ls2Rifox3SKXgt_26uu5bA.png" /></figure><ul><li>Attach the newly created IGW to VPC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVSOSFT6_QEci_sm_XpAHA.png" /></figure><ul><li>Click on Attach internet gateway</li></ul><h4>Task 4. Create NAT GW</h4><ul><li>From the left nagivation panel click on NAT gateways</li><li>Give the name for Nat Gateway “nat-3tierapp”</li><li>Select Subnet as which is connected to Internet GW, in our case we have associated webtier1-public to Internet GW so we will select “webtier1-public”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*NpjajGElTbwIIO43auiqHg.png" /></figure><p><strong>Note : In order to create NAT GW you need to Allocate Elastic IP address and use the Elastic IP address while creating NAT GW</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-RQADp4x4zHDdK8nmy3mw.png" /></figure><h4>Task 5.Create Route Tables</h4><p>Lets create 2 route tables one for public and another one for private</p><ul><li>Go to Route Tables and click on Create route table</li><li>Give a name as “route-private”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZYOOYTorWlYgB2_w7fWEg.png" /></figure><ul><li>Create another route table and give name as “route-public” and select 3tierApp VPC</li><li>Go to “route-public” and click on subnet association</li><li>Click on Edit subnet association</li><li>Select “webtier1-public”and “webtier2-public” and click on Save association.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ge0qbEtl9fbWup-0-0NI3g.png" /></figure><ul><li>Go to Routes</li><li>Click on Edit Routes</li><li>Add new route, Destination as 0.0.0.0/0 and Target Select Igw, click on Save changes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7uq_7EB11jzZpDA4srrxw.png" /></figure><ul><li>Select other route table which is “route-private”</li><li>Click on Subnet associations</li><li>Select the two application subnets which we have created and click on Save associations</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iPP7WpUNWKzyUEUlCpA-YQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3bGfzeS5DZUtKyXaxff6w.png" /></figure><p>* Click on edit routes and add NAT GW as Target and select 0.0.0.0/0 as destination</p><h4>Task 6. Configure Launch Templates</h4><ul><li>Go to EC2 and in the left navigation panel click on Launch Templates</li><li>Click on Create Launch Template, give any name of your choice</li><li>Check the box for Auto Scaling Guidance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*5hqvE_JTMS6kCi3w4FMEig.png" /></figure><ul><li>Select the Amazon Linux 2023 AMI</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*10gI0axOLPT4JVXV3Vye5A.png" /></figure><ul><li>Select instance type as “t2.micro”</li><li>Create new key pair</li><li>In Network Settings, Create new SG and give name as “webtierSG”</li><li>Give some description</li><li>And select the 3tier VPC</li><li>Inbound rules ssh and http from anywhere</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*59L3RxtPoOoEYKGe9gL1RQ.png" /></figure><ul><li>Scroll to the bottom and click on Advanced Settings</li><li>Go to user data and paste the below script</li></ul><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd<br>systemctl start httpd<br>systemctl enable httpd<br>echo &quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Tech Universe with Asma, Demo for 3Tier Application&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;&quot; &gt; /var/www/html/index.html</pre><ul><li>Click on Create Launch Template</li></ul><h4>6.2 Create another Launch Template for Application</h4><ul><li>Give name of your choice</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*kaKzEoxvGz09ch35jkBlnw.png" /></figure><ul><li>Select AMI as Amazon Linux 2023</li><li>Instance type as t2.micro</li><li>Select the keypair which is created earlier</li><li>Create new security group</li><li>Create inbound rules for ssh, http and mysql connectivity</li><li><strong>For SSH we need to give the source as “webtierSG”, it means that webtier machine is only allowed to access the application tier</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*F3WXGuStoICa309Jlu_5rA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*m0ueR23Fm4j2aYWC_wWCSA.png" /></figure><ul><li>Click on Launch template</li></ul><h4>Task 7. Auto scaling groups</h4><ul><li>Click on Auto scaling groups and click on create auto scaling group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aUzCOFs5ef29QUpHrjBy8g.png" /></figure><ul><li>Give a name of your choice</li><li>Select the Launch template which is created in previous step</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQK9W2WWC6ilyYc_kUKxDQ.png" /></figure><ul><li>Click on Next and in Network, Select 3tierVPC</li><li>Select both the webtier-public subnets, click on Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRgWZd1FAI987ZElYORR_w.png" /></figure><ul><li>Select desired capacity type as 1,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*A6tSk3jQqCmk0zt-4OjQkA.png" /></figure><ul><li>Give tag as Name and WebTierMachine</li><li>Review everything and click on Create AutoScaling Group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61zhsiaehf1yW78AoAfIGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQYst3ADi5A5gkewf2AQMg.png" /></figure><ul><li>One of the instance gets created go and check the details</li><li>Go to tags and check that instance is created because of Auto Scaling group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*fNLZi0k4rJ-yRfjamXQqVQ.png" /></figure><p>Copy the public IP of WebTier and paste in browser , if you are able to see the below page, Web Tier is correctly setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1GE3XKk6PgtSg_4o9AlbmA.png" /></figure><p><strong>7.2 Create Auto Scaling group for Application Tier</strong></p><ul><li>Create Auto Scaling group</li><li>Give the name of your choice</li><li>Select Launch template as “application-3tierapp”</li><li>Select VPC as 3tierVPC</li><li>Availability Zones select “applicationtier1-private and application2-private”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSPuyQHExNqlVVni9ZqsVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*zwqG711E_tfkYLCoWvgWHQ.png" /></figure><ul><li>Keep everything as it is.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Htj_EXqpU-e4Psuevar2Q.png" /></figure><ul><li>Click on Create AutoScaling group</li><li>Go to EC2 Instance and Click on Instances and see if the new instance is launched because of newly created application tier autoscaling group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*q35tMrh0qfjQ39dlrb34yA.png" /></figure><h4>Task 8. Database Tier</h4><ul><li>In the search bar search “RDS”</li><li>Click on “Create Database”</li><li>Select Standard Create and select “MySql”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*6FQdtXZGuDDf3xkBhdpLRA.png" /></figure><ul><li>Select Free tier</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEQiBkccNEfbnBTDOM8TWw.png" /></figure><ul><li>Scroll down and give the password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjdkXVQQgOxj525RS-VFjg.png" /></figure><ul><li>Instance configuration “db.t3.micro”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*SInlxfYRAviz4oFrz0a6tg.png" /></figure><ul><li>Uncheck Storage autoscaling</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*bMf1M1kAFaWfuautMba7_w.png" /></figure><ul><li>Connectivity choose 3TierApp VPC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeO2_CAtblm3qoEngO08Ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*P1dD4cEzZcCT9qmsxCUM1w.png" /></figure><ul><li>Create new DB Subnet Group and new security group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WPR3WfmjZ6oMnLEf5KKDQ.png" /></figure><ul><li>Click on Create Database</li><li>Database is created successfully</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pSZyEDnoH5KcM0v1w1Shw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-gBeAnDeHOALa_UPrCxBXw.png" /></figure><p><strong>Go to EC2 Instance and Click on Application Machine and click on Security Group, Open Security Group and click on Edit Inbound Rules</strong></p><ul><li>Click on Inbound rules, edit Mysql inbound rule and in source type database security group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiLwi_oktZ-63UVq91bVzA.png" /></figure><p>Now SSH into the Web Tier Machine from my laptop</p><p>once connected, type the below command and it confirms that web tier is running correctly.</p><pre>curl http://localhost</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsThqx-9bbnk4tGLtW_8pg.png" /></figure><ul><li>Now try to connect the application tier from the Web tier.</li><li>Select the application machine and you will see there is no public ip, copy the private IP and ping the IP from Webtier machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhdlYlqT31nrMeotB_QIjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGU9KIYVe_tuVIq3hfJ8xg.png" /></figure><ul><li>There would be no response from Application Machine, there has to be icmp enabled for ping command to work correctly.</li></ul><p>Now you have to add the private key to EC2 instance, for this you need to copy the content of private key from your personal laptop to th webtier machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*tkDAcNXXQZgldaZ1pPdGZA.png" /></figure><p>Now we are able to connect Webtier Machine to Application Tier.</p><p>Lets connect Database from Application Machine.</p><p>First we need to install mysql on the Application machine, type the below command</p><pre>sudo yum install mysql -y</pre><p>mysql will get installed on application machine, but it does not have internet connectivity but NAT GW is attached to the instance.</p><ul><li>Copy the endpoint of Database</li></ul><p>database-1.cyrewq2xhdxm.us-east-1.rds.amazonaws.com</p><ul><li>Initiate your DB connection with database endpoint. In the following command, replace the RDS endpoint and the username, and then execute it in the browser terminal:</li></ul><pre>mysql -h database-1.cyrewq2xhdxm.us-east-1.rds.amazonaws.com -P 3306 -u admin -p password </pre><p>You will then be prompted to type in your password. Once you input the password and hit enter, you should now be connected to your database.</p><p><em>NOTE: If you cannot reach your database, check your credentials and security groups.</em></p><ul><li>Create a database , insert data with the help of SQL commands using the MySQL CLI.</li></ul><p>Thats awesome , We successfully connected to our database from our application server.</p><p><strong>We’ve successfully created a highly available, 3-tier application architecture.</strong></p><h4>Benefits of using 3 Tier Architeture on AWS:</h4><p>Using a three-tier architecture on AWS provides several benefits, particularly when aligned with the AWS Well-Architected Framework. Here are some key advantages:</p><ol><li><strong>Scalability:</strong></li></ol><ul><li><strong>Auto Scaling:</strong> Each tier (web, application, and database) can be scaled independently based on demand, allowing efficient resource utilization and cost management.</li></ul><p><strong>2. High Availability and Fault Tolerance:</strong></p><ul><li><strong>Multi-AZ Deployments:</strong> Services like RDS can be configured for Multi-AZ deployments, providing automatic failover to a standby instance in case of an outage.</li></ul><p><strong>3. Security:</strong></p><ul><li><strong>Network Segmentation:</strong> Using VPCs and subnets to isolate different tiers enhances security by limiting access to sensitive components like databases.</li><li><strong>Security Groups and NACLs:</strong> Fine-grained control over inbound and outbound traffic at the instance and subnet level.</li></ul><p><strong>4. Manageability:</strong></p><ul><li><strong>Separation of Concerns:</strong> Dividing the architecture into three tiers (web, application, and data) simplifies management, updates, and troubleshooting.</li><li><strong>Infrastructure as Code (IaC):</strong> Services like AWS CloudFormation and AWS CDK allow you to define and deploy infrastructure consistently and repeatably.</li></ul><p><strong>5. Cost Optimization:</strong></p><ul><li><strong>Right-Sizing:</strong> Each tier can be sized independently based on its specific resource requirements, preventing over-provisioning.</li><li><strong>Reserved Instances and Savings Plans:</strong> Cost savings on long-term commitments for predictable workloads.</li></ul><p><strong>6. Performance Efficiency:</strong></p><ul><li><strong>Auto Scaling:</strong> Automatically adjusts capacity to maintain steady and predictable performance.</li></ul><p><strong>7. Service Integration:</strong> Easily integrates with other AWS services (e.g., S3 for storage, SNS for messaging) to extend functionality and support different use cases.</p><ul><li><strong>Environment Isolation:</strong> Development, staging, and production environments can be easily separated within the same architecture.</li></ul><h4>By leveraging these benefits, a three-tier architecture on AWS, following the Well-Architected Framework principles, ensures robust, efficient, and scalable application deployments.</h4><h4><em>Remember to delete your resources (ASG, VPC, Subnets, DB, NAT Gateway) and release all elastic IPs, so you don’t continue to get charged!</em></h4><h3>Thank you!</h3><p><em>Appreciate your time reading! If you found value in this article, a round of applause (👏) would be fantastic to help others discover it. Feel free to share your insights and comments below, I’m eager to hear your thoughts!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=759d1882ed77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CodeCommit | CodeBuild]]></title>
            <link>https://medium.com/@akram.asma/aws-codecommit-codebuild-1d79ce46a733?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d79ce46a733</guid>
            <category><![CDATA[aws-codecommit]]></category>
            <category><![CDATA[aws-codebuild]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Tue, 04 Jun 2024 10:56:24 GMT</pubDate>
            <atom:updated>2024-06-04T14:23:38.427Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oAx8qEkPs1CrT_49" /><figcaption>Photo by <a href="https://unsplash.com/@christinhumephoto?utm_source=medium&amp;utm_medium=referral">Christin Hume</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>What is AWS CodeCommit?</h4><p>AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It makes it easy for teams to collaborate on code in a secure and highly scalable ecosystem. CodeCommit eliminates the need to operate your own source control system or worry about scaling its infrastructure. You can use CodeCommit to securely store anything from source code to binaries, and it works seamlessly with your existing Git tools.</p><p>CodeCommit provides repository-level access control using AWS Identity and Access Management (IAM), ensuring only authorized users can access and modify code. It encrypts repositories at rest and in transit, safeguarding data integrity and confidentiality.</p><h4>What is CodeBuild?</h4><p>AWS CodeBuild is a fully managed build service in the cloud. CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy. CodeBuild eliminates the need to provision, manage, and scale your own build servers. It provides prepackaged build environments for popular programming languages and build tools such as Apache Maven, Gradle, and more. You can also customize build environments in CodeBuild to use your own build tools. CodeBuild scales automatically to meet peak build requests.</p><p>CodeBuild runs builds in isolated environments, reducing the risk of exposure to security vulnerabilities during the build process. CodeBuild can handle multiple builds concurrently, reducing wait times and accelerating the development process.</p><p>AWS CodeCommit and CodeBuild are designed for high availability, ensuring that code repositories and build processes are reliable and accessible. Both CodeCommit and CodeBuild use a pay-as-you-go pricing model, allowing you to pay only for what you use, reducing upfront costs. There’s no need to manage servers or infrastructure, which reduces operational costs and allows teams to focus on development. Both services integrate seamlessly with other AWS tools and services, enabling a comprehensive and cohesive development environment.</p><h4>Architecture Diagram for the tutorial</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*tH26hqgNUujlWJ5GLjSmrg.png" /></figure><h3>Part 1:</h3><ol><li>Setup CodeCommit repository on AWS</li></ol><p>2. Push code to CodeCommit using AWS <strong>CLI</strong></p><p>3. Setup <strong>AWS CodeBuild f</strong>or building code</p><p>4. Setup <strong>S3 bucket</strong> for code storage Artifacts</p><h3>Prerequisites</h3><p>Before you begin, you must complete the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html">prerequisites and setup</a> procedure, including:</p><ul><li>Assigning permissions to the IAM user.</li><li>Setting up credential management for HTTPS or SSH connections on the local machine you use for this tutorial.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzirVyAJXgTvDGdVB2W-1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*3Mx2_K-qT59LV_Aj3BSJBQ.png" /></figure><ul><li>Attach the policy “<strong>AWSCodeCommitPowerUser” </strong>the user which we have created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zjM7WZu3uSUibTnxRsxueQ.png" /></figure><ul><li>Configuring the AWS CLI if you want to use the command line or terminal for all operations, including to create the repository.</li></ul><h4>Task 1. Sign in to AWS Management Console</h4><h4>Task 2. Go to AWS Code Commit</h4><p>2.1 Create a new Repository named as “DemoRepo”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*qztH6g8XSATB-4A8N37cWg.png" /></figure><h4>Task 3. Push Code to CodeCommit using AWS CLI</h4><p>3.1 Click on Clone URL and Clone HTTPS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3XlHMUm7l3dq8Aq9REW5Q.png" /></figure><p><a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/RepoforAsma">https://git-codecommit.us-east-1.amazonaws.com/v1/repos/RepoforAsma</a></p><p>3.2 Clone your code commit url and go to your terminal and run git clone &lt;copied url&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iu5qD0dW7046n9s29jAsRw.png" /></figure><p>3.3 It will ask you for username and password → give it to your code commit credentials that you generated previously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*xx3uC-pr11htD_M1jADtSQ.png" /></figure><p>3.4 Now we will create some files in the empty repository.</p><p>3.4.1 cd <a href="https://git-codecommit.us-east-1.amazonaws.com/v1/repos/RepoforAsma">RepoforAsma</a></p><p>3.4.2 Create a new file index.html and paste the below code in the file</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Resume&lt;/title&gt;<br>    &lt;style&gt;<br>        body {<br>            font-family: Arial, sans-serif;<br>            line-height: 1.6;<br>            margin: 0;<br>            padding: 0;<br>            background-color: #f4f4f4;<br>            color: #333;<br>        }<br>        .container {<br>            max-width: 800px;<br>            margin: auto;<br>            padding: 2rem;<br>            background-color: #fff;<br>            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);<br>        }<br>        h1, h2, h3 {<br>            margin-bottom: 1rem;<br>            color: #333;<br>        }<br>        p {<br>            margin-bottom: 1rem;<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div class=&quot;container&quot;&gt;<br>        &lt;h1&gt;Resume&lt;/h1&gt;<br>        &lt;h2&gt;Asma Akram&lt;/h2&gt;<br>        &lt;p&gt;AWS Certified Cloud Practitioner | 4.5 years of IT experience&lt;/p&gt;<br>        <br>        &lt;h3&gt;Skills&lt;/h3&gt;<br>        &lt;ul&gt;<br>            &lt;li&gt;AWS Cloud Practitioner Certification&lt;/li&gt;<br>            &lt;li&gt;Experience in AWS services&lt;/li&gt;<br>            &lt;li&gt;Technical skills: AWS, Python, Linux&lt;/li&gt;<br>            &lt;li&gt;Soft skills: Collaboratio, Team Player &lt;/li&gt;<br>        &lt;/ul&gt;<br><br>        &lt;h3&gt;Experience&lt;/h3&gt;<br>        &lt;p&gt;Freshworks | Software Engineer &lt;/p&gt;<br>        &lt;ul&gt;<br>            &lt;li&gt;Application Support 1&lt;/li&gt;<br>            &lt;li&gt;AWS Services Support 2&lt;/li&gt;<br>            &lt;li&gt;Development and Testing 3&lt;/li&gt;<br>        &lt;/ul&gt;<br><br>        &lt;h3&gt;Education&lt;/h3&gt;<br>        &lt;p&gt;B.E, I.T | Rajiv Gandhi Prodyogiki Vidhyalaya | 2005&lt;/p&gt;<br><br>        &lt;h3&gt;Contact&lt;/h3&gt;<br>        &lt;p&gt;Email: akram.asma@email.com | Phone: 982333333&lt;/p&gt;<br>    &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><pre>git status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*QjiuKpqXJKtcFMVKflxKoA.png" /></figure><p>3.5 Now add the newly created file on the CodeCommit Repo by using the below commands</p><pre>git add .<br>git commit -m &quot;First Commit&quot;<br>git push origin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*jqu3GlkJvUOy0QXV9H0Tyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*kFoEiOKxepGCAqDH4YK5UQ.png" /></figure><p>3.6 After pushing the code to the Repo, we would be able to see the newly pushed file in the CodeCommit Repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvpwyUSjx23Fcm6c_oKBmg.png" /></figure><h4>Task 4. Setup Aws CodeBuild for building code</h4><p>4.1 Search CodeBuild and click on Create Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn5W_1fa1ey-vMa1TeLqUw.png" /></figure><p>4.2 Give the name to your project as “AsmaDemoProject”</p><p>4.3 Select Source provider as “AWS CodeCommit”, Repository as “RepoForAsma” and Branch as “master”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*oMVF7sk6Ikh6-bjqTHmFjA.png" /></figure><p><strong>4.4</strong> For OS choose ubuntu , runtime to standard and image to latest version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*ahMAe0WJJzfBB2hET14MdA.png" /></figure><ul><li>Create a new service role</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqZ34Ue-rC11qXf3ciBPYg.png" /></figure><p><strong>4.5 buildspec file →</strong> it is a file which tells the code build what steps is needed when you are building the code.</p><p>We will go to our folder and create a buildspec.yml file and paste the following code in the buildspec.yml file</p><pre>version: 0.2<br><br>phases:<br>  install:<br>    commands:<br>      - echo Installing NGINX<br>      - sudo apt-get update<br>      - sudo apt-get install nginx -y<br>  build:<br>    commands:<br>      - echo Build started on `date`<br>      - cp index.html /var/www/html/<br>  post_build:<br>    commands:<br>      - echo Configuring NGINX<br><br>artifacts:<br>  files:<br>    - &#39;**/*&#39;</pre><p>4.6 Add and push the newly created file by running the below commands</p><pre>git add .<br>git commit -m &quot;Adding Buildspec.yml&quot;<br>git push origin master</pre><p>Uncheck the <br>CloudWatch logs</p><p>4.7 Click on <strong>create build project </strong>option and keep everything as it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqPSXnGjKXgmOl5epdGiPg.png" /></figure><ul><li>Now click on start <strong>build option</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPJVeG0OuacabYawPjknvQ.png" /></figure><p>4.8 It will run all the steps which was written in buildspec.yml file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kHEGdS2tfPADRPJjEjGYlw.png" /></figure><h4>Task 5. Create Artifact</h4><p>5.1 Go to S3 and create a new bucket with unique name and inside the bucket create a folder named as code_output</p><p>5.2 Click Edit on AsmaDemoProject</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RR6gzkYM8t1UCWwJLVDv_A.png" /></figure><p>5.2 Give Type of Artifact as Amazon S3, Give the bucket name which we have created in previous line, also give the name of folder where output artifacts will be placed and also give the path by copying s3 uri and add artifact.zip in the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*S93j4FFk-5ISiLfUzIVDcg.png" /></figure><p>5.3 Click on Update Project</p><p>5.4 Again Start Build</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wdfH5C0I76S_2fRc4dSuA.png" /></figure><p>5.5 In order to check the UPLOAD_ARTIFACTS go to S3 bucket and see if your code is uploaded after the build or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TampToheYTEziZQarjyLhg.png" /></figure><p>In next part of this tutorial we will learn to use AWS CodeDeploy and CodePipeline. Stay tuned for next part.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d79ce46a733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Efficient Deployment Strategies: Unleashing CodeDeploy and CodePipeline]]></title>
            <link>https://medium.com/@akram.asma/efficient-deployment-strategies-unleashing-codedeploy-and-codepipeline-a2e3fa5ec4c8?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2e3fa5ec4c8</guid>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[aws-codepipeline]]></category>
            <category><![CDATA[codepipeline]]></category>
            <category><![CDATA[aws-code-deploy]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Tue, 07 May 2024 10:35:33 GMT</pubDate>
            <atom:updated>2024-05-07T10:35:33.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ARhdpLf8pX9i2dcJMZGpSg.png" /><figcaption>AWS</figcaption></figure><h3>What is AWS CodePipeline?</h3><p>AWS CodePipeline is a continuous delivery service you can use to model, visualize, and automate the steps required to release your software. You can quickly model and configure the different stages of a software release process. CodePipeline automates the steps required to release your software changes continuously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bL47hovBcYVRWQCfYycfhg.png" /></figure><ul><li><strong>Source</strong>: It refers to the repository where the source code and its revisions are stored, which could be an Amazon S3 Bucket, a CodeCommit repository, or Git-based repositories like GitHub and Bitbucket.</li><li><strong>Build</strong>: During the build phase, the buildspec.yml file is pivotal. Here, software undergoes testing and construction.</li><li><strong>Staging: </strong>Staging is where code is deployed into a testing environment, also known as a pre-production environment. This phase allows for thorough software testing before making it live for public users. It’s an optional stage if the application has already undergone comprehensive testing prior to being uploaded to the source.</li></ul><p>Using AWS CodePipeline, applications can be deployed on Amazon EC2 Instances using CodeDeploy, Elastic Beanstalk, or AWS OpsWorks Stacks.</p><h3>Now lets learn how to set up a two-stage pipeline utilizing an Amazon S3 bucket with versioning enabled, and employ AWS CodePipeline to deploy a sample application.</h3><ul><li>Step 1: Sign in to AWS Management Console</li><li>Step 2: Launching an EC2 Instance</li><li>Step 3: SSH into the instance</li><li>Step 4: Install AWS CLI, and CodeDeploy Agent</li><li>Step 5: Create S3 bucket for your application</li><li>Step 6: Create a CodeDeploy application and Deployment group.</li><li>Step 7: Create your first pipeline in CodePipeline and deploy the application on the instance</li><li>Step 8: Test the application using EC2 Instance Public IPv4 DNS</li><li>Step 9: Clean up resources</li></ul><h3>Task 1: Sign in to AWS Management Console</h3><h3>Task 2: Launching an EC2 Instance</h3><p>2.1. Amazon Linux 2 AMI</p><p>2.2. Instance type t2.micro</p><p>2.3 .Create a key pair</p><p>2.4. Create new security group with SSH and HTTP ports open from anywhere.<br> 2.4.1 Name the security group as “CodePipeline-SG”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iFe7I-neeRIdJsvKcuvqyA.png" /></figure><p>2.5. No. of instances as 1</p><p>2.6. Click on Create instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48c4o7dzgMd0ScfPsiJZtg.png" /></figure><h3>Task 3: SSH into EC2 Instance</h3><h3>Task 4: Install AWS CLI, and CodeDeploy Agent</h3><p>4.1 Switch to root user, and Run the updates.</p><pre>sudo su<br>yum update -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrlBCwsVWP2qhapNjNQuvQ.png" /></figure><p>4.2 Install the CodeDeploy agent: Install the prerequisite ruby and wget : This command installs the Ruby programming language and the wget utility. Ruby is a prerequisite for installing the CodeDeploy agent, and wget is used to download the agent’s installer.</p><pre>yum install ruby wget -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVYS16wnysCHX70RSmnkKA.png" /></figure><p>4.3 Download the CodeDeploy agent’s installer : This command uses wget to download the CodeDeploy agent’s installer from the specified URL. The installer is a script that sets up the CodeDeploy agent on the EC2 instance.</p><pre>wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_2nlphyGLl8iaj-hQRppw.png" /></figure><p>4.4 Change the permission of the installer</p><pre>chmod +x ./install</pre><p>4.5 Install the latest version of the CodeDeploy agent : This command runs the CodeDeploy agent’s installer script in auto mode. The auto mode automatically detects the instance’s operating system and installs the agent accordingly.</p><pre>sudo ./install auto</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u0la-84zTcfkklJd0lUKbA.png" /></figure><p>4.6 Check that the service is running : This command checks the status of the CodeDeploy agent service. It confirms whether the agent is running or not. If the output shows that the agent is running, it indicates that the installation was successful.</p><pre>service codedeploy-agent status</pre><h3>Task 5. Create S3 bucket for your application</h3><p>5.1 Go to S3 bucket</p><p>5.2 Create S3 bucket</p><ul><li>Enable Bucket Versioning</li><li>Uncheck Block public access (bucket settings)</li></ul><p>5.3 Upload the following file in S3 bucket and open the file and then copy the key</p><p><a href="https://drive.google.com/file/d/1EqkBbChcOnNGrgbXlM4z3khdEkg9FOeM/view?usp=drive_link">SampleApp_LinuxCodeDeployCodePipeline.zip</a></p><pre>SampleApp_LinuxCodeDeployCodePipeline.zip</pre><h3>Task 6. Create a CodeDeploy application and Deployment group.</h3><p>6.1 Navigate to CodeDeploy and click on Applications</p><p>6.2 Click on Create Application</p><p>* Give the name as MySampleApp</p><p>* Select Ec2/On-premises as Compute Platform</p><p>* And Click on Create application</p><p>6.3 Click on Create Deployment group</p><ul><li>Give name of Deployment Group as My_DepGroup</li><li>Create a Service Role for CodeDeploy and use as the Service Role in the drop down</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2vgHK49bOp8p-K5X-0wNxw.png" /></figure><ul><li>Choose Deployment Type as In Place</li><li>Environment Configuration, Select EC2 Instances</li><li>Give the tag</li><li>Key: Name</li><li>Value: MyEC2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0wJMfRCllxlJkLPA4HSMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZVVAsXACchHOJbGm635hg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*I-SOJGQLlAH2JZU-Jpyl3g.png" /></figure><ul><li>It will show matching instances as “1 unique matched instance”</li><li>Select Never with Agent configuration with AWS Systems Manager</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*h_PcGSwHu1XL7VbeTyo1nA.png" /></figure><ul><li>Deployment settings as CodeDeployDefault.AllAtOnce</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*83SDnwy5AfV8gj8UBe3cdw.png" /></figure><ul><li>Uncheck “Enable Load Balancing”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3miFzenA9geE3b0VDs7TkA.png" /></figure><ul><li>Click on create deployment group</li></ul><h3>Task 7: Create your first pipeline in CodePipeline and deploy the application on the instance</h3><p>7.1 Navigate to CodePipeline and click on Pipelines from the left sidebar and then click on the Create pipeline</p><p>7.2 Give name as “MySamplePipeline”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USVeLXp4Xrp2oSRN3C5xCQ.png" /></figure><p>7.3 Create new service role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-hJt6oKgL1Zh6YksrUcRA.png" /></figure><p>7.4 Click on Advanced Settings</p><ul><li>Select Custom location in Artifact store</li><li>Select the Bucket name starting with “mybucket “</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*RxT0yj0_jSRtrskxwAnb9g.png" /></figure><ul><li>Click on Next button</li><li>Source provider: Select Amazon S3 from dropdown</li><li>Bucket: Select mybucket</li><li>S3 object key: Enter SampleApp_LinuxCodeDeployCodePipeline.zip</li><li>Change detection options: Select AWS CodePipeline</li><li>Click on the Next button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaayfjzeqvzfG5_ggiyawQ.png" /></figure><p>7.5 Add build stage :</p><ul><li>Click on the Skip build stage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1QK4_PuV8WaK26__9M42w.png" /></figure><p>7.6 Add deploy stage :</p><ul><li>Deploy provider: Select AWS CodeDeploy from dropdown</li><li>Region: Asia Pacific(Mumbai)</li><li>Application name: Select “<strong>MySampleApp</strong>”</li><li>Deployment group: Select “<strong>My_DepGroup</strong>”</li><li>Click on the Next button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ly_oyNK0r-CU6SOr4j3RTQ.png" /></figure><p>7.7 Review and Click on Create Pipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRSvm3-e5850SxSNF6Koeg.png" /></figure><ul><li>CodePipeline has started to run and will succeed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FjOffJjFkicw0GuQm1w0FA.png" /></figure><h3>Task 8: Test the application using EC2 Instance Public IPv4 DNS</h3><p>8.1 Go to EC2 Instance, click on the instance which we have created in Step2,</p><p>8.3 Copy the Public IPv4 DNS and paste in the browser window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*du0qy-NA2LeSyI3kCrlxiw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XpkohwwFNXxyp59UBPNSpg.png" /></figure><h3>Task 9: Clean up resources</h3><p>9.1 Clean of all the resources by deleting the pipeline, applications in Code Deployment, S3 bucket, EC2 Instance.</p><p>AWS CodePipeline for Containers is now generally available. This advancement empowers developers to effortlessly construct, assess, and roll out container images to any container registry or Kubernetes cluster via CodePipeline. With CodePipeline for Containers, developers can leverage familiar container tools and workflows to oversee their CI/CD pipelines for containerized applications. They can precisely define the build and test stages of their pipeline utilizing Dockerfiles and container images, subsequently deploying these images to their preferred container orchestration platform, be it Amazon Elastic Kubernetes Service (EKS) or Amazon Elastic Container Service (ECS). This innovation offers developers a more seamless and effective approach to handle their container deployments, simplifying the process of building and releasing containerized applications with enhanced speed and agility.</p><p><em>Appreciate your time reading! If you found value in this article, a round of applause (👏) would be fantastic to help others discover it. Feel free to share your insights and comments below; I’m eager to hear your thoughts!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2e3fa5ec4c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into S3 Encryption with AWS KMS]]></title>
            <link>https://medium.com/@akram.asma/a-deep-dive-into-s3-encryption-with-aws-kms-3f91f2ade665?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f91f2ade665</guid>
            <category><![CDATA[aws-kms]]></category>
            <category><![CDATA[security-services]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 13:49:23 GMT</pubDate>
            <atom:updated>2024-04-23T13:49:23.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPVbPphAK06YeJjXXGFWdA.png" /></figure><p>Introduction: As businesses increasingly rely on cloud services, ensuring the security and compliance of data stored in the cloud becomes paramount. In this blog post, we’ll delve into the S3 module, a crucial step in addressing privacy and compliance challenges within your AWS infrastructure. By following the recommendations of Amazon Web Services architects, we’ll explore how to enhance security through the implementation of encryption techniques using AWS Key Management Service (KMS) and Amazon S3.</p><p>AWS Key Management Service (AWS KMS) is a managed service that makes it easy for you to create and control the cryptographic keys that are used to protect your data. AWS KMS uses hardware security modules (HSM) to protect and validate your AWS KMS keys under the <a href="https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/4523">FIPS 140–2 Cryptographic Module Validation Program</a>.</p><p>AWS KMS integrates with most <a href="https://aws.amazon.com/kms/features/#AWS_Service_Integration">other AWS services</a> that encrypt your data. AWS KMS also integrates with <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/">AWS CloudTrail</a> to log use of your KMS keys for auditing, regulatory, and compliance needs.</p><p>Resources:<br><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US"><strong>https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US</strong></a></p><p>The intent of this workshop is to educate users about AWS KMS encryption at rest capabilities within a few AWS services.</p><h3><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/getting-started#business-case">Business Case</a></h3><p>As a new security architect for the Amazon Web Services environment within your firm, you receive a request from your governance and compliance department asking you to review and demonstrate privacy controls for data stored in AWS.</p><p>Reviewing the results of your Well-Architected review to protect data at rest, you discover that while your company enabled encryption in some areas, the configuration parameters are inconsistent. Additionally, your governance, compliance, and audit team asked you to provide a report on data consumers.</p><p>Working with your Amazon Web Services architects, you identify several focus areas.</p><ul><li>Logging and archival. Some CloudTrail logs can contain production data. You need to ensure the controls applied to CloudTrail logs can meet the privacy controls</li></ul><h3><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/getting-started#the-recommendation">The recommendation</a></h3><p>AWS Security specialists recommended using encryption as secondary access control to your data to enhance your data privacy and security posture.</p><h3><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/getting-started#the-existing-inventory">The existing inventory</a></h3><p>Before deploying the new solution, you inventory your environment and discover several misconfigured resources including a CloudTrail trail logging to an S3 bucket, RDS instances, and EC2 instances with EBS volumes. All of these resources do not use customer-managed keys. As you need to ensure your company controls access to the encryption keys whenever possible, you must remedy the existing configuration.</p><h3>Launch the environment</h3><p>Follow the steps below while logged in to you account.</p><p>Also, some of the resources launched with these templates are intentionally misconfigured (missing encryption) and the RDS database created has static credentials. These are not intended to be used in a production environment and we suggest working on this workshop in a fresh AWS account.</p><ol><li>Download the AWS CloudFormation template from this workshop’s GitHub repo.</li></ol><pre>curl &#39;https://static.us-east-1.prod.workshops.aws/public/ecefec38-c95f-48de-94c2-93c142c0b855/static/EnvironmentTemplate.yaml&#39; --output template.yaml</pre><p>2. Navigate to the AWS CloudFormation console to create a new stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ln_JOMQYUC08zGwvfOaRSw.png" /></figure><p>3. Name your stack AWS-KMS-Workshop. Then click <em>Next</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNFYybMKCeqHA8Pwkp0_Yg.png" /></figure><p>4. Leave the stack options as-is and proceed to the next step by clicking <em>Next</em>.</p><p>5. Select the checkbox at the bottom and click <em>Create stack</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8Gi_z_cMYiRbytZofUEuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*udYoN431EuumZD0rcT9Rog.png" /></figure><h3>S3 Track:</h3><h3>Module 1: Manage and Assign KMS Key to S3 Bucket</h3><p>This section of the workshop demonstrates how you can configure CloudTrail and S3 to encrypt CloudTrail data with a customer-managed KMS encryption key. You will also learn how to specify a default type of encryption on an S3 bucket, and enforce your encryption type policies for privacy and compliance.</p><h3>Configure CloudTrail to encrypt log data with KMS</h3><p>This section demonstrates how to create a KMS Customer Managed Key (CMK) that you will use to encrypt your CloudTrail bucket.</p><p>1. Proceed to KMS Console and choose (<strong>Create Key</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3TZPbdGrMstjAzwswOisvQ.png" /></figure><p>2. We will use the new KMS CMK key for encryption. Select a symmetric encryption key type where AWS KMS will generate the key material (<strong>Click Next</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JkD3fHp9JCXkj3-8jG3jOw.png" /></figure><p>3. Key alias: “cloudtrail-s3-encryption-key” Tags: None (<strong>Click Next</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPbjgzxXQtV_DunEy4TQDw.png" /></figure><p>4. For Administrative permissions, search for your current role name (ex: “Asma”) and select the checkbox to allow this role to manage the encryption key. Additionally, you should let the encryption key administrators delete the key (<strong>Click Next</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQ_i1Xd5e_f6yd8MwH6NRw.png" /></figure><p>5. The next screen allows you to define who is allowed to use this key. For now, search for your role (ex: “Asma”) in the textbox and select it to allow for it to have user-level access to the key you are creating (<strong>Click Next</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qy-A7mM5DVwEnc4w5lH3fA.png" /></figure><p>6. AWS KMS UI automatically generates the encryption key policy based on your previous selections (<strong>Click Finish</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vc9DD3vmpYla6H9kTg1Z5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lBt2AjEAzH6UbLzD1RkL-g.png" /></figure><p>7. You should receive a confirmation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8q3gHwzGTdBpfvgVSZBoA.png" /></figure><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/encrypt-cloudtrail-trail#analysis-of-what-you-have-done">Analysis of what you have done</a></h4><p>You have created a symmetric Customer Managed encryption key (CMK) in KMS. You have granted administrative and user access to TeamRole.</p><p>Next, you need to configure the existing CloudTrail to encrypt log data with the new KMS key. To do so, you need to configure the CloudTrail service to encrypt data stored in its S3 bucket. Move on to the next section to complete this task.</p><h3>Configure the existing CloudTrail to encrypt log data with the new KMS key</h3><p>You need to configure the CloudTrail service to encrypt data stored in its s3 bucket. CloudTrail encrypts all its data.</p><ol><li>Proceed to the CloudTrail Console and select your CloudTrail; click on (<strong>workshop-kms-s3</strong>) trail to access its properties</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J7RDTT8seTh96I_-8MJO3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IlJc9KzASz-NaqyJxjE6IQ.png" /></figure><p>2. Click “<strong>Edit</strong>” to access the configuration screen</p><p>3. Scroll down and Check <strong>Enabled</strong> for Log file SSE-KMS encryption, choose <strong>Existing</strong> for Customer Managed AWS KMS key, select the key you created in the last step “cloudtrail-s3-encryption-key”, and ensure you check the Enabled checkbox under “Log File Validation” (Click <strong>Save Changes</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcDfDtDHzYskCsmB5w6wVw.png" /></figure><p>4. When you attempted to save changes, you should have received an error at the top of the screen. In the analysis section, we will review why you have received this error and the steps needed to correct it. <strong>Note:</strong> The error appears at the top of the screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HxW1Jz_aVbUsN-vNnZpqsA.png" /></figure><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/fix-cloudtrail-kms-key-access#analysis-of-what-you-have-done-and-what-has-gone-wrong">Analysis of what you have done and what has gone wrong</a></h4><p>In AWS, all services access your environment as service-specific principals. As AWS does not have the rights or ability to access your data without your explicit permission, you need to explicitly authorize the required actions for security principals to access a service. Services may access your data using dedicated service-linked roles (specific security principals that reside within your account) or with a service principal itself (i.e., cloudtrail.amazonaws.com)</p><p>Remember that when you created the KMS encryption key, you have granted “Asma” rights to manage and use the encryption key. While CloudTrail has permission to write to the S3 bucket, it also needs to be authorized to use your newly-created KMS encryption key to encrypt and decrypt data. You have never granted this permission, and, therefore, CloudTrail access validation fails. To correct this error, you need to give the CloudTrail service principal authorization to perform encrypt and decrypt operations.</p><h3><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/fix-cloudtrail-kms-key-access#adjust-the-kms-encryption-key-policy-to-authorize-the-cloudtrail-service">Adjust the KMS Encryption key Policy to authorize the CloudTrail service</a></h3><p>To authorize the CloudTrail service-linked role to encrypt and decrypt operations, add the AWS role to Key Usage permissions.</p><p>5. To adjust KMS access, navigate to the KMS console and select “cloudtrail-s3-encryption-key” Click on (<strong>Switch to Policy view</strong>). You should see the policy from KMS key creation step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4DXTCyhUYhbh-zIt8CncA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XejRERGAuQ1uwHi5s6v7Rw.png" /></figure><p>6. Click (<strong>Edit</strong>) to access the configuration screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYTJCuJ_mgosWNdui76Ofg.png" /></figure><p>7. Add the KMS key policy to permit cloud trail service to Encrypt, Decrypt, and GenerateDataKey actions. Craft by hand, or copy and paste the statement below. <strong>Note:</strong>, multiple JSON statements in an array need to be comma-separated, also ignore the “access-analyzer” permission errors on the page. Click <strong>(Save Changes)</strong> to apply your new KMS encryption key resource policy</p><pre>        {<br>            &quot;Sid&quot;: &quot;Enable CloudTrail Actions&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;Service&quot;: &quot;cloudtrail.amazonaws.com&quot;<br>            },<br>            &quot;Action&quot;: [<br>                &quot;kms:Encrypt*&quot;,<br>                &quot;kms:GenerateDataKey&quot;,<br>                &quot;kms:Decrypt&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;*&quot;<br>        },</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WmGSFChOmmkmc7CcI35s4A.png" /></figure><p>8. Retry the steps in the previous section (step 1 above) to save changes to your CloudTrail configuration. Now that you have granted CloudTrail permissions to use the KMS key, the operation will succeed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44e3858ZkSwyBB_potdCCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkWJQvP1anQxixMr4NO8ZQ.png" /></figure><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/fix-cloudtrail-kms-key-access#analysis-of-what-you-have-done">Analysis of what you have done</a></h4><p>When you operate on your data with AWS KMS, you need to grant two types of permissions. <strong>The first permission is to store data to the selected medium (EBS, S3, EFS). Secondly, you need to allow a principal that operates to access your encryption key in the prescribed manner. We used S3 as a storage medium; however, the same concept applies to all other AWS services using the AWS KMS.</strong></p><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/fix-cloudtrail-kms-key-access#analysis-of-the-current-state">Analysis of the current state</a></h4><p>If you successfully changed the configuration in the previous steps, AWS CloudTrail will begin to encrypt all objects in S3 with the KMS key you specified. In this instance, the encryption is managed and enforced by the CloudTrail service. In some cases, however, you may have your S3 bucket accept data from other sources. The following section will demonstrate how you can ensure your data is</p><ol><li>Encrypted by default</li><li>Will not be written in plain-text</li></ol><h3>Set S3 Bucket Encryption</h3><ol><li>Proceed to the S3 console and locate the CloudTrail bucket click on the S3 bucket name to edit</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gxfUTko9BoFGM2DxvMes7w.png" /></figure><p>2. Select (Properties), and scroll down to the Default encryption section, click (Edit)</p><p>3. In the encryption configuration section: Edit Default Encryption 1. Select “Server-side encryption with AWS Key Management Service keys (SSE-KMS)” 2. Choose from your AWS KMS keys 3. Select your KMS key 4. Ensure Bucket key is set to “Enable” <strong>Click (Save changes)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5oC6T25VeatwtJsexlWgAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRZRRmsk2ukW6z2I1j8e8Q.png" /></figure><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/set-s3-bucket-encryption#analysis-of-what-you-have-done">Analysis of what you have done</a></h4><p>You have successfully enabled the default KMS CMK encryption on your bucket. S3 service will apply the default encryption to any uploads into this bucket without explicit encryption parameters.</p><p>When you upload an object to this S3 bucket, there will be two permission checks:</p><ol><li>Does the principal have the authorization to write into this bucket?</li><li>Does the principal have the authorization to encrypt with the KMS key specified?</li></ol><p>During s3:GetObject operation, the inverse will occur:</p><ol><li>Does the principal have the authorization for S3:GET operation?</li><li>Does the principal have the authorization to decrypt the object with the KMS key applied to the object?</li></ol><p><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/set-s3-bucket-encryption#a-note-on-the-%22bucket-key%22-option">A note on the “Bucket Key” option</a></p><p>Workloads that access millions of objects encrypted with SSE-KMS can generate large volumes of requests to AWS KMS. When you use SSE-KMS to protect your data without an S3 Bucket Key, Amazon S3 uses an individual AWS KMS data key for every object. S3 makes a call to AWS KMS for every KMS-encrypted object request. Amazon S3 Bucket Keys reduce Amazon S3 server-side encryption cost using AWS Key Management Service (SSE-KMS). An S3 Bucket Key is used for a time-limited period within Amazon S3, reducing the need for Amazon S3 to make requests to AWS KMS to complete encryption operations. This process reduces traffic and the number of queries from S3 to AWS KMS, allowing you to access AWS KMS-encrypted objects in S3 at a fraction of the previous cost.</p><p>Note that the default set of parameters does not override settings on the existing objects. The process to remediate the situation is the same as the process to remediate unencrypted objects. We will cover this process in the following sections of this workshop.</p><h3>Enforce S3 Object Encryption on upload</h3><p>The default bucket encryption doesn’t override the encryption settings specified in the upload of a new object. For example, if you specify AES256 encryption in your PutObject request to a bucket with a default SSE-KMS encryption, S3 will respect your request and set SSE-S3 encryption. We recommend that you configure the default bucket encryption to enforce your encryption scheme on all uploads.</p><p>The following section of the workshop will demonstrate how you can enforce a specific encryption method on your bucket.</p><p>Proceed to the S3 console and locate the CloudTrail bucket. Click on the S3 bucket name to edit its properties and permissions.</p><p>Select (Permissions), and scroll down to the Bucket policy section, click (Edit)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DcYwjFrD8N04gor3XxyEbw.png" /></figure><p>You need to add a statement to the bucket policy that will enforce the encryption type. If you copy and paste the template below, make sure to specify the name of the bucket ‘workshop-kms-s3-cloudtrail-‘ in the resource section in the JSON policy document below. Remember that we apply encryption header policies to the bucket contents, not to the bucket itself, — include “/*” at the end of the bucket ARN. Click (<strong>Save Changes</strong>)</p><pre>  {<br>   &quot;Sid&quot;: &quot;DenyIncorrectEncryptionHeader&quot;,<br>   &quot;Effect&quot;: &quot;Deny&quot;,<br>   &quot;Principal&quot;: &quot;*&quot;,<br>   &quot;Action&quot;: &quot;s3:PutObject&quot;,<br>   &quot;Resource&quot;: &quot;arn:aws:s3:::workshop-kms-s3-cloudtrail-&lt;ACCOUNT_NUMBER&gt;/*&quot;,<br>   &quot;Condition&quot;: {<br>    &quot;StringNotEquals&quot;: {<br>     &quot;s3:x-amz-server-side-encryption&quot;: &quot;aws:kms&quot;<br>    }<br>   }<br>  },</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z6MAA0cQWGbqZ_eOOY3Ubw.png" /></figure><h4><a href="https://catalog.us-east-1.prod.workshops.aws/workshops/05f16f1a-0bbf-45a7-a304-4fcd7fca3d1f/en-US/s3-track/module-1/enforce-s3-object-encryption#analysis-of-what-you-have-done">Analysis of what you have done</a></h4><p>In this section, you added a bucket resource policy to enforce encryption on all uploads with a KMS key. In AWS, an explicit deny will always override any other permissions. By denying S3 uploads that do not have a “s3:x-amz-server-side-encryption” header set to “aws:kms”, you will Deny all unencrypted s3:PutObject requests as well as S3 requests that use AWS SSE-S3, server-side encryption. Additionally, you can extend this policy by specifying a condition for a specific KMS key.</p><p><strong>Conclusion</strong>: In conclusion, the S3 Track module equips you with the knowledge and tools necessary to enhance the security of your AWS environment through encryption techniques. By leveraging AWS KMS, CloudTrail, S3 encryption policies, you can strengthen your defenses against potential security threats and ensure compliance with industry regulations. Take the next step in securing your data on AWS by mastering S3 encryption with confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f91f2ade665" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CloudFormation to Deploy WordPress Blog on EC2 instance.]]></title>
            <link>https://medium.com/@akram.asma/cloudformation-to-deploy-wordpress-blog-on-ec2-instance-ec215fa53aac?source=rss-df6526d4372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec215fa53aac</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[wordpress-deploy]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <dc:creator><![CDATA[Asma Akram]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 07:20:57 GMT</pubDate>
            <atom:updated>2024-04-16T07:20:57.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lDH5m2I2PWtd7KKE" /><figcaption>Photo by <a href="https://unsplash.com/@sincerelymedia?utm_source=medium&amp;utm_medium=referral">Sincerely Media</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>By utilizing a well-constructed template, you have the capability to deploy all the necessary AWS resources for an application in one go. This section will guide you through a template specifically designed for a WordPress blog. You’ll initiate the creation of a WordPress blog as a stack, oversee the stack creation process, review the resources within the stack, and ultimately, remove the stack. All of these tasks can be seamlessly accomplished using the AWS Management Console.</p><p>To begin, you require a template outlining the resources essential for your stack. In this phase, you’ll utilize a pre-prepared sample template. This template is designed to establish a fundamental WordPress blog, employing a single Amazon EC2 instance coupled with a local MySQL database for storage. Additionally, the template configures an Amazon EC2 security group to manage firewall settings for the EC2 instance.</p><p>A template is a JSON or YAML text file that contains the configuration information about the AWS resources you want to create in the stack. For this walkthrough, the sample template includes six top-level sections: AWSTemplateFormatVersion, Description, Parameters, Mappings, Resources, and Outputs; however, only the Resources section is required.</p><p>The Resources section contains the definitions of the AWS resources you want to create with the template. Each resource is listed separately and specifies the properties that are necessary for creating that particular resource. The following resource declaration is the configuration for the EC2 instance, which in this example has the logical name WebServer:</p><p>To view the template</p><ul><li>You can view the <a href="https://s3.us-west-2.amazonaws.com/cloudformation-templates-us-west-2/WordPress_Single_Instance.template">JSON</a> or <a href="https://s3.us-west-2.amazonaws.com/cloudformation-templates-us-west-2/WordPress_Single_Instance.yaml">YAML</a> WordPress sample template. You don’t need to download it because you will use the template URL later in this guide. For more information about the template formats, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html">AWS CloudFormation template formats</a>.</li><li>We need to upload the YAML file in any existing S3 bucket.</li></ul><h3>Step 1: Make sure you have prepared any required items for the stack</h3><p>Before you create a stack from a template, you must ensure that all dependent resources that the template requires are available. A template can use or refer to both existing AWS resources and resources declared in the template itself. CloudFormation takes care of checking references to resources in the template and also checks references to existing resources to ensure that they exist in the region where you are creating the stack. If your template refers to a dependent resource that doesn’t exist, stack creation fails.</p><p>The example WordPress template contains an input parameter, KeyName, that specifies the key pair used for the Amazon EC2 instance that&#39;s declared in the template. The template depends on the user who creates a stack from the template to supply a valid Amazon EC2 key pair for the KeyName parameter. If you supply a valid key pair name, the stack creates successfully. If you don&#39;t supply a valid key pair name, the stack is rolled back.</p><p>Make sure you have a valid Amazon EC2 key pair and record the key pair name before you create the stack.</p><h3>Step 2: Create the stack</h3><p>You will create your stack based on the <em>WordPress-1.0.0</em> file discussed earlier. The template contains several AWS resources, such as an EC2 instance.</p><p>To create the WordPress stack</p><ol><li>Sign in to the AWS Management Console and open the AWS CloudFormation console at <a href="https://console.aws.amazon.com/cloudformation/">https://console.aws.amazon.com/cloudformation</a>.</li><li>Choose <strong>Create Stack</strong>.</li><li>In the <strong>Specify template</strong> section, select <strong>Amazon S3 Template URL</strong> to type or paste the URL for the sample WordPress template, and then choose <strong>Next</strong>:</li><li><a href="https://mylamps3bucket.s3.ap-south-1.amazonaws.com/WordPress_Single_Instance.yaml">https://mylamps3bucket.s3.ap-south-1.amazonaws.com/WordPress_Single_Instance.yaml</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIs8OIOeNxt7MQEmiMYUvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2srXzPmFlzWgVd8en7f0pQ.png" /></figure><p>5. In the <strong>Specify stack details</strong> section, enter a name in the <strong>Stack name</strong> field. For this example, use <strong>MyWPTestStack</strong>. The stack name can&#39;t contain spaces.</p><p>6. In the <strong>Parameters</strong> section, you must provide values for all parameters that don’t have default values, including <strong>DBUser</strong>, <strong>DBPassword</strong>, <strong>DBRootPassword</strong>, and <strong>KeyName</strong>. In the <strong>KeyName</strong> field, enter the name of a valid Amazon EC2 pair in the same region you are creating the stack.</p><p>7. Choose <strong>Next</strong>.</p><p>8. In this scenario, we won’t add any tags. Choose <strong>Next</strong>. Tags, which are key-value pairs, can help you identify your stacks. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html">Adding tags to your CloudFormation stack</a>.</p><p>9. Review the information for the stack. When you’re satisfied with the settings, choose <strong>Submit</strong>.</p><p>Your stack might take several minutes to create — but you probably don’t want to just sit around waiting. If you’re like us, you’ll want to know how the stack creation is going.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6FogOAYQjDgFrAqNXIrQTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtPI_ZdHN_qltEvfScTZYA.png" /></figure><h3>Step 3: Monitor the progress of stack creation</h3><p>After you complete the <strong>Create Stack</strong> wizard, CloudFormation begins creating the resources that are specified in the template. Your new stack, MyWPTestStack, appears in the list at the top portion of the <strong>CloudFormation</strong> console. Its status should be CREATE_IN_PROGRESS. You can see detailed status for a stack by viewing its events.</p><p>To view the events for the stack</p><ol><li>On the CloudFormation console, select the stack MyWPTestStack in the list.</li><li>In the stack details pane, choose the <strong>Events</strong> tab.</li><li>The console automatically refreshes the event list with the most recent events every 60 seconds.</li></ol><p>The <strong>Events</strong> tab displays each major step in the creation of the stack sorted by the time of each event, with latest events on top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_loChj-ES2jUIE05fmY7ZQ.png" /></figure><h3>Step 4: Use your stack resources</h3><p>When the stack MyWPTestStack has a status of CREATE_COMPLETE, CloudFormation has finished creating the stack, and you can start using its resources.</p><p>The sample WordPress stack creates a WordPress website. You can continue with the WordPress setup by running the WordPress installation script.</p><p>To complete the WordPress installation</p><ol><li>On the <strong>Outputs</strong> tab, in the <strong>WebsiteURL</strong> row, choose the link in the <strong>Value</strong> column.</li><li>The WebsiteURL output value is the URL of the installation script for the WordPress website that you created with the stack.</li><li>On the web page for the WordPress installation, follow the on-screen instructions to complete the WordPress installation. For more information about installing WordPress, see <a href="https://wordpress.org/support/article/how-to-install-wordpress/">https://wordpress.org/support/article/how-to-install-wordpress/</a>.</li><li>After you complete the installation and log in, you are directed to the dashboard where you can set additional options for your WordPress blog. Then, you can start writing posts for your blog that you successfully created by using a CloudFormation template.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXn5RX4deSKEVcRiwrGpaQ.png" /></figure><h4><a href="http://ec2-50-17-115-129.compute-1.amazonaws.com/wordpress">http://ec2-50-17-115-129.compute-1.amazonaws.com/wordpress</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*BfHc8ciqgEHaNwHxVuJJgA.png" /></figure><h3>Step 5: Clean up</h3><p>You have completed the CloudFormation getting started tasks. To make sure you aren’t charged for any unwanted services, you can clean up by deleting the stack and its resources.</p><p>To delete the stack and its resources</p><ol><li>From the CloudFormation console, select the MyWPTestStack stack.</li><li>Choose <strong>Delete Stack</strong>.</li><li>In the confirmation message that appears, choose <strong>Yes, Delete</strong>.</li></ol><p>The status for MyWPTestStack changes to DELETE_IN_PROGRESS. In the same way you monitored the creation of the stack, you can monitor its deletion by using the <strong>Event</strong> tab. When CloudFormation completes the deletion of the stack, it removes the stack from the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHRAUtUaYR5aM0gz9yrZrQ.png" /></figure><p>Congratulations! You successfully picked a template, created a stack, viewed, and used its resources, and deleted the stack and its resources. Not only that, you were able to set up a WordPress blog using a CloudFormation template. You can find other templates in the <a href="http://aws.amazon.com/cloudformation/aws-cloudformation-templates/">AWS CloudFormation sample template library</a>.</p><p>Using AWS CloudFormation to deploy WordPress can offer several benefits across the pillars of the AWS Well-Architected Framework:</p><p><strong>Operational Excellence:</strong></p><p>Automation: CloudFormation allows for the automation of infrastructure deployment, ensuring consistency and reducing the likelihood of human error.</p><p>Standardization: By defining infrastructure as code (IaC), CloudFormation templates provide a standardized and repeatable process for deploying WordPress environments, facilitating easier management and maintenance.</p><p>Monitoring and Logging: CloudFormation can integrate with AWS CloudWatch for monitoring and logging, enabling better visibility into the health and performance of the deployed infra</p><p><strong>Security</strong>:</p><p>Infrastructure as Code (IaC): CloudFormation templates define the desired state of the infrastructure, allowing security configurations to be codified and consistently applied across environments .</p><p><strong>Reliability</strong>:</p><p>Rollback Protection:CloudFormation offers rollback protection, allowing deployments to be automatically reverted to a previous known good state in case of errors or failures during deployment.</p><p>Automated Recovery: By defining AWS resources and their relationships in CloudFormation templates, it becomes easier to implement automated recovery strategies, such as auto-scaling and load balancing, to enhance the reliability of WordPress deployments.</p><p><strong>Performance Efficiency:</strong></p><p>Resource Optimization: CloudFormation enables the specification of instance types, storage volumes, and other resources, allowing for optimized configurations that meet performance requirements while minimizing costs.</p><p>Scalability: CloudFormation can be used to define scalable architectures, such as auto-scaling groups, to automatically adjust resource capacity based on demand, ensuring optimal performance during peak usage periods.</p><p><strong>Cost Optimization</strong>:</p><p>Resource Tagging: CloudFormation supports resource tagging, enabling better tracking and cost allocation across deployments.</p><p>Cost Estimation: CloudFormation templates can be used to estimate the cost of deploying and running WordPress environments, helping organizations make informed decisions about resource provisioning and optimization.</p><p>Lifecycle Management: CloudFormation supports the management of resource lifecycles, including creation, updates, and deletion, allowing resources to be provisioned only when needed and de-provisioned when no longer required, thus optimizing costs.</p><p>Overall, leveraging AWS CloudFormation for deploying WordPress can contribute to improved operational excellence, security, reliability, performance efficiency, and cost optimization by automating deployment processes, enforcing best practices, and enabling better management and optimization of AWS resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec215fa53aac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>