<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>AWS on Zack's Blog</title><link>https://zackblog.work/categories/aws/</link><description>Recent content in AWS on Zack's Blog</description><generator>Hugo</generator><language>en-au</language><lastBuildDate>Sun, 20 Apr 2025 08:36:56 +0000</lastBuildDate><atom:link href="https://zackblog.work/categories/aws/index.xml" rel="self" type="application/rss+xml"/><item><title>Cost Optimization with Amazon Q &amp; Cost Explorer MCP Server</title><link>https://zackblog.work/posts/cost-optimization-with-amazon-q-cost-explorer-mcp-server/</link><pubDate>Sun, 20 Apr 2025 08:36:56 +0000</pubDate><guid>https://zackblog.work/posts/cost-optimization-with-amazon-q-cost-explorer-mcp-server/</guid><description>&lt;p&gt;Managing cloud costs effectively, especially on AWS, is crucial. Wasted resources can easily inflate bills. This post introduces the &lt;strong&gt;AWS Cost Explorer MCP Server&lt;/strong&gt;, a tool designed to simplify analyzing your AWS spending using the Model Context Protocol (MCP).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/awslabs/mcp/tree/main/src/cost-explorer-mcp-server" target="_blank" rel="noopener noreferrer"&gt;https://github.com/awslabs/mcp/tree/main/src/cost-explorer-mcp-server&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://zackblog.work/images/mcp1.png"&gt;&lt;img alt="[Image Placeholder 01: Introduction Graphic]" loading="lazy" src="https://zackblog.work/images/mcp1.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What this AWS Cost Explorer MCP Server Does&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specific MCP Server, provided by AWS Labs, acts as a specialized tool that connects an AI assistant like Amazon Q directly to the detailed AWS cost and usage data. Think of it as giving us AI assistant the specific knowledge and tools needed to understand and analyze our cloud spending.&lt;/p&gt;</description></item><item><title>Destruct AWS account using AWS-Nuke</title><link>https://zackblog.work/posts/destruct-aws-account-using-aws-nuke/</link><pubDate>Tue, 18 Feb 2025 08:16:01 +0000</pubDate><guid>https://zackblog.work/posts/destruct-aws-account-using-aws-nuke/</guid><description>&lt;p&gt;Here&amp;rsquo;s a summary of the actions I took to delete an AWS account using an open source tool &lt;code&gt;aws-nuke&lt;/code&gt; as it is at the end of free tier I donot need it anymore to aviod cost:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Install &lt;a href="https://github.com/ekristen/aws-nuke/blob/main/docs/quick-start.md" target="_blank" rel="noopener noreferrer"&gt;aws-nuke&lt;/a&gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apt install aws-nuke
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command installs &lt;code&gt;aws-nuke&lt;/code&gt;, a tool used to delete AWS resources in an account. It requires AWS credentials and the correct configuration file to specify what resources to remove.&lt;/p&gt;</description></item><item><title>AWS Private Link and Cross-account Package deployment</title><link>https://zackblog.work/posts/aws-private-link-and-cross-account-package-deployment/</link><pubDate>Fri, 15 Nov 2024 04:33:19 +0000</pubDate><guid>https://zackblog.work/posts/aws-private-link-and-cross-account-package-deployment/</guid><description>&lt;p&gt;Recently I got a task from the Company’s app team, to install an agent on EC2 instances across several AWS accounts and enable connection via AWS private link to a target AWS account where the management server is hosted. To achieve this task, here I will see how to use AWS Systems Manager for software distribution and installation for multiple AWS accounts and install and configure AWS private link using Terraform.&lt;/p&gt;</description></item><item><title>RedHat Identity Management (IdM) with AD Integration</title><link>https://zackblog.work/posts/redhat-identity-management-idm-with-ad-integration/</link><pubDate>Sat, 13 Jul 2024 06:17:15 +0000</pubDate><guid>https://zackblog.work/posts/redhat-identity-management-idm-with-ad-integration/</guid><description>&lt;p&gt;When a company faces challenge to manage its Linux environments across local and public cloud, RedHat Identity management can be the solution to achieve:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;With Local AD and Azure AD (AAD) Integration&lt;/li&gt;
&lt;li&gt;With AWS SSO Integration as external identity provider&lt;/li&gt;
&lt;li&gt;LDAP, Kerberos and NTP&lt;/li&gt;
&lt;li&gt;A web-based management front-end running on Apache&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;A Typical AD User Authentication Flow End-to-End:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;User Creation and Management:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Azure AD / Local AD: Users are created in the Azure Active Directory or local Active Directory.&lt;/li&gt;
&lt;li&gt;Synchronization to RedHat IdM: The users are synchronized from AD to RedHat IdM using the two-way trust established between AD and IdM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Accessing EC2 Instances via SSH:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Serverless with AWS Fargate</title><link>https://zackblog.work/posts/serverless-with-aws-fargate/</link><pubDate>Wed, 10 Jul 2024 04:11:38 +0000</pubDate><guid>https://zackblog.work/posts/serverless-with-aws-fargate/</guid><description>&lt;p&gt;&amp;lsquo;if people tend to move to serverless, how &amp;lsquo;infrastructure engineer&amp;rsquo; will end up&amp;rsquo;
&lt;strong&gt;Why go serverless&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some of the company&amp;rsquo;s applications recently moved from Rancher to Fargate, which is understandable as the cloud resource and traffic will be very intensive only during a certain period (HSC exam), hence AWS serverless with Fargate can be a better option for such business mode so the rest of the year without the exam we can save costs significantly.&lt;/p&gt;</description></item><item><title>Handling a RDS MySQL cluster CPU 100%</title><link>https://zackblog.work/posts/handling-a-rds-mysql-cluster-cpu-100/</link><pubDate>Mon, 17 Jun 2024 04:10:51 +0000</pubDate><guid>https://zackblog.work/posts/handling-a-rds-mysql-cluster-cpu-100/</guid><description>&lt;p&gt;Today I got a performance issue from our analytic team, saying they experienced a Production MySQL cluster running on RDS very slow since yesterday morning.&lt;/p&gt;
&lt;p&gt;I started to look into below areas for investigation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AWS CloudWatch Metrics for RDS&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AWS CloudWatch provides a wide range of metrics that can help diagnose resource usage for databases. So I started with:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;CloudWatch - Metrics - All metrics - Add query - RDS - Top 10 RDS instances by highest CPU utilization&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Automate AMI patching with Lambda and Cloudformation</title><link>https://zackblog.work/posts/automate-ami-patching-with-lambda-and-cloudformation/</link><pubDate>Thu, 01 Feb 2024 03:14:05 +0000</pubDate><guid>https://zackblog.work/posts/automate-ami-patching-with-lambda-and-cloudformation/</guid><description>&lt;p&gt;The application team managing Rancher clusters in AWS EC2 faced a compliance challenge with their Rancher node template golden AMI. To meet security and compliance requirements, they needed to ensure that this AMI is patched regularly with the latest updates. This process had to be automated to guarantee that a newly patched AMI is available every month.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overview of workflow with Lambda and Cloudformation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I developed this CloudFormation template to set up an automated process for patching Amazon Machine Images (AMIs) on a monthly schedule using AWS services such as Lambda, EventBridge, SNS, and Parameter Store. Here&amp;rsquo;s a workflow by design:&lt;/p&gt;</description></item><item><title>ZackBlog AWS Serverless webhosting</title><link>https://zackblog.work/posts/zackblog-aws-serverless-webhosting/</link><pubDate>Sun, 30 Apr 2023 03:02:02 +0000</pubDate><guid>https://zackblog.work/posts/zackblog-aws-serverless-webhosting/</guid><description>&lt;p&gt;In this article, I will see how to host &amp;ldquo;zackweb&amp;rdquo; as a static web application using the following AWS serverless options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;S3 static webhosting&lt;/li&gt;
&lt;li&gt;AWS CDK + CloudFront&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add one more step in the existing Github Action workflow to copy the static web content to the newly created S3 bucket&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# edit github action workflow&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aws s3 cp ~/zack-gitops-project/zack_blog/_site/* s3://zackweb-serverless/ --recursive
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# validate content in s3 bucket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ubuntu@ip-172-31-26-78:~$ aws s3 ls s3://zackweb-serverless --summarize
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE aboutme/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE assets/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE certificate/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE gitrepo/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE jekyll/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE pro/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; PRE skillroadmap/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-07-30 14:55:05 &lt;span class="m"&gt;4455&lt;/span&gt; 404.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-07-30 14:55:05 &lt;span class="m"&gt;504&lt;/span&gt; Dockerfile
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-07-30 14:55:06 &lt;span class="m"&gt;80555&lt;/span&gt; feed.xml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-07-30 14:55:06 &lt;span class="m"&gt;7760&lt;/span&gt; index.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023-07-30 14:55:06 &lt;span class="m"&gt;0&lt;/span&gt; nginx.conf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Total Objects: &lt;span class="m"&gt;5&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Total Size: &lt;span class="m"&gt;93274&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Option 1: S3 static webhosting&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Enable Free SSL certificate for blog</title><link>https://zackblog.work/posts/enable-free-ssl-certificate-for-blog/</link><pubDate>Tue, 07 Feb 2023 23:28:37 +0000</pubDate><guid>https://zackblog.work/posts/enable-free-ssl-certificate-for-blog/</guid><description>&lt;p&gt;An interviewer told me this blog is insecure!!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Generate free SSL certificate from &lt;a href="https://zerossl.com/" target="_blank" rel="noopener noreferrer"&gt;https://zerossl.com/&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Validate the Certificate with Private Key via &lt;a href="https://www.sslshopper.com/certificate-key-matcher.html" target="_blank" rel="noopener noreferrer"&gt;https://www.sslshopper.com/certificate-key-matcher.html&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Upload &amp;lsquo;certificate.crt&amp;rsquo; and &amp;lsquo;private.key&amp;rsquo; to web server &lt;code&gt;/etc/nginx/ssl/&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setting up NGINX HTTPS Server by including the &lt;code&gt;ssl&lt;/code&gt; parameter to the listen directive in the server block under &amp;lsquo;http&amp;rsquo; in &amp;rsquo;nginx.conf&amp;rsquo;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;http {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; server {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; listen 443 ssl;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; server_name zackdevops.online;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ssl_certificate /etc/nginx/ssl/certificate.crt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ssl_certificate_key /etc/nginx/ssl/private.key;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Fix 2 errors:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023/02/07 10:29:33 [emerg] 73175#73175: &amp;#34;server&amp;#34; directive is not allowed here in /etc/nginx/nginx.conf:11
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023/02/07 10:30:25 [error] 73207#73207: *1 directory index of &amp;#34;/usr/share/nginx/html/&amp;#34; is forbidden,client: 163.53.144.82, server: zackdevops.online, request: &amp;#34;GET / HTTP/1.1&amp;#34;, host: &amp;#34;zackdevops.online&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2023/02/07 10:30:36 [error] 73207#73207: *1 directory index of &amp;#34;/usr/share/nginx/html/&amp;#34; is forbidden, client: 163.53.144.82, server: zackdevops.online, request: &amp;#34;GET / HTTP/1.1&amp;#34;, host: &amp;#34;zackdevops.online&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Bingo! &lt;a href="https://zackdevops.online" target="_blank" rel="noopener noreferrer"&gt;https://zackdevops.online&lt;/a&gt; connection is secure!&lt;/p&gt;</description></item></channel></rss>