<?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"><channel><title><![CDATA[CloudCubes by Jinesh]]></title><description><![CDATA[Cloud Infrastructure Consultant  
Find me here :  jineshkumar.bio.link]]></description><link>https://blog.jineshkumar.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1659752811994/nv823zgQG.PNG</url><title>CloudCubes by Jinesh</title><link>https://blog.jineshkumar.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 12:15:41 GMT</lastBuildDate><atom:link href="https://blog.jineshkumar.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Agent Plugins for AWS]]></title><description><![CDATA[Let's imagine a developer has just finished building an Express.js API. It works perfectly on their laptop. Endpoints respond, data flows, everything looks solid. Now comes the hard part: getting it o]]></description><link>https://blog.jineshkumar.com/agent-plugins-for-aws</link><guid isPermaLink="true">https://blog.jineshkumar.com/agent-plugins-for-aws</guid><category><![CDATA[AWS]]></category><category><![CDATA[AgentPlugins]]></category><category><![CDATA[agent-plugins]]></category><category><![CDATA[AWSAgentPlugins]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[Devops]]></category><category><![CDATA[#InfrastructureAsCode]]></category><category><![CDATA[cursor]]></category><category><![CDATA[CloudEngineer]]></category><category><![CDATA[claude-code]]></category><category><![CDATA[appdeployment]]></category><category><![CDATA[AWSDevops]]></category><category><![CDATA[AIDevOps]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sun, 18 May 2025 14:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/9a81240b-8ae6-4713-8362-23694b172599.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's imagine a developer has just finished building an Express.js API. It works perfectly on their laptop. Endpoints respond, data flows, everything looks solid. Now comes the hard part: <strong>getting it onto AWS.</strong></p>
<p>What should be simple quickly turns into friction, which raises Cloud/DevOps's Teams tasks with<br />• Choosing the right infrastructure between ECS, App Runner, or EC2<br />• Setting up IAM roles and networking<br />• Estimating costs in spreadsheets and rightsizing as per requirements<br />• Figuring out and writing CloudFormation, Terraform, or CDK modules before a feature reaches users.</p>
<p>In February 2026, AWS introduced <strong>Agent Plugins for AWS</strong>: a new way to let AI coding assistants like <strong>Claude Code</strong> and <strong>Cursor</strong> take over the heavy lifting of cloud deployment.</p>
<p>Instead of stitching everything together manually, you can now simply say:</p>
<blockquote>
<p><em>“Deploy this app to AWS.”</em></p>
</blockquote>
<p>From there, the Agent Plugin will,<br />• Understands your codebase<br />• Recommends the right AWS services<br />• Estimates cost before deployment<br />• Generates infrastructure-as-code<br />• And executes the deployment</p>
<p>All through a single, natural language interaction.</p>
<blockquote>
<p><em>The Bigger Shift</em></p>
<ul>
<li><p><em>What we’re witnessing isn’t just a new tool, it’s a fundamental shift.</em></p>
</li>
<li><p><em>The long-standing gap between “writing code” and “running code in the cloud” is collapsing in real time.</em></p>
</li>
<li><p><em>Agent Plugins don’t just reduce friction, they redefine the workflow.</em></p>
</li>
<li><p><em>And for DevOps Team and Cloud architects, this changes everything.</em></p>
</li>
</ul>
</blockquote>
<h2><strong>What exactly are AWS agent plugins?</strong></h2>
<p>Think of agent plugins as <em>skill packs for your AI coding assistant</em>. Your AI agent is smart, but it doesn't natively know the best AWS service for your specific app, the current price of App Runner per vCPU-hour, or the CDK pattern for a containerized Node backend with RDS.</p>
<p>An agent plugin bundles all that domain expertise into a reusable, versioned package. If your AI agent is a brilliant but generalist contractor, agent plugins are the <em>specialist subcontractors</em> they can now call on. The AWS plugin is your cloud architect on speed dial, available instantly, always up to date, and it never charges by the hour.</p>
<p>When you install the deploy-on-aws plugin, your coding agent gains:<br /><strong>Agent Skills</strong>: Structured deployment workflows and best practices<br /><strong>MCP Servers</strong>: Live AWS documentation, pricing, and IaC guidance<br /><strong>Hooks</strong>: Guardrails and automated validations<br /><strong>References</strong>: Configuration defaults and curated knowledge</p>
<h3><strong>Evolution of Deployments before and after Agent Plugin</strong></h3>
<table style="width:785px"><colgroup><col style="width:163px"></col><col style="width:291px"></col><col style="width:331px"></col></colgroup><tbody><tr><td><p><strong>Feature</strong></p></td><td><p><strong>Traditional Deployment</strong></p></td><td><p><strong>Agent Plugins for AWS</strong></p></td></tr><tr><td><p><strong>Research</strong></p></td><td><p>Hours of documentation deep-dives</p></td><td><p><strong>Instant</strong> architecture recommendations</p></td></tr><tr><td><p><strong>Cost Estimation</strong></p></td><td><p>Manual, error-prone spreadsheets</p></td><td><p><strong>Real-time</strong> pricing via MCP server</p></td></tr><tr><td><p><strong>Infrastructure</strong></p></td><td><p>Handwriting CloudFormation / Terraform YAML</p></td><td><p><strong>Auto-generated</strong> CDK , Terraform Modules</p></td></tr><tr><td><p><strong>Prompting</strong></p></td><td><p>Repeated context-pasting &amp; manual input</p></td><td><p><strong>Versioned skills</strong> with zero prompt bloat</p></td></tr><tr><td><p><strong>Expertise</strong></p></td><td><p>Senior DevOps knowledge required</p></td><td><p><strong>AWS best practices</strong> baked in</p></td></tr></tbody></table>

<p>Beyond individual productivity, this matters at the <strong>team level</strong>. Instead of every engineer independently pasting AWS guidance into prompts (with wildly different results), teams can standardize on shared plugins that encode approved patterns, security posture, and cost guardrails. Deterministic and dependency at scale, that's what architects really want.</p>
<h2><strong>Architecture breakdown: how it actually works</strong></h2>
<p>Here's the end-to-end flow</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/aa4bed35-9865-41ab-8b2a-2d883afe2098.png" alt="" style="display:block;margin:0 auto" />

<p>The three MCP servers powering the initial release do different jobs:</p>
<table style="min-width:50px"><colgroup><col style="min-width:25px"></col><col style="min-width:25px"></col></colgroup><tbody><tr><td><p><strong>MCP Server</strong></p></td><td><p><strong>What it contributes</strong></p></td></tr><tr><td><p><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">AWS Knowledge</mark></strong></p></td><td><p>Architecture guidance, service docs, and best practices</p></td></tr><tr><td><p><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">AWS Pricing</mark></strong></p></td><td><p>Real-time cost estimates before you commit</p></td></tr><tr><td><p><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">AWS IaC</mark></strong></p></td><td><p>CDK and CloudFormation patterns and generation</p></td></tr></tbody></table>

<h2><strong>Hands-on walkthrough: from zero to deployed</strong></h2>
<p>Let's get practical. Here's how to go from nothing to a deployed Express.js + React + PostgreSQL app on AWS using the <code>deploy-on-aws</code> plugin.</p>
<p><strong>Step 1 Prerequisites</strong><br />Before installing, confirm you have:</p>
<blockquote>
<p><code>Verify AWS CLI is configured $ aws sts get-caller-identity</code></p>
</blockquote>
<blockquote>
<p><code>Confirm Claude Code or Cursor is installed</code><br /><code>$ claude --version</code></p>
</blockquote>
<p><strong>Step 2: Install the plugin</strong></p>
<p>In <strong>Claude Code</strong>:</p>
<blockquote>
<p><code>\( /plugin marketplace add awslabs/agent-plugins \) /plugin install deploy-on-aws@awslabs-agent-plugins</code></p>
</blockquote>
<p>In <strong>Cursor</strong>:<br />Open Settings → Plugins → search "aws" → click <em>Add to Cursor</em>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/1bb67637-6d99-4d96-9252-bf75e25cfff2.png" alt="" style="display:block;margin:0 auto" />

<hr />
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/1c993e25-eaf1-4135-a7f3-a65b5aca7cb7.png" alt="" style="display:block;margin:0 auto" />

<p>There are other AWS Plugins available in <strong>Cursor</strong> to explore and use</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/2236445b-9b45-4180-8904-17d4e87faac3.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Pro tip:</strong> Follow the principle of least privilege when configuring your AWS credentials. Create a scoped IAM role for the agent rather than using your root or admin credentials.</p>
<p><strong>Step 3: The magic prompt</strong></p>
<p>Open your project in Claude Code or <strong>Cursor</strong> and type:</p>
<blockquote>
<p><code>Deploy this Express app to AWS</code></p>
</blockquote>
<p><strong>Step 4: Watch the 5-step flow execute</strong></p>
<p><strong>1 Analyze:</strong> Scans codebase: identifies Express.js, Node 20.x, PostgreSQL dependency, React build, env vars, expected traffic.</p>
<p><strong>2 Recommend:</strong> Selects: App Runner (backend), RDS PostgreSQL (database), CloudFront + S3 (React frontend), Secrets Manager (credentials). With rationale for each choice.</p>
<p><strong>3 Estimate:</strong> Shows live monthly cost breakdown using real AWS pricing. You see the number <em>before</em> anything is provisioned.</p>
<p><strong>4 Generate:</strong> Produces CDK TypeScript, Dockerfile, migration scripts, env config, and a GitHub Actions CI/CD pipeline.</p>
<p><strong>5 Deploy:</strong> On your confirmation, provisions all resources, deploys the container, sets up CloudFront, stores secrets, and hands you URLs + CloudWatch dashboard links.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/cafc8436-b942-480c-82b7-efe1a11115f5.png" alt="" style="display:block;margin:0 auto" />

<h3><strong>Real-world use cases beyond "deploying an app"</strong></h3>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/ef01c6f6-160d-4dd6-99cf-9210ef5c51ca.png" alt="" style="display:block;margin:0 auto" />

<h3><strong>Architect-level perspective: where does this fit?</strong></h3>
<p>Comparing Agent Plugins against the existing IaC ecosystem is a fair question. Here's how I think about it:</p>
<p><strong>AWS Deployment Methodology Comparison</strong></p>
<table style="min-width:284px"><colgroup><col style="min-width:25px"></col><col style="width:141px"></col><col style="width:93px"></col><col style="min-width:25px"></col></colgroup><tbody><tr><td><p><strong>Tool</strong></p></td><td><p><strong>Best for</strong></p></td><td><p><strong>Learning Curve</strong></p></td><td><p><strong>Control Level</strong></p></td></tr><tr><td><p><strong>Agent Plugins</strong></p></td><td><p>Speed &amp; onboarding</p></td><td><p><strong>Near zero</strong></p></td><td><p>Medium (review required)</p></td></tr><tr><td><p><strong>AWS CDK</strong></p></td><td><p>Infrastructure at scale</p></td><td><p>Medium</p></td><td><p><strong>High</strong></p></td></tr><tr><td><p><strong>Terraform</strong></p></td><td><p>Multi-cloud, enterprise IaC</p></td><td><p>High</p></td><td><p><strong>Very high</strong></p></td></tr><tr><td><p><strong>Manual Console</strong></p></td><td><p>one-off tasks</p></td><td><p>Low</p></td><td><p>Full (but error-prone)</p></td></tr></tbody></table>

<p>Agent Plugins are not a Terraform replacement. They're best understood as a fast entry point. Use them to go from idea to running infrastructure quickly, then promote the generated CDK code into your standard IaC pipeline for ongoing management. Hybrid workflows will dominate.</p>
<blockquote>
<p>Think of agent plugin output as a <em>starting point</em>, not a final commit. Run the generated CDK through your security scanning tools (Checkov, cfn-nag) and have a senior engineer review before merging to production. The plugin accelerates; human judgment validates.</p>
</blockquote>
<h2><strong>Limitations and Pitfalls to watch out for</strong></h2>
<p><strong>Important:</strong> AI-generated infrastructure outputs should always be reviewed before deployment against your security requirements, cost constraints, and resilience targets. The plugin is an accelerator, not an authority.</p>
<p>1. <strong>Blind trust in AI recommendations</strong>. The agent picks a reasonable default architecture, but it doesn't know your organization's compliance requirements, existing VPC setup, or Reserved Instance commitments. Always contextualize.</p>
<p>2. <strong>Skipping the cost estimate review.</strong> The plugin shows you estimated costs. Please actually read them. A misconfigured RDS Multi-AZ instance for a side project can be a nasty surprise.</p>
<p>3. <strong>No cost monitoring after deployment.</strong> Set up AWS Budgets alerts on day one. AI-deployed infrastructure is real infrastructure; billing doesn't care how it got there.</p>
<p>4. <strong>Deploying with over-privileged IAM credentials.</strong> Use a scoped IAM role with only the permissions the deployment actually needs. Least privilege always.</p>
<h3>To Summarise</h3>
<p>AWS is shipping more agent plugins in the coming weeks the <code>deploy-on-aws</code> is just the start. Think about what a full ecosystem looks like: <strong>plugins for cost optimization</strong>, <strong>security auditing</strong>, <strong>incident response</strong>, <strong>database tuning</strong>, and <strong>multi-region failover</strong>.</p>
<p>In two to three years, I expect <strong>"AI as DevOps co-pilot"</strong> to be the norm in Infrastructure engineering, not the exception. The interesting question isn't whether AI will write more infrastructure code, it's what the new high-value human skills will become.</p>
<p>Agent Plugins for AWS don't replace cloud architects, they give every developer on your team a cloud architect's first draft. What you do with that draft is still up to you.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding AWS Storage Gateway: A Practical Guide to Hybrid Cloud Storage]]></title><description><![CDATA[AWS Storage Gateway bridges your on-premises infrastructure with Amazon's cloud storage — letting you use familiar protocols like NFS, SMB, and iSCSI while your data lives safely in S3, EBS, or Glacie]]></description><link>https://blog.jineshkumar.com/understanding-aws-storage-gateway-a-practical-guide-to-hybrid-cloud-storage</link><guid isPermaLink="true">https://blog.jineshkumar.com/understanding-aws-storage-gateway-a-practical-guide-to-hybrid-cloud-storage</guid><category><![CDATA[AWS Storage gateway]]></category><category><![CDATA[FileGateway]]></category><category><![CDATA[Nfs]]></category><category><![CDATA[SMB]]></category><category><![CDATA[ebs]]></category><category><![CDATA[AWS s3 Glacier]]></category><category><![CDATA[HybridStorage]]></category><category><![CDATA[LearnAWS]]></category><category><![CDATA[AWSCommunity]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Mon, 14 Apr 2025 13:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/dcc99222-55fc-466e-ad16-9e8f2f54a95a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><em>AWS Storage Gateway bridges your on-premises infrastructure with Amazon's cloud storage — letting you use familiar protocols like NFS, SMB, and iSCSI while your data lives safely in S3, EBS, or Glacier.</em></p>
</blockquote>
<h2><strong>What Is AWS Storage Gateway?</strong></h2>
<p>AWS Storage Gateway is a hybrid storage solution that acts as a bridge that lets you use Amazon S3, Glacier, and EBS storage from your local servers and applications without completely overhauling your existing setup. Your On-Prem servers speak traditional storage protocols, and the gateway quietly converts those requests into AWS API calls for accessing stored data in S3, Glacier, or EBS. It connects your on-site physical or virtual machines to nearly unlimited cloud storage in AWS. It supports popular storage classes, <strong>including S3 Standard, S3 Infrequent Access, S3 Glacier, and Glacier Deep Archive</strong>. Because it must communicate with AWS in real time, a stable internet connection is required.</p>
<p>In today’s hybrid IT environments, many organizations need a smooth way to connect their on-premises infrastructure with scalable cloud storage. AWS Storage Gateway serves exactly this purpose.</p>
<hr />
<h2><strong>Types of Storage Gateway</strong></h2>
<p>Three distinct gateway types, each designed for a different storage use case:</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/ecdd4f22-600d-4f60-b7c0-539fa65b9d33.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/15c60e12-fd7b-4244-9e76-edba6b822423.png" alt="" style="display:block;margin:0 auto" />

<h3><strong>File Gateway</strong></h3>
<p>The File Gateway exposes S3 buckets as NFS (v3 / 4.1) or SMB (v2 / v3) shares. Your operating system sees a normal network drive; under the hood, every file becomes an S3 object.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/9756df2e-5b89-4d7a-b38a-ff4f36fdf57d.png" alt="" style="display:block;margin:0 auto" />

<blockquote>
<p><strong>Multi-site sharing:</strong> Deploy one File Gateway VM in Data Center 1 and another in Data Center 2, both pointing at the same S3 bucket. A file uploaded from DC1 becomes visible in DC2 after the <code>RefreshCache</code> API call kicks off a re-inventory on the second gateway.</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/24198d36-4bed-45dd-b0bb-49353d126441.png" alt="" style="display:block;margin:0 auto" />

<p>File Gateway This is the most commonly used option for file-based workloads. It allows you to mount Amazon S3 buckets as standard network file shares using NFS (versions 3 and 4.1) or SMB (versions 2 and 3) protocols. When files are written to the share, they are stored as individual objects in S3. Features like object versioning automatically create new versions when files are modified, deleted, or renamed. This gateway is ideal for file servers, application data, and any scenario where you want to treat cloud storage like a local network drive.</p>
<h3><strong>Volume Gateway</strong></h3>
<p>The Volume Gateway works with iSCSI the protocol that makes a remote disk feel local. Your servers mount volumes just like physical hard drives, but storage lives in AWS. If your applications require block-level storage, Volume Gateway is the right choice. It presents storage volumes to your servers over the iSCSI protocol.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/eaeeb834-982e-438e-bd04-73d11f617d61.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Stored Volumes</strong>: Your local disk is the primary storage (low latency reads/writes), and data is asynchronously backed up to S3 as EBS snapshots. All primary data stays on your local disks, while AWS takes asynchronous point-in-time snapshots to S3 (as EBS snapshots). This provides low-latency local access with cloud backup. Volumes range from 1 TB to 16 TB.</p>
<p><strong>Cached Volumes</strong>: S3 is the primary storage. Only frequently-accessed data is cached locally on fast EBS volumes, while the full dataset resides in S3. This is the more cost-effective option since S3 pricing is lower than EBS. Maximum size per volume: 32 TB. This approach helps reduce on-premises storage costs significantly.</p>
<p>Volume Gateway is popular for databases, ERP systems, and other applications that traditionally use SAN storage.</p>
<h3><strong>Tape Gateway</strong></h3>
<p>For enterprises running tape-based backup workflows, Tape Gateway is a drop-in replacement. It presents a <strong>virtual tape library (VTL)</strong> over iSCSI — your existing backup software (Veeam, Veritas, etc.) keeps working unchanged, but instead of physical tapes going into a shelf, data flows directly into S3 Glacier or S3 Glacier Deep Archive.</p>
<p>This approach removes the cost and operational burden of physical tape hardware while preserving your existing backup schedule, retention policies, and tooling.</p>
<p>Tape Gateway Designed for organizations with existing tape-based backup processes. Tape Gateway emulates a virtual tape library. It connects via iSCSI and stores virtual tapes in S3 Glacier or Glacier Deep Archive for long-term, low-cost retention. This option allows companies to retire physical tape hardware while keeping their current backup software and workflows almost unchanged.</p>
<hr />
<h2>How AWS Storage Gateway Works ?</h2>
<p>The core of the solution is a lightweight Storage Gateway Appliance. A virtual machine you deploy in your environment.</p>
<p>Here’s the basic data flow:</p>
<ul>
<li><p>You install and activate the gateway appliance (either as a VM or hardware appliance).</p>
</li>
<li><p>The appliance creates a local cache (minimum recommended size is around 150 GB) to store recently used or frequently accessed data for fast performance. When applications write data, it first goes to the local cache. The gateway then asynchronously uploads the data to the appropriate AWS service (S3 for files/objects, EBS snapshots for volumes, or Glacier for tapes).</p>
</li>
<li><p>For File Gateway, you can use the RefreshCache operation to ensure all gateways see the latest files when working in multi-gateway setups. This caching mechanism delivers low latency for active data while leveraging the durability and scalability of AWS cloud storage.</p>
</li>
</ul>
<hr />
<h2><strong>Pricing</strong></h2>
<p>AWS Storage Gateway follows the standard AWS <strong>pay-as-you-go</strong> model. Costs depend on:</p>
<ul>
<li><p><strong>Gateway usage</strong> — charged per gateway per month</p>
</li>
<li><p><strong>S3 storage</strong> — depends on storage class chosen and number of requests, billed per GB/month</p>
</li>
<li><p><strong>EBS snapshots</strong> — charged per GB for any snapshots taken from Volume Gateway</p>
</li>
<li><p><strong>AWS Region</strong> — pricing varies by geographic region</p>
</li>
</ul>
<p>The most cost-effective approach for infrequently accessed data is pairing File Gateway with <strong>S3 Infrequent Access</strong> or Glacier storage classes. Always check the <a href="https://aws.amazon.com/storagegateway/pricing/">official AWS pricing page</a> for current rates.</p>
<hr />
<h3>Deployment Options: <strong>Supported Host Platforms</strong></h3>
<p>Storage Gateway is delivered as a <strong>virtual appliance (OVA image)</strong> that you deploy on your existing hypervisor. No new hardware needed in most cases.</p>
<ol>
<li><p><strong>Virtual Appliance:</strong> Download the OVA template and run it on Supported platforms: VMware ESXi<br />Microsoft Hyper-V (2012 R2+)<br />Linux KVM<br />Amazon EC2</p>
</li>
<li><p><strong>Hardware Appliance:</strong> AWS offers a pre-configured physical device for environments where virtualization isn’t preferred.</p>
</li>
</ol>
<p>Recommended resources for the VM include at least 16 GB RAM and 4 vCPUs, plus dedicated disks for the cache and upload buffer.</p>
<hr />
<h2><strong>Advantages of AWS Storage Gateway</strong></h2>
<ul>
<li><p><strong>Zero hardware changes.</strong> Your existing servers, applications, and storage protocols continue working exactly as before. Support for existing protocols (NFS, SMB, iSCSI)</p>
</li>
<li><p><strong>True hybrid storage.</strong> On-premises and cloud storage connects seamlessly. no forklift upgrades or migration required.</p>
</li>
<li><p><strong>Smooth cloud migration path.</strong> Start with a gateway, gradually shift workloads to AWS at your own pace. Simplified data migration to AWS.</p>
</li>
<li><p>Built-in data protection through snapshots, versioning, and disaster recovery.</p>
</li>
<li><p>Cost optimization by moving cold data to cheaper storage classes</p>
</li>
</ul>
<hr />
<h2><strong>How to Deploy AWS Storage Gateway</strong></h2>
<p>The walkthrough below covers setting up a <strong>File Gateway on VMware ESXi</strong> and connecting an Ubuntu Linux machine to an S3 bucket over NFS. You'll need an AWS account and an ESXi host.</p>
<h3><strong>Step 1 — Download the VM Image</strong></h3>
<p>In the AWS Console, navigate to <strong>Services → Storage Gateway → Create Gateway</strong>.</p>
<p>1</p>
<p>2</p>
<p>The Create Gateway wizard opens. On step 1, choose <strong>File Gateway</strong>.</p>
<p>1</p>
<p>On the next step, select <strong>VMware ESXi</strong> as the host platform, then click <strong>Download image</strong>. The file will be named something like <code>aws-storage-gateway-latest.ova</code>. Keep the browser tab open — you will return to finish activation later.</p>
<p>1</p>
<h3><strong>Step 2 — Deploy the Virtual Appliance on ESXi</strong></h3>
<p>In VMware vSphere Client, right-click your ESXi host and choose <strong>Actions → Deploy OVF Template</strong>.</p>
<p><strong>Minimum requirements for File Gateway:</strong> 16 GB RAM · 4 vCPUs · one 80 GB disk (OS) · one additional 150 GB disk (cache)</p>
<ol>
<li><p><strong>Select OVF template.</strong> Choose "Local file" and browse to your downloaded <code>.ova</code> file.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/801a478d-adf2-4c87-8aac-207fbe2fa05e.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/20253aa6-a00d-4fe0-9fcc-0ebf32bcb4d4.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Name and folder.</strong> Give the VM a descriptive name (e.g. <code>aws-storage-gateway</code>) and pick a vCenter inventory folder.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/cd24c8db-c5a7-4c20-89d8-ef8a57b1af9f.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Compute resource.</strong> Select the ESXi host with enough free CPU and RAM.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/1e8da359-3e64-4e22-bfbc-428d393d8f06.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Review details.</strong> Verify the template configuration before proceeding.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/5398eda4-fc04-405c-b2b0-8682dec0f830.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Select storage.</strong> Pick a datastore with sufficient space. Use <strong>Thick Provisioned</strong> format for the virtual disk for best performance.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/04756efe-80bb-4efd-91b2-4239a4cf3eaa.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Select networks.</strong> Attach the VM to a vSwitch connected to the internet.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/84286b22-a0e8-4810-9395-55f466dbabc4.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Ready to complete.</strong> Review everything and hit Finish.<br />Wait until the Storage Gateway VM is deployed from the template. You can see the job status in the <em>Recent Tasks</em> toolbar in vSphere Client.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/c3cc0a8e-a15c-469f-8e60-9d24b9df627f.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p>Once the VM is deployed, you can see the VM name you have defined before in the list of VMs of the appropriate ESXi host (<em>10.10.10.90</em> in our case).<br />Right click the VM (<em>aws-storage-gateway</em> is the name of the Storage Gateway VM deployed from the template in this example) and in the context menu hit <code>Edit Settings</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/b443329b-a2d4-4ab6-8d5f-f56d5816765e.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p>Add a new virtual hard disk for cache(<strong>150 GB cache disk)</strong>.<br />This virtual disk is used to store recently accessed files and files that are accessed frequently to reduce latency when accessing that data.<br />After deployment, right-click the VM → <strong>Edit Settings → Add New Device → Hard Disk</strong>. Set the size to 150 GB with <strong>Thick Provisioning</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/d67b723c-5496-42cf-93bd-8d71fd9b024f.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/172622d2-0bc6-4e68-9374-ae50833c20b4.png" alt="" style="display:block;margin:0 auto" />

<p>Make sure that time is set correctly on the Storage Gateway VM, ESXi hosts, and vCenter servers. Time on the VM must be synchronized to avoid issues and for successful gateway activation.<br />click <code>Edit Settings</code> &gt; <em>VM Options &gt;</em> VMware Tools &gt; <code>Synchronize guest time with host</code>” checkbox. Hit <code>OK</code> to save settings.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/63db50ef-7446-49e3-8c68-0821678c7ca8.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p><strong>Testing network connectivity</strong></p>
</li>
</ol>
<p>It is recommended to test the network connection of the Amazon Storage Gateway running as a VM locally with AWS cloud storage.<br />Power on the Storage Gateway VM &gt; Log into the AWS Appliance VM by using the default credentials.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/c9b2e62a-56cb-4dc5-8ae2-fd3604c83252.png" alt="" style="display:block;margin:0 auto" />

<p>Enter the IP address of the VM (the Storage Gateway virtual appliance), not the external (WAN) IP of your router.</p>
<p>Click <code>Connect to gateway</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/5c8642b0-1141-4c1d-8a02-088fee61fb95.png" alt="" style="display:block;margin:0 auto" />

<ol>
<li><code>Activate gateway.</code> Activation of the gateway securely associates your gateway with your AWS account.<br />Select the gateway time zone. Enter the gateway name, for example Storage Gateway AWS.<br />- The name can be different from the name of the VM and the DNS name of the VM (appliance).<br />- Remember that TCP 80 port must be opened on the gateway VM.</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/91f00581-79ff-4eb2-ae2b-79d1a595cd0b.png" alt="" style="display:block;margin:0 auto" />

<p>Click <code>Activate gateway</code> and wait until the cache disks are identified.</p>
<p><code>Configure local disks.</code> Ensure that your 150-GB virtual disk is allocated to cache. Then hit <code>Configure logging</code>.</p>
<p><a href="https://www.nakivo.com/blog/wp-content/uploads/2020/06/Gateway-storage-is-now-active.webp"><img src="https://www.nakivo.com/blog/wp-content/uploads/2020/06/Gateway-storage-is-now-active.webp" alt="Gateway storage is now active" style="display:block;margin:0 auto" /></a></p>
<p>Now the File Gateway has been successfully created and it is running.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/c8f156e6-5f98-4a24-9755-e86476d05660.png" alt="" style="display:block;margin:0 auto" />

<h3><strong>Creating a file share</strong></h3>
<p>It’s time to create a file share in order to connect to a bucket by using standard NFS or SMB (CIFS) protocols. Let’s configure the connection to an Amazon S3 bucket via NFS.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/46ec9d71-25ef-4fb6-925d-8bd3937fc3d7.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/e6e5e4c8-9899-4830-8804-f8ec0651d741.png" alt="" style="display:block;margin:0 auto" />

<p><em>Squash level</em>. Click <code>Edit</code> in the <em>Mount options</em> and select <code>All squash</code> to make sure that everything will work properly.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/f3b9ee2d-0fd4-4d0b-aa55-a3620e9d6b5a.png" alt="" style="display:block;margin:0 auto" />

<p>The NFS file share is created on your file gateway.</p>
<hr />
<h2>Conclusion</h2>
<p>AWS Storage Gateway removes the friction between traditional on-premises infrastructure and the AWS cloud. Rather than rebuilding your storage architecture from scratch, you can continue using the protocols your systems already rely on — NFS and SMB for file-level access to S3, iSCSI for block-level access to EBS volumes, and virtual tape libraries as a seamless replacement for physical tape hardware.</p>
<p>This guide walked through the core concepts behind each gateway type and demonstrated a complete File Gateway deployment on VMware ESXi, culminating in a live NFS connection from Ubuntu Linux to an Amazon S3 bucket.</p>
<p>Beyond manual file transfers, Storage Gateway fits naturally into any backup strategy. Because it exposes standard NFS, SMB, and iSCSI interfaces, virtually any backup tool can use it as a target — giving organizations a straightforward path to offloading backup data to AWS without changing their existing workflows.</p>
]]></content:encoded></item><item><title><![CDATA[AZ-104: Manage Azure Identities and Governance — Complete Study Guide for Microsoft Azure Administrators]]></title><description><![CDATA[This AZ-104 domain emphasizes secure identity management and efficient resource governance, which are essential for Azure administrators to ensure compliance and cost control.
Overview of Azure Identi]]></description><link>https://blog.jineshkumar.com/managing-azure-identities-governance</link><guid isPermaLink="true">https://blog.jineshkumar.com/managing-azure-identities-governance</guid><category><![CDATA[Azure]]></category><category><![CDATA[az-104]]></category><category><![CDATA[microsoft-entra-id]]></category><category><![CDATA[rbac]]></category><category><![CDATA[Azure Policy]]></category><category><![CDATA[Certification]]></category><category><![CDATA[Azure administrator]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Wed, 12 Mar 2025 13:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/34fc0860-0e2c-4be4-9088-87d8e9035921.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This AZ-104 domain emphasizes secure identity management and efficient resource governance, which are essential for Azure administrators to ensure compliance and cost control.</p>
<h2>Overview of Azure Identities and Governance</h2>
<p>Microsoft Entra ID Users and Groups</p>
<p>Microsoft Entra ID (formerly Azure AD) provides cloud-based identity services for managing users and groups. Key tasks include creating internal and external users, assigning licenses, and enabling self-service features like password reset to reduce admin overhead.</p>
<p>Access Management with RBAC</p>
<p>Azure Role-Based Access Control (RBAC) allows granular permissions using built-in or custom roles assigned at various scopes, helping interpret and audit access for security.</p>
<p>Subscriptions and Governance Strategies</p>
<p>Tools like Azure Policy, resource locks, tags, and management groups enable the enforcement of standards, cost monitoring, and hierarchical organization across subscriptions</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/d1302754-192c-4044-9323-44f89baa6d11.png" alt="" style="display:block;margin:0 auto" />

<h2>AZ-104: A Comprehensive Guide to Managing Azure Identities and Governance (20-25%)</h2>
<p>This detailed guide explores the core components of the "Manage Azure identities and governance" domain in the <strong>AZ-104 Microsoft Azure Administrator certification</strong>.<br />I will be documenting my learnings and explaining my understanding of each topic, based on hands-on lab experience gained from below,<br /><a href="https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/">https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/</a></p>
<p>This Blog is for Lab 01<br /><a href="https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/Instructions/Labs/LAB_01-Manage_Entra_ID_Identities.html">https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/Instructions/Labs/LAB_01-Manage_Entra_ID_Identities.html</a></p>
<h3><strong>Manage Microsoft Entra users and groups</strong></h3>
<p>Microsoft Entra ID is a cloud-based identity and access management service essential for Azure security. Unlike on-premises Active Directory, it supports tenants (isolated directories), subscriptions (billing boundaries), and users/groups for access control. Administrators can create tenants, add users and groups, and manage roles to control resources on Azure.</p>
<p><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">Create users and groups</mark></strong><br />Creating users and groups is essential for managing access. Users can be internal (member users) or external (guests), and groups consist of security groups for permissions and Microsoft 365 groups for collaboration.</p>
<p>Steps to create a user in the Azure portal:<br />- Navigate to Microsoft Entra ID &gt; Users &gt; New user.<br />- Enter user principal name (e.g., <a href="mailto:user@abcd.com">user@abcd.com</a>), display name, and password.<br />- Add Identity properties &gt; Assign roles or groups &gt; then create.<br />- For bulk creation, go to Entra ID &gt; Users &gt; Bulk Create. Use CSV templates or PowerShell.</p>
<p>Steps to create a group:<br />- Go to Microsoft Entra ID &gt; Groups &gt; New group.<br />- Choose type (Security or Microsoft 365), name, description, and membership<br />type (Assigned, Dynamic User/Device).<br />- Add owners/members, then create.</p>
<p><strong>Best practices:</strong> Use dynamic groups for automatic membership based on attributes (e.g., department=Sales); limit direct user assignments to favor group-based access for scalability. <strong>Example:</strong> Create a "FinanceTeam" security group and add users for RBAC assignments.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage user and group properties</mark><br />Properties include display name, job title, department, and usage location (for licensing). Update via portal, PowerShell, or Azure API.<br />- Select a user/group in Entra ID.<br />- Edit properties section; for groups, manage membership or ownership.</p>
<p><strong>Best practices:</strong> Regularly audit properties for compliance; use bulk updates for large-scale changes.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage licenses in Microsoft Entra ID</mark><br />Licenses enable features like Microsoft 365 or Azure AD Premium. Assign via direct or group-based methods.<br />- Go to Entra ID &gt; Licenses &gt; All products.<br />- Select a product (e.g., Microsoft 365 E5), then assign to users/groups.<br />- For group-based: Create a group, assign licenses to it; members get inherited.</p>
<p><strong>Best practices:</strong> Monitor usage reports to avoid over-licensing; use dynamic groups for auto-assignment based on roles.</p>
<p><strong>Example:</strong> Assign Azure AD P1 licenses to a "SSPR-Enabled" group for self-service features.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage external users</mark><br />External users (B2B guests) collaborate via invitations or self-service sign-up. Configure settings to control access levels, invitations, and domain restrictions.<br />Steps to invite a guest:<br />- In Entra ID &gt; Users &gt; <strong>New guest user</strong><br />- Enter email, send invitation</p>
<p>Configuration in external collaboration settings:<br />- Guest user access: Limited (default) to restrict directory enumeration.<br />- Invite permissions: Limit to admins or specific roles like Guest Inviter.<br />- Collaboration restrictions: Allow/deny specific domains.</p>
<p><strong>Best practices:</strong> Enable self-service sign-up for apps; use cross-tenant access settings for B2B; audit sign-in logs for security.</p>
<p><strong>Example:</strong> Restrict invitations to @<a href="http://partner.com">partner.com</a> domain for controlled collaboration.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Configure self-service password reset (SSPR)</mark><br />SSPR allows users to reset passwords without admin help, requiring P1/P2 licenses.<br />Step-by-step guide:</p>
<ol>
<li><p>In Entra admin center &gt; Entra ID &gt; Password reset &gt; Properties.</p>
</li>
<li><p>Enable for Selected group (e.g., SSPR-Test-Group).</p>
</li>
<li><p>Set authentication methods (e.g., email, mobile app code; require 2 methods).</p>
</li>
<li><p>Require registration on sign-in; set reconfirmation every 180 days.</p>
</li>
<li><p>Enable notifications for password resets and admin alerts.</p>
</li>
<li><p>Customize helpdesk link (e.g., <a href="mailto:support@contoso.com">support@contoso.com</a>).</p>
</li>
</ol>
<p><strong>Best practices:</strong> Start with pilot group; combine with MFA for security; monitor usage via reports.<br /><strong>Example:</strong> Use incognito browser to register methods at aka.ms/ssprsetup, then reset at aka.ms/sspr.</p>
<img src="https://cdn.hashnode.com/uploads/covers/604d2050cd951c0ca4c00f98/9b18ee46-9e19-4782-9801-c5d1bd1607ac.png" alt="" style="display:block;margin:0 auto" />

<h3><strong>Manage access to Azure resources</strong></h3>
<p>Azure RBAC provides fine-grained access using roles, scopes, and assignments. It integrates with Entra ID principals (users, groups, managed identities).</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage built-in Azure roles</mark><br />Built-in roles like Owner (full access), Contributor (create/manage without access grants), and Reader (view-only). Over 100 roles available; Use custom roles for tailored permissions.</p>
<p><strong>Best practices:</strong> Use least privilege; prefer built-in over custom roles unless needed.</p>
<p><strong>Example:</strong> Virtual Machine Contributor manages VMs but not networks/storage.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Assign roles at different scopes</mark><br />Scopes: Management group, subscription, resource group, resource. Assignments inherit downward.</p>
<p>Steps in portal:<br />- Navigate to resource/scope &gt; Access control (IAM) &gt; Add role assignment.<br />- Select role (e.g., Contributor), members (user/group), and assign.</p>
<p>Via PowerShell:<br /><code>New-AzRoleAssignment -RoleDefinitionName "Contributor" -PrincipalId &lt;ID&gt; -Scope &lt;scope&gt;.</code></p>
<p><strong>Best practices:</strong> Assign at higher scopes for efficiency; use groups for multiple users.</p>
<p><strong>Example:</strong> Assign Reader at subscription for the auditing team.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Interpret access assignments</mark><br />Assignments include principal, role, scope. Effective permissions are additive;<br />use "Check access" in IAM to view access assignments.</p>
<p>Steps:<br />- In IAM &gt; Role assignments, filter by principal/scope.<br />- Use "Deny assignments" tab for explicit denies.</p>
<p><strong>Best practices:</strong> Regularly review with Azure AD access reviews; audit logs for changes.</p>
<table>
<thead>
<tr>
<th>Role</th>
<th>Permissions</th>
<th>Scope Example</th>
</tr>
</thead>
<tbody><tr>
<td>Owner</td>
<td>All actions, including access grants</td>
<td>Subscription-wide</td>
</tr>
<tr>
<td>Contributor</td>
<td>Create/manage resources</td>
<td>Resource group</td>
</tr>
<tr>
<td>Reader</td>
<td>View resources</td>
<td>Individual VM</td>
</tr>
<tr>
<td>Custom</td>
<td>Defined Actions/NotActions</td>
<td>Specific storage account</td>
</tr>
</tbody></table>
<h3><strong>Manage Azure subscriptions and governance</strong></h3>
<p>This section covers tools for organizing, securing, and optimizing subscriptions.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Implement and manage Azure Policy</mark><br />Azure Policy enforces rules via definitions and initiatives. Effects: Audit, Deny, Modify, etc.</p>
<p>Steps to create:</p>
<ol>
<li><p>In portal &gt; Policy &gt; Definitions &gt; New definition (JSON with rules/parameters).</p>
</li>
<li><p>Group into initiative &gt; Assignments &gt; Assign to scope (e.g., subscription).</p>
</li>
<li><p>Remediate non-compliant resources.</p>
</li>
</ol>
<p><strong>Best practices:</strong> Start with Audit; use initiatives for grouped policies; manage as code.</p>
<p><strong>Example:</strong> Deny non-approved VM SKUs Policy.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Configure resource locks</mark><br />Locks prevent Azure Resource delete/modify.<br />Locks Types: <strong>CanNotDelete</strong>, <strong>ReadOnly.</strong></p>
<p>Steps:<br />In resource &gt; Locks &gt; Add (name, type, notes).</p>
<p><strong>Best practices:</strong> Apply at group level; consider data plane impacts.</p>
<p><strong>Example:</strong> Apply CanNotDelete Lock on critical Azure Resources, and Ready-Only Locks to prevent modification.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Apply and manage tags on resources</mark><br />Tags in Azure are <strong>name–value pairs</strong> applied to resources, resource groups, or subscriptions to logically organize assets and support cost management, governance, and operations.<br />- Do <strong>not</strong> affect resource functionality<br />- Tags are inherited from <strong>resource group → resource</strong> (but not vice versa)<br />- Tags integrate directly with <strong>Azure Cost Management</strong>: Filter costs by tag</p>
<p>Steps: Azure resource &gt; Tags &gt; Edit</p>
<p><strong>Best practices:</strong> Enforce Tags via Azure Policy; use Tag based filter for billing reports.<br /><strong>Example:</strong> <code>Key : Value</code> <code>Environment : Production</code>).</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage resource groups(RG)</mark><br />Resource groups in Azure are <strong>logical containers</strong> that hold related resources together for management, governance, and lifecycle control.</p>
<p>Steps to Create and Manage a Resource Group<br />- Portal: Azure Portal → Resource groups → Create<br />- Specify Name, Region, and optional Tags<br />- Delete RG: Deletion requires explicit confirmation. No partial delete RG</p>
<p><strong>Best Practices:</strong><br />- Group resources by lifecycle (app, environment, project)<br />- Apply tags at the resource group level<br />- Use Azure Policy for governance<br />- Avoid mixing unrelated workloads</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage subscriptions</mark><br />Subscriptions in Azure define <strong>billing, access control, and resource limits</strong>.<br />Each subscription is linked to a <strong>billing account</strong>. Resources cannot span multiple subscriptions.<br />- Subscriptions can be <strong>transferred</strong> between billing accounts or directories<br />- Ownership changes should be planned to avoid access loss<br />- Subscriptions control billing and access, not regions<br />- Moving resources between subscriptions may cause downtime<br />- Policies and RBAC often apply at the subscription level</p>
<p>Steps: Portal &gt; Subscriptions &gt; Add (offer type, billing).</p>
<p><strong>Best practices:</strong><br />- Use <strong>multiple subscriptions</strong> for isolation (Prod vs Non-Prod). Separate by environment, workload, or compliance.<br />- Apply <strong>budgets, policies, and role assignments</strong> at subscription scope</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Manage costs by using alerts, budgets, and Azure Advisor recommendations</mark><br />Cost management in Azure helps monitor spending, prevent overruns, and optimize resource usage using <strong>Cost Management</strong>, <strong>budgets</strong>, and <strong>Advisor recommendations</strong>.<br />- Monitor Cost via Azure Cost Management + Billing<br />- View spend by subscription, resource group, timeframe, service, or tag<br />- Analyze trends and forecast usage, and set a budget for alerting.</p>
<p>Steps:<br />- Create budget: Scope &gt; Budgets &gt; Add (amount, alerts)<br />Budgets trigger alerts only—they <strong>do not stop resources</strong>.<br />- Alerts: Action groups for notifications<br />- Advisor: Azure Advisor Review recommendations<br />(e.g., right-size VMs, use reserved instances, remove unused resources)</p>
<p><strong>Best Practices:</strong><br />- Set multiple budget thresholds (e.g., 50%, 75%, 90%)<br />- Use tags for accurate cost allocation<br />- Combine budgets and alerts with Azure Policy for governance<br />- Review Advisor recommendations regularly</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Configure management groups</mark><br />Management groups in Azure provide a <strong>hierarchical structure</strong> to organize subscriptions and apply governance at scale.</p>
<p>- Subscriptions can be moved between management groups<br />- Policies and RBAC assignments inherit downward<br />- The root management group sits at the top of the hierarchy<br />- Requires <strong>User Access Administrator</strong> or <strong>Owner</strong> at root to manage hierarchy.</p>
<p>Steps:<br />- Portal: Azure Portal → Management groups → Create<br />- Specify Management Group ID and Display Name<br />- Add subscriptions or child management groups</p>
<p><strong>Best practices:</strong><br />- Align hierarchy with organizational structure<br />- Separate Prod / Non-Prod at higher levels<br />- Apply Azure Policy at management group scope<br />- Limit access at the root; delegate lower levels</p>
<h3>Governance Tools Overview</h3>
<table>
<thead>
<tr>
<th>Governance Tool</th>
<th>Primary Use</th>
<th>Example</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Azure Policy</strong></td>
<td>Compliance enforcement</td>
<td>Restrict resource locations</td>
</tr>
<tr>
<td><strong>Azure Resource Locks</strong></td>
<td>Protection from changes</td>
<td>Prevent deletion of Prod DB</td>
</tr>
<tr>
<td><strong>Tags</strong></td>
<td>Organization &amp; billing</td>
<td><code>CostCenter : Finance</code></td>
</tr>
<tr>
<td><strong>Management Groups</strong></td>
<td>Hierarchical governance</td>
<td>Corp → Prod → App1</td>
</tr>
</tbody></table>
<h2>Conclusion</h2>
<p>Managing Azure identities and governance is foundational for secure, compliant, and cost-effective cloud operations. Mastery of Microsoft Entra ID (users, groups, external identities, licensing, and self-service features), principled access control with RBAC, and disciplined subscription governance using Azure Policy, resource locks, tags, and management groups will help you enforce standards, reduce risk, and simplify administration. This domain represents a significant portion of the AZ-104 exam (about 20–25%), so practical familiarity matters as much as theory.</p>
<p>Key takeaways and next steps:</p>
<ul>
<li><p>Adopt least-privilege access: use built-in roles where appropriate and create custom roles only when necessary.</p>
</li>
<li><p>Harden identities: require MFA, enable self-service password reset, and consider Privileged Identity Management for just-in-time elevation.</p>
</li>
<li><p>Design RBAC around scopes and role assignments to simplify auditing and reduce blast radius.</p>
</li>
<li><p>Enforce standards with Azure Policy and use management groups to scale governance across subscriptions.</p>
</li>
<li><p>Implement tagging and cost controls to improve visibility and chargeback.</p>
</li>
<li><p>Practice with hands-on labs and real-world scenarios (for example, the AZ-104 lab materials) to solidify skills and prepare for the exam.</p>
</li>
</ul>
<p>Keep practicing these concepts in real or lab environments—consistent, hands-on experience is the most effective way to become a confident Azure administrator.</p>
<p>Key references read,</p>
<ul>
<li><p><a href="https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104">https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/training/modules/manage-users-and-groups-in-aad">https://learn.microsoft.com/en-us/training/modules/manage-users-and-groups-in-aad</a></p>
</li>
<li><p><a href="https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/Instructions/Labs/LAB_01-Manage_Entra_ID_Identities.html">https://microsoftlearning.github.io/AZ-104-MicrosoftAzureAdministrator/Instructions/Labs/LAB_01-Manage_Entra_ID_Identities.html</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104">https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/entra/identity/authentication/tutorial-enable-sspr">https://learn.microsoft.com/en-us/entra/identity/authentication/tutorial-enable-sspr</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/role-based-access-control/overview">https://learn.microsoft.com/en-us/azure/role-based-access-control/overview</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/entra/external-id/external-collaboration-settings-configure">https://learn.microsoft.com/en-us/entra/external-id/external-collaboration-settings-configure</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal">https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources">https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/governance/policy/overview">https://learn.microsoft.com/en-us/azure/governance/policy/overview</a></p>
</li>
<li><p><a href="https://learn.microsoft.com/en-us/azure/governance/management-groups/overview">https://learn.microsoft.com/en-us/azure/governance/management-groups/overview</a></p>
</li>
</ul>
<p>Thank you for the read. Hope you like it. I appreciate your feedback.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Mastering Target Tracking Scaling Policies for Amazon EC2 Auto Scaling]]></title><description><![CDATA[Scaling your EC2 instances to match dynamic workloads can be challenging. Amazon EC2 Auto Scaling simplifies this with target tracking scaling policies, a powerful feature that automatically adjusts capacity to maintain optimal performance and cost e...]]></description><link>https://blog.jineshkumar.com/mastering-target-tracking-scaling-policies-for-amazon-ec2-auto-scaling</link><guid isPermaLink="true">https://blog.jineshkumar.com/mastering-target-tracking-scaling-policies-for-amazon-ec2-auto-scaling</guid><category><![CDATA[ec2]]></category><category><![CDATA[EC2 instance]]></category><category><![CDATA[autoscaling group]]></category><category><![CDATA[ec2 auto scaling ]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Fri, 07 Feb 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1740799682101/faab2885-8585-4092-8ec5-b86971501293.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Scaling your EC2 instances to match dynamic workloads can be challenging. Amazon EC2 Auto Scaling simplifies this with <strong>target tracking scaling policies</strong>, a powerful feature that automatically adjusts capacity to maintain optimal performance and cost efficiency. In this blog, we’ll dive deep into how target tracking works, its benefits, and how to implement it with real-world examples.</p>
<hr />
<h2 id="heading-what-are-target-tracking-scaling-policies">What Are Target Tracking Scaling Policies?</h2>
<p>Target tracking scaling policies allow you to define a target value for a specific Amazon CloudWatch metric (e.g., CPU utilization, request count per instance). EC2 Auto Scaling then adds or removes instances to keep the metric close to your target. For example:</p>
<ul>
<li><p>If your target is <strong>60% CPU utilization</strong>, Auto Scaling will launch instances when CPU usage exceeds 60% and terminate them when it drops below.</p>
</li>
<li><p>If your application handles HTTP requests, you could target <strong>500 requests per minute per instance</strong> to ensure consistent throughput.</p>
</li>
</ul>
<p>This "set-it-and-forget-it" approach reduces manual intervention and ensures your application scales seamlessly.</p>
<hr />
<h2 id="heading-benefits-of-target-tracking-scaling">Benefits of Target Tracking Scaling</h2>
<ol>
<li><p><strong>Automatic Scaling</strong>: Responds to traffic spikes or drops without manual input.</p>
</li>
<li><p><strong>Cost Optimization</strong>: Runs only the instances needed, avoiding over-provisioning.</p>
</li>
<li><p><strong>Simplified Configuration</strong>: No need to define complex scaling rules for every scenario.</p>
</li>
<li><p><strong>Integration with CloudWatch</strong>: Leverage built-in metrics or custom metrics for granular control.</p>
</li>
<li><p><strong>Proactive Scaling</strong>: Adjusts capacity <em>before</em> performance degrades.</p>
</li>
</ol>
<hr />
<h2 id="heading-how-target-tracking-scaling-works">How Target Tracking Scaling Works</h2>
<ol>
<li><p><strong>Select a Metric</strong>: Choose a CloudWatch metric (e.g., <code>CPUUtilization</code>, <code>RequestCountPerTarget</code>).</p>
</li>
<li><p><strong>Set a Target Value</strong>: Define the ideal average value for the metric.</p>
</li>
<li><p><strong>Auto Scaling Adjusts Capacity</strong>: EC2 Auto Scaling uses Amazon’s scaling algorithms to add/remove instances.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740796109931/df307f82-c319-410e-9cd3-fe4b5adea747.png" alt class="image--center mx-auto" /></p>
<p><em>While in the creation of Auto-Scaling-Group &gt; Configure Group Size and Scaling Policies (Screenshot Above)</em></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740796476192/6b1feef3-a133-4ef2-b1d3-da82cfad45c4.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-step-by-step-implementation">Step-by-Step Implementation</h2>
<h3 id="heading-example-1-scaling-based-on-cpu-utilization">Example 1: Scaling Based on CPU Utilization</h3>
<p><strong>Scenario</strong>: You want to maintain an average CPU utilization of 40% for your web servers.</p>
<h4 id="heading-via-aws-console">Via AWS Console:</h4>
<ol>
<li><p>Navigate to <strong>EC2 Auto Scaling Groups</strong> &gt; Select your ASG &gt; <strong>Automatic Scaling</strong> tab.</p>
</li>
<li><p>Click <strong>Create dynamic scaling policy</strong> &gt; <strong>Target tracking scaling</strong>.</p>
</li>
<li><p>Configure:</p>
<ul>
<li><p><strong>Policy name</strong>: <code>cpu80-target</code></p>
</li>
<li><p><strong>Metric type</strong>: <code>Average CPU Utilization</code></p>
</li>
<li><p><strong>Target value</strong>: 80</p>
</li>
</ul>
</li>
<li><p>Click <strong>Create</strong>.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740796636967/a68dc8ac-31d0-40a6-9766-325ea18d149a.png" alt class="image--center mx-auto" /></p>
<p><em>Screenshot of the metric selection and target value fields.</em></p>
<blockquote>
<h6 id="heading-aws-documentationhttpsdocsawsamazoncomautoscalingec2userguidepolicycreatinghtml-suggested-steps-as-follows"><a target="_blank" href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/policy_creating.html">AWS Documentation</a> Suggested Steps as follows,</h6>
<p>To create a target tracking scaling policy for an existing Auto Scaling group</p>
<ol>
<li><p>Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/, and choose <strong>Auto Scaling Groups</strong> from the navigation pane.</p>
</li>
<li><p>Select the check box next to your Auto Scaling group.</p>
<p> A split pane opens up in the bottom of the page.</p>
</li>
<li><p>Verify that the scaling limits are appropriately set. For example, if your group's desired capacity is already at its maximum, you need to specify a new maximum in order to scale out. For more information, see Set scaling limits for your Auto Scaling group.</p>
</li>
<li><p>On the <strong>Automatic scaling</strong> tab, in <strong>Dynamic scaling policies</strong>, choose <strong>Create dynamic scaling policy</strong>.</p>
</li>
<li><p>To define a policy, do the following:</p>
<ol>
<li><p>For <strong>Policy type</strong>, keep the default of <strong>Target tracking scaling</strong>.</p>
</li>
<li><p>Specify a name for the policy.</p>
</li>
<li><p>For <strong>Metric type</strong>, choose a metric. You can choose only one metric type. To use more than one metric, create multiple policies.</p>
<p> If you chose <strong>Application Load Balancer request count per target</strong>, choose a target group in <strong>Target group</strong>.</p>
</li>
<li><p>Specify a <strong>Target value</strong> for the metric.</p>
</li>
<li><p>(Optional) For <strong>Instance warmup</strong>, update the instance warmup value as needed.</p>
</li>
<li><p>(Optional) Select <strong>Disable scale in to create only a scale-out policy</strong>. This allows you to create a separate scale-in policy of a different type if wanted.</p>
</li>
</ol>
</li>
<li><p>Choose <strong>Create</strong>.  </p>
</li>
</ol>
</blockquote>
<h4 id="heading-aws-cli-command-to-set-target-tracking-configuration-based-of-average-httpsdocsawsamazoncomautoscalingec2userguideasg-capacity-limitshtml-cpu-utilization"><a target="_blank" href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-capacity-limits.html">AWS CLI Command to set target-tracking-configuration based of <mark>“Average </mark></a> <mark>CPU Utilization”</mark></h4>
<pre><code class="lang-bash">aws autoscaling put-scaling-policy \  
  --policy-name cpu80-target \  
  --auto-scaling-group-name my-asg \  
  --policy-type TargetTrackingScaling \  
  --target-tracking-configuration <span class="hljs-string">'{  
    "PredefinedMetricSpecification": {  
      "PredefinedMetricType": "ASGAverageCPUUtilization"  
    },  
    "TargetValue": 80.0  
  }'</span>
</code></pre>
<p><a target="_blank" href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-capacity-limits.html">I ha</a>d a Stress test running on my EC2 instances, which gets my EC2 instances CPU utilization over 80%</p>
<p>which can be s<a target="_blank" href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-capacity-limits.html">een under EC2 &gt; AutoScalingGroup Settings &gt; My</a>AutoScalingGroup &gt; Monitoring (Screenshot Below)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740798401559/dd29deda-287b-41af-9cc9-b2694f833b44.png" alt class="image--center mx-auto" /></p>
<p>Click on Activity to see New EC2 Instance getting created due to “Target Tracking CPU Utilization Policy”</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1740798503514/1338302c-43c5-4b22-b2fd-27eddd13f80c.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-example-2-scaling-based-on-application-load-balancer-alb-requests">Example 2: Scaling Based on Application Load Balancer (ALB) Requests</h3>
<p><strong>Scenario</strong>: Your application uses an ALB, and you want to maintain 1000 requests per minute per instance.</p>
<h4 id="heading-via-aws-console-1">Via AWS Console:</h4>
<ol>
<li><p>Follow steps 1–2 above.</p>
</li>
<li><p>Configure:</p>
<ul>
<li><p><strong>Metric type</strong>: <code>Application Load Balancer Request Count Per Target</code></p>
</li>
<li><p><strong>Target value</strong>: <code>1000</code></p>
</li>
<li><p><strong>ALB Target Group</strong>: Select your target group.</p>
</li>
</ul>
</li>
</ol>
<h4 id="heading-aws-cli-command-for-application-load-balancer-request-count-per-target">AWS CLI command for <mark>“Application Load Balancer Request Count Per Target”</mark></h4>
<pre><code class="lang-bash">aws autoscaling put-scaling-policy \  
  --policy-name alb-requests-target \  
  --auto-scaling-group-name my-asg \  
  --policy-type TargetTrackingScaling \  
  --target-tracking-configuration <span class="hljs-string">'{  
    "PredefinedMetricSpecification": {  
      "PredefinedMetricType": "ALBRequestCountPerTarget",  
      "ResourceLabel": "app/my-alb/1234567890abcdef/targetgroup/my-target-group/abcdef0123456789"  
    },  
    "TargetValue": 1000.0  
  }'</span>
</code></pre>
<hr />
<h2 id="heading-advanced-tips">Advanced Tips</h2>
<ol>
<li><p><strong>Custom Metrics</strong>: Use <mark>CloudWatch custom metrics</mark> (e.g., queue depth, memory usage) for niche workloads.</p>
</li>
<li><p><strong>Cooldown Periods</strong>: Configure cooldown timers to prevent rapid scaling fluctuations.</p>
</li>
<li><p><strong>Combination with Other Policies</strong>: Pair target tracking with step scaling for complex scenarios.</p>
</li>
</ol>
<hr />
<h2 id="heading-troubleshooting-issues-to-consider">Troubleshooting issues to consider</h2>
<ul>
<li><p><strong>Metric Not Found</strong>: Ensure the metric is correctly associated with your ASG (e.g., ALB metrics require the ASG to be attached to the target group).</p>
</li>
<li><p><strong>Over-scaling</strong>: Adjust the target value or enable instance warm-up to stabilize scaling decisions.</p>
</li>
<li><p><strong>Monitor CloudWatch Alarms</strong>: Target tracking creates CloudWatch alarms automatically—check their status in the AWS Console.</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>Target tracking scaling policies are a game-changer for managing EC2 workloads. By automating capacity adjustments, you save time, reduce costs, and ensure reliable performance. Whether you’re scaling based on CPU, network, or custom metrics, this feature simplifies infrastructure management.</p>
<p>Reference: Explore the <a target="_blank" href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html">official AWS documentation</a> for advanced configurations.</p>
<p>You are now ready to optimize your EC2 fleet !<br /><strong>Implement target tracking, and let AWS handle the heavy lifting!</strong></p>
<p>Thank you for the read. Hope you like it. I appreciate your feedback.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Attach an EBS volume to multiple EC2 instances using Multi-Attach]]></title><description><![CDATA[IntroductionAmazon Elastic Block Store (EBS) is a cornerstone of AWS storage solutions, offering persistent block-level storage for EC2 instances. While EBS volumes are typically attached to a single instance.# EBS Multi-Attach breaks this mold, allo...]]></description><link>https://blog.jineshkumar.com/attach-an-ebs-volume-to-multiple-ec2-instances-using-multi-attach</link><guid isPermaLink="true">https://blog.jineshkumar.com/attach-an-ebs-volume-to-multiple-ec2-instances-using-multi-attach</guid><category><![CDATA[ebs]]></category><category><![CDATA[EBS Volume Types]]></category><category><![CDATA[@ebs-multi-attach]]></category><category><![CDATA[#ebs snapshot]]></category><category><![CDATA[AWS]]></category><category><![CDATA[storage]]></category><category><![CDATA[EC2 instance]]></category><category><![CDATA[ec2]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Fri, 31 Jan 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1739239486912/9c7db48f-47da-457f-bf30-27f329bd2c46.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Introduction</strong><br />Amazon Elastic Block Store (EBS) is a cornerstone of AWS storage solutions, offering persistent block-level storage for EC2 instances. While EBS volumes are typically attached to a single instance.<br /># <strong>EBS Multi-Attach</strong> breaks this mold, allowing a single volume to be attached to multiple EC2 instances in the same Availability Zone (AZ). This feature is invaluable for clustered applications requiring shared storage for high availability (HA) or fault tolerance. In this guide, we’ll explore how to configure Multi-Attach, use cases, commands, and best practices.</p>
<p>Example Illustration of EBS Multi-Attach (Image Reference - <a target="_blank" href="https://docs.aws.amazon.com/pdfs/ebs/latest/userguide/ebs-ug.pdf#ebs-multi-attach-perf">AWS</a>)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739239528458/3eeaacae-3c6d-4997-b6d7-ad437409811a.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-when-to-use-ebs-multi-attach"><strong>When to Use EBS Multi-Attach</strong></h2>
<h3 id="heading-scenarios-amp-use-cases">Scenarios &amp; Use Cases</h3>
<ol>
<li><p><strong>Clustered Databases</strong>: Deploy databases like SQL Server Failover Clusters or Oracle RAC where multiple nodes require access to shared data.</p>
</li>
<li><p><strong>High Availability Applications</strong>: Applications needing redundant compute nodes with shared storage for failover.</p>
</li>
<li><p><strong>Real-Time Collaboration</strong>: Workloads requiring simultaneous read/write access to shared data (with proper file system coordination).</p>
</li>
</ol>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><p><strong>Volume Type</strong>: Only <strong>Provisioned IOPS SSD (io1/io2)</strong> volumes support Multi-Attach.</p>
</li>
<li><p><strong>Availability Zone</strong>: All attached instances must reside in the same AZ.</p>
</li>
<li><p><strong>File System</strong>: Use a cluster-aware file system (e.g., GFS2, Windows Failover Cluster) to avoid data corruption.</p>
</li>
<li><p><strong>Instance Compatibility</strong>: Instances must support EBS encryption if the volume is encrypted.</p>
</li>
</ul>
<hr />
<h2 id="heading-step-by-step-guide-to-configuring-ebs-multi-attach"><strong>Step-by-Step Guide to Configuring EBS Multi-Attach</strong></h2>
<h3 id="heading-1-creating-a-multi-attach-volume"><strong>1. Creating a Multi-Attach Volume</strong></h3>
<h4 id="heading-using-the-aws-console"><strong>Using the AWS Console</strong></h4>
<ol>
<li><p>Navigate to the <strong>EC2 Console</strong> → <strong>Volumes</strong> → <strong>Create Volume</strong>.</p>
</li>
<li><p>Configure:</p>
<ul>
<li><p><strong>Volume Type</strong>: <code>io1</code> or <code>io2</code></p>
</li>
<li><p><strong>Size &amp; IOPS</strong>: Define size (GiB) and provisioned IOPS.</p>
</li>
<li><p><strong>Availability Zone</strong>: Match the AZ of your target instances.</p>
</li>
<li><p><strong>Multi-Attach</strong>: Check <strong>Enable Multi-Attach</strong>.</p>
</li>
<li><p>(Optional) Configure encryption or tags.</p>
</li>
</ul>
</li>
<li><p>Click <strong>Create Volume</strong>.</p>
</li>
</ol>
<h4 id="heading-using-aws-cli"><strong>Using AWS CLI</strong></h4>
<pre><code class="lang-bash">aws ec2 create-volume \
  --volume-type io2 \
  --size 100 \
  --iops 3000 \
  --availability-zone us-east-1a \
  --multi-attach-enabled
</code></pre>
<h3 id="heading-2-attaching-the-volume-to-multiple-instances"><strong>2. Attaching the Volume to Multiple Instances</strong></h3>
<p>After creation, attach the volume to multiple instances in the same AZ.</p>
<h4 id="heading-using-aws-cli-1"><strong>Using AWS CLI</strong></h4>
<pre><code class="lang-bash"><span class="hljs-comment"># Attach to Instance 1 Replace with your instance ID</span>
aws ec2 attach-volume \
  --volume-id vol-12345abc \
  --instance-id i-0abcd1234 \
  --device /dev/sdf

<span class="hljs-comment"># Attach to Instance 2 Replace with your instance ID</span>
aws ec2 attach-volume \
  --volume-id vol-12345abc \
  --instance-id i-0efgh5678 \
  --device /dev/sdf
</code></pre>
<h3 id="heading-3-enabling-multi-attach-on-existing-io2-volumes"><strong>3. Enabling Multi-Attach on Existing io2 Volumes</strong></h3>
<p><strong>Note</strong>: Only <code>io2</code> volumes can have Multi-Attach enabled post-creation (if unattached).</p>
<h4 id="heading-console-method"><strong>Console Method</strong></h4>
<ol>
<li><p>Select the volume → <strong>Actions</strong> → <strong>Modify Volume</strong>.</p>
</li>
<li><p>Check <strong>Enable Multi-Attach</strong> → <strong>Modify</strong>.</p>
</li>
</ol>
<h4 id="heading-aws-cli-command"><strong>AWS CLI Command</strong></h4>
<pre><code class="lang-bash">aws ec2 modify-volume \
  --volume-id vol-12345abc \
  --multi-attach-enabled
</code></pre>
<h2 id="heading-example-scenario-sql-server-failover-cluster"><strong>Example Scenario: SQL Server Failover Cluster</strong></h2>
<p>Imagine deploying a SQL Server Failover Cluster across two EC2 instances (<code>i-0abcd1234</code> and <code>i-0efgh5678</code>) in <code>us-east-1a</code>.</p>
<ol>
<li><p><strong>Create a Multi-Attach Volume</strong>:</p>
<pre><code class="lang-bash"> aws ec2 create-volume --volume-type io2 --size 500 --iops 5000 \
   --availability-zone us-east-1a --multi-attach-enabled
</code></pre>
</li>
<li><p><strong>Attach to Both Instances</strong>:</p>
<pre><code class="lang-bash"> <span class="hljs-comment"># Attach to primary instance</span>
 aws ec2 attach-volume --volume-id vol-12345abc --instance-id i-0abcd1234 --device /dev/sdf

 <span class="hljs-comment"># Attach to secondary instance</span>
 aws ec2 attach-volume --volume-id vol-12345abc --instance-id i-0efgh5678 --device /dev/sdf
</code></pre>
</li>
<li><p><strong>Configure Windows Failover Cluster</strong>:</p>
<ul>
<li><p>Initialize the disk as <strong>NTFS</strong> or <strong>ReFS</strong> on the primary instance.</p>
</li>
<li><p>Add the disk to the cluster shared volumes (CSV) in Windows Server Failover Cluster Manager.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-disabling-multi-attach"><strong>Disabling Multi-Attach</strong></h2>
<p>To disable Multi-Attach, ensure the volume is attached to <strong>no more than one instance</strong>.</p>
<h4 id="heading-console-method-1"><strong>Console Method</strong></h4>
<ol>
<li><p>Select the volume → <strong>Actions</strong> → <strong>Modify Volume</strong>.</p>
</li>
<li><p>Uncheck <strong>Enable Multi-Attach</strong> → <strong>Modify</strong>.</p>
</li>
</ol>
<h4 id="heading-aws-cli-command-1"><strong>AWS CLI Command</strong></h4>
<pre><code class="lang-bash">aws ec2 modify-volume \
  --volume-id vol-12345abc \
  --no-multi-attach-enabled
</code></pre>
<h2 id="heading-best-practices-amp-limitations"><strong>Best Practices &amp; Limitations</strong></h2>
<h3 id="heading-best-practices"><strong>Best Practices</strong></h3>
<ul>
<li><p><strong>Cluster-Aware File Systems</strong>: Always use file systems designed for concurrent access (e.g., GFS2, CSV).</p>
</li>
<li><p><strong>I/O Coordination</strong>: Applications must handle concurrent writes to avoid data corruption.</p>
</li>
<li><p><strong>Monitoring</strong>: Use Amazon CloudWatch to track volume performance (<code>VolumeQueueLength</code>, <code>BurstBalance</code>).</p>
</li>
</ul>
<h3 id="heading-limitations"><strong>Limitations</strong></h3>
<ul>
<li><p><strong>Volume Types</strong>: Only <code>io1</code> and <code>io2</code> support Multi-Attach.</p>
</li>
<li><p><strong>AZ Bound</strong>: All instances must be in the same AZ.</p>
</li>
<li><p><strong>io1 Restriction</strong>: Multi-Attach cannot be enabled on <code>io1</code> after creation.</p>
</li>
<li><p><strong>Encryption</strong>: Encrypted volumes require compatible instances.</p>
</li>
<li><p>The following table shows volume modification support for Multi-Attach enabled <code>io1</code> and <code>io2</code> volumes after creation.</p>
</li>
</ul>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Modification Option</td><td>io2 Volumes</td><td>io1 Volumes</td></tr>
</thead>
<tbody>
<tr>
<td>Modify volume type</td><td>✗</td><td>✗</td></tr>
<tr>
<td>Modify volume size</td><td>✓</td><td>✗</td></tr>
<tr>
<td>Modify provisioned IOPS</td><td>✓</td><td>✗</td></tr>
<tr>
<td>Enable Multi-Attach</td><td>✓ *</td><td>✗</td></tr>
<tr>
<td>Disable Multi-Attach</td><td>✓ *</td><td>✗</td></tr>
</tbody>
</table>
</div><p>* You can't enable or disable Multi-Attach while the volume is attached to an instance.</p>
<hr />
<h2 id="heading-troubleshooting"><strong>Troubleshooting</strong></h2>
<ul>
<li><p><strong>Attachment Failure</strong>: Verify AZ alignment, instance support for encryption, and volume type.</p>
</li>
<li><p><strong>Data Corruption</strong>: Ensure the application or file system handles concurrent writes.</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>EBS Multi-Attach is a game-changer for clustered workloads needing shared storage. By following this guide, you can configure Multi-Attach for io1/io2 volumes, attach them to multiple instances, and deploy highly available applications. Remember to use cluster-aware file systems and monitor performance to avoid bottlenecks.</p>
<p><strong>Further Reading</strong>:</p>
<ul>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html">AWS EBS Documentation</a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html">Clustered File Systems for Linux</a> - Attach an EBS volume to multiple EC2 instances using Multi-Attach</p>
</li>
</ul>
<hr />
<p>By mastering EBS Multi-Attach, you unlock new possibilities for building resilient, high-performance clustered File System architectures on AWS.</p>
<p>I hope this blog post has been helpful. If you have any further questions or encounter any issues, please feel free to leave a comment below.</p>
<p>Thank you for reading! Happy Learning!</p>
<p>Like and Follow for more content.</p>
<p>Thank you,<br /><a target="_blank" href="https://jineshkumar.bio.link/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[WebApp : Building AWS S3 Bucket File Uploader - A Hands-On Guide]]></title><description><![CDATA[Introduction
In today’s digital age, storing files in the cloud is a must. AWS S3 offers a secure and scalable storage solution, and combining it with AWS SDK for Python (Boto3) in Flask and a bit of front-end magic gives you a lightweight S3 file up...]]></description><link>https://blog.jineshkumar.com/webapp-building-aws-s3-bucket-file-uploader-a-hands-on-guide</link><guid isPermaLink="true">https://blog.jineshkumar.com/webapp-building-aws-s3-bucket-file-uploader-a-hands-on-guide</guid><category><![CDATA[S3 Uploader]]></category><category><![CDATA[S3]]></category><category><![CDATA[S3 static website hosting]]></category><category><![CDATA[S3-bucket]]></category><category><![CDATA[AWS]]></category><category><![CDATA[AWS SDK]]></category><category><![CDATA[boto3]]></category><category><![CDATA[s3-bucket policy]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Fri, 24 Jan 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1739139144479/3f4eeee6-fc8c-40fe-a2aa-cf47083ff78b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>In today’s digital age, storing files in the cloud is a must. AWS S3 offers a secure and scalable storage solution, and combining it with AWS SDK for Python (Boto3) in Flask and a bit of front-end magic gives you a lightweight S3 file uploader that can be integrated into any web project. Whether you’re a developer looking to expand your toolkit or a tech enthusiast wanting a hands-on project, this guide is for you.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739134871109/2f5bd850-8379-431b-9400-b84294569c6e.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-youll-build">What You’ll Build</h2>
<p><strong>We will create a web application that:</strong></p>
<ul>
<li><p>Allows users to select and upload files.</p>
</li>
<li><p>Uses JavaScript (with progress events) to display upload progress.</p>
</li>
<li><p>Uses AWS SDK for Python (Boto3) in Flask as the backend to communicate with AWS S3.</p>
</li>
<li><p>Displays a list of uploaded files retrieved from S3.</p>
</li>
<li><p>Shows the bucket name to ensure that the correct S3 bucket is being used.</p>
</li>
</ul>
<p><strong>Files in the Project:</strong></p>
<ul>
<li><p><code>app.py</code> – The main Python Flask application.</p>
</li>
<li><p><code>index.html</code> – The front-end HTML interface.</p>
</li>
<li><p><code>script.js</code> – JavaScript for handling uploads and dynamic updates.</p>
</li>
<li><p><code>style.css</code> – CSS for styling the app.</p>
</li>
<li><p><code>.env</code> – Environment variables for AWS credentials and bucket name.</p>
</li>
</ul>
<p><strong>Key components:</strong></p>
<ol>
<li><p>Client-facing UI with drag-and-drop capabilities to upload Files</p>
</li>
<li><p>Real-time file list synchronization. List uploaded Files to S3 Bucket</p>
</li>
<li><p>S3File Upload Progress Bar</p>
</li>
<li><p>Error Handling</p>
</li>
</ol>
<p><strong>Settings up file/folder structure in VS Code</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739135115689/00e86267-9553-4d4b-ba8e-803db36e95cd.png" alt class="image--center mx-auto" /></p>
<p>Pre-requisites:</p>
<ol>
<li><p>AWS Account and Access to <a target="_blank" href="http://console.aws.amazon.com">AWS Management Console</a>.</p>
</li>
<li><p>S3 Bucket - <a target="_blank" href="https://docs.aws.amazon.com/quickstarts/latest/s3backup/step-1-create-bucket.html">Create a unique named S3 Bucket</a> from AWS Console.</p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html">Create Access Key</a> for newly Create “<strong>s3-uploader-user</strong>” IAM User (Screenshot Below)</p>
</li>
<li><p><strong>“s3-uploader-user” permission access policy</strong> <a target="_blank" href="https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-2#/policies/details/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2FAmazonS3FullAccess">AmazonS3FullAccess</a></p>
</li>
<li><p>Installed Python , VSCode on your local machine.</p>
</li>
</ol>
<p>Pre-requisites 2 , 3 Screenshot references</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739136007898/516ffb3d-4196-462e-b0b2-1f63c8cfdf27.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739136025317/e060560b-531d-4427-8343-e09b65ae358a.png" alt class="image--center mx-auto" /></p>
<p>Note: AmazonS3FullAccess is not necessary. You can only give required granular permissions only as well.</p>
<p><strong>Setting Up the Backend (app.py)</strong></p>
<p>Below is the code for our Python app that’s uses <a target="_blank" href="https://aws.amazon.com/sdk-for-python/"><strong>AWS SDK for Python (Boto3)</strong></a>.</p>
<p>This script creates several routes:</p>
<ul>
<li><p><code>/</code> to serve the main page.</p>
</li>
<li><p><code>/upload</code> (and <code>/api/upload</code>) to handle file uploads.</p>
</li>
<li><p><code>/list</code> to retrieve the list of files stored in S3.</p>
</li>
<li><p><code>/bucket</code> to return the bucket name for verification.</p>
</li>
</ul>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> flask <span class="hljs-keyword">import</span> Flask, render_template, request, jsonify
<span class="hljs-keyword">import</span> boto3
<span class="hljs-keyword">from</span> botocore.exceptions <span class="hljs-keyword">import</span> ClientError

app = Flask(__name__)

<span class="hljs-comment"># Load AWS credentials and bucket name from environment variables.</span>
AWS_ACCESS_KEY = os.environ.get(<span class="hljs-string">'AWS_ACCESS_KEY_ID'</span>)
AWS_SECRET_KEY = os.environ.get(<span class="hljs-string">'AWS_SECRET_ACCESS_KEY'</span>)
BUCKET_NAME = os.environ.get(<span class="hljs-string">'AWS_S3_BUCKET'</span>) <span class="hljs-keyword">or</span> <span class="hljs-string">'your-bucket-name'</span>

<span class="hljs-comment"># Create an S3 client using the boto3 library.</span>
s3_client = boto3.client(
    <span class="hljs-string">'s3'</span>,
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY
)

<span class="hljs-comment"># Home route renders the index.html template.</span>
<span class="hljs-meta">@app.route("/")</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">index</span>():</span>
    <span class="hljs-keyword">return</span> render_template(<span class="hljs-string">"index.html"</span>)

<span class="hljs-comment"># File upload route.</span>
<span class="hljs-meta">@app.route("/upload", methods=["POST"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">upload</span>():</span>
    <span class="hljs-keyword">if</span> <span class="hljs-string">"file"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> request.files:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: <span class="hljs-string">"No file part in the request"</span>}), <span class="hljs-number">400</span>

    file = request.files[<span class="hljs-string">"file"</span>]
    <span class="hljs-keyword">if</span> file.filename == <span class="hljs-string">""</span>:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: <span class="hljs-string">"No selected file"</span>}), <span class="hljs-number">400</span>

    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># Upload the file to the specified S3 bucket.</span>
        s3_client.upload_fileobj(file, BUCKET_NAME, file.filename)
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"message"</span>: <span class="hljs-string">"File uploaded successfully"</span>, <span class="hljs-string">"file"</span>: file.filename})
    <span class="hljs-keyword">except</span> ClientError <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: str(e)}), <span class="hljs-number">500</span>

<span class="hljs-comment"># List files stored in the S3 bucket.</span>
<span class="hljs-meta">@app.route("/list", methods=["GET"])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">list_files</span>():</span>
    <span class="hljs-keyword">try</span>:
        response = s3_client.list_objects_v2(Bucket=BUCKET_NAME)
        files = [obj[<span class="hljs-string">"Key"</span>] <span class="hljs-keyword">for</span> obj <span class="hljs-keyword">in</span> response.get(<span class="hljs-string">'Contents'</span>, [])]
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"files"</span>: files})
    <span class="hljs-keyword">except</span> ClientError <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: str(e)}), <span class="hljs-number">500</span>

<span class="hljs-comment"># Return the bucket name.</span>
<span class="hljs-meta">@app.route('/bucket', methods=['GET'])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">get_bucket_name</span>():</span>
    <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"bucketName"</span>: BUCKET_NAME})

<span class="hljs-comment"># A second API endpoint for uploading (if needed).</span>
<span class="hljs-meta">@app.route('/api/upload', methods=['POST'])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">api_upload</span>():</span>
    <span class="hljs-keyword">if</span> <span class="hljs-string">"file"</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> request.files:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: <span class="hljs-string">"No file part in the request"</span>}), <span class="hljs-number">400</span>

    file = request.files[<span class="hljs-string">"file"</span>]
    <span class="hljs-keyword">if</span> file.filename == <span class="hljs-string">""</span>:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: <span class="hljs-string">"No selected file"</span>}), <span class="hljs-number">400</span>

    <span class="hljs-keyword">try</span>:
        s3_client.upload_fileobj(file, BUCKET_NAME, file.filename)
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"message"</span>: <span class="hljs-string">"File uploaded successfully"</span>, <span class="hljs-string">"file"</span>: file.filename})
    <span class="hljs-keyword">except</span> ClientError <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> jsonify({<span class="hljs-string">"error"</span>: str(e)}), <span class="hljs-number">500</span>

<span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:
    app.run(debug=<span class="hljs-literal">True</span>)
</code></pre>
<h3 id="heading-key-points">Key Points</h3>
<ul>
<li><p><strong>AWS Credentials:</strong> The app uses environment variables (<code>.env</code> file) to securely store AWS keys and the bucket name.</p>
</li>
<li><p><strong>S3 Client:</strong> The <code>boto3</code> client is initialized with your credentials, allowing file uploads to S3.</p>
</li>
<li><p><strong>Routes:</strong></p>
<ul>
<li><p>The <code>/upload</code> endpoint checks for a file in the request and uploads it using <code>upload_fileobj</code>.</p>
</li>
<li><p>The <code>/list</code> endpoint retrieves all objects (files) in the bucket.</p>
</li>
<li><p>The <code>/bucket</code> endpoint returns the bucket name, which is useful for debugging and ensuring your app is connected to the correct S3 bucket.</p>
</li>
</ul>
</li>
</ul>
<h2 id="heading-front-end-implementation-indexhtml-amp-scriptjs">Front-End Implementation: index.html &amp; script.js</h2>
<p>The front end of our app provides a user-friendly interface for uploading files and viewing the list of uploaded files. Although the full <code>index.html</code> isn’t listed in the original snippet, here’s an example based on the provided JavaScript code.</p>
<h3 id="heading-indexhtml">index.html</h3>
<pre><code class="lang-xml"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>AWS S3 File Upload<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"style.css"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">header</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"logo.png"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"App Logo"</span>&gt;</span>
        <span class="hljs-comment">&lt;!-- Your App / Brand Logo for this Web App Reference as .png file with its location --&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Upload Your Files to AWS S3<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"bucketDisplay"</span>&gt;</span>Bucket Name: Loading...<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- File Upload Form --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"uploadForm"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"fileInput"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"file"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"submit"</span>&gt;</span>Upload File<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Progress Bar --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"progressContainer"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"progressBar"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

    <span class="hljs-comment">&lt;!-- Files List Table --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">table</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"filesTable"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">thead</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">tr</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">th</span>&gt;</span>Uploaded Files<span class="hljs-tag">&lt;/<span class="hljs-name">th</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">tr</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">thead</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">tbody</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"filesBody"</span>&gt;</span>
            <span class="hljs-comment">&lt;!-- JavaScript will dynamically insert file names here --&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">tbody</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">table</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"script.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<h3 id="heading-code-explanation-for-indexhtml">Code Explanation for index.html</h3>
<ul>
<li><p><strong>Header:</strong> Displays a logo and title. Replace <code>logo.png</code> with your actual logo.</p>
</li>
<li><p><strong>Bucket Display:</strong> A div with the id <code>bucketDisplay</code> will show the name of your S3 bucket (retrieved via the <code>/bucket</code> API).</p>
</li>
<li><p><strong>File Upload Form:</strong></p>
<ul>
<li><p>The form with <code>id="uploadForm"</code> contains an <code>&lt;input&gt;</code> for file selection.</p>
</li>
<li><p>A submit button to trigger the upload.</p>
</li>
</ul>
</li>
<li><p><strong>Progress Bar:</strong></p>
<ul>
<li>Wrapped inside a container (<code>#progressContainer</code>) with an inner div (<code>#progressBar</code>) that visually represents the upload progress.</li>
</ul>
</li>
<li><p><strong>Files Table:</strong></p>
<ul>
<li>A table with an id <code>filesTable</code> is set up to display the list of uploaded files. The body (<code>#filesBody</code>) is populated dynamically via JavaScript.</li>
</ul>
</li>
<li><p><strong>Script Inclusion:</strong> The <code>script.js</code> file is included at the end of the body to handle the dynamic functionality.</p>
</li>
</ul>
<h3 id="heading-diving-into-scriptjs">Diving Into script.js</h3>
<p>The JavaScript file is responsible for:</p>
<ul>
<li><p>Handling the file upload via AJAX.</p>
</li>
<li><p>Displaying the upload progress.</p>
</li>
<li><p>Dynamically listing the files stored in the S3 bucket.</p>
</li>
<li><p>Fetching and displaying the S3 bucket name.</p>
</li>
</ul>
<h4 id="heading-scriptjs">script.js</h4>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> uploadForm = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'uploadForm'</span>);
<span class="hljs-keyword">const</span> fileInput = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'fileInput'</span>);
<span class="hljs-keyword">const</span> progressBar = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'progressBar'</span>);
<span class="hljs-keyword">const</span> filesBody = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'filesBody'</span>); <span class="hljs-comment">// Table body for files</span>

<span class="hljs-comment">// Function to list files from the S3 bucket.</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">listFiles</span>(<span class="hljs-params"></span>) </span>{
    fetch(<span class="hljs-string">'/list'</span>)
        .then(<span class="hljs-function"><span class="hljs-params">response</span> =&gt;</span> response.json())
        .then(<span class="hljs-function"><span class="hljs-params">data</span> =&gt;</span> {
            filesBody.innerHTML = <span class="hljs-string">''</span>; <span class="hljs-comment">// Clear any previous file entries</span>
            <span class="hljs-keyword">if</span> (data.files) {
                data.files.forEach(<span class="hljs-function"><span class="hljs-params">file</span> =&gt;</span> {
                    <span class="hljs-keyword">const</span> row = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'tr'</span>);
                    <span class="hljs-keyword">const</span> cell = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'td'</span>);
                    cell.textContent = file;
                    row.appendChild(cell);
                    filesBody.appendChild(row);
                });
            }
        });
}

<span class="hljs-comment">// Function to fetch and display the bucket name.</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fetchBucketName</span>(<span class="hljs-params"></span>) </span>{
    fetch(<span class="hljs-string">'/bucket'</span>)
        .then(<span class="hljs-function"><span class="hljs-params">response</span> =&gt;</span> response.json())
        .then(<span class="hljs-function"><span class="hljs-params">data</span> =&gt;</span> {
            <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'bucketDisplay'</span>).textContent =
                <span class="hljs-string">"Bucket Name: "</span> + data.bucketName;
        })
        .catch(<span class="hljs-built_in">console</span>.error);
}

<span class="hljs-comment">// Event listener for the upload form.</span>
uploadForm.addEventListener(<span class="hljs-string">'submit'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">e</span>) </span>{
    e.preventDefault();
    <span class="hljs-keyword">const</span> file = fileInput.files[<span class="hljs-number">0</span>];
    <span class="hljs-keyword">if</span> (!file) <span class="hljs-keyword">return</span>;

    <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
    formData.append(<span class="hljs-string">"file"</span>, file);

    <span class="hljs-keyword">const</span> xhr = <span class="hljs-keyword">new</span> XMLHttpRequest();
    xhr.open(<span class="hljs-string">"POST"</span>, <span class="hljs-string">"/upload"</span>, <span class="hljs-literal">true</span>);

    <span class="hljs-comment">// Update the progress bar during the file upload.</span>
    xhr.upload.addEventListener(<span class="hljs-string">"progress"</span>, <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">evt</span>) </span>{
        <span class="hljs-keyword">if</span> (evt.lengthComputable) {
            <span class="hljs-keyword">const</span> percentComplete = (evt.loaded / evt.total) * <span class="hljs-number">100</span>;
            progressBar.style.width = percentComplete + <span class="hljs-string">'%'</span>;
        }
    }, <span class="hljs-literal">false</span>);

    <span class="hljs-comment">// Once upload is complete, reset the progress bar and update the file list.</span>
    xhr.onload = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
        progressBar.style.width = <span class="hljs-string">'0%'</span>;
        <span class="hljs-keyword">if</span> (xhr.status === <span class="hljs-number">200</span>) {
            listFiles(); <span class="hljs-comment">// Refresh file list upon successful upload.</span>
        } <span class="hljs-keyword">else</span> {
            alert(<span class="hljs-string">"Error uploading file: "</span> + xhr.responseText);
        }
    };

    xhr.send(formData);
});

<span class="hljs-comment">// On window load, initialize the file list and bucket name display.</span>
<span class="hljs-built_in">window</span>.onload = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
    listFiles();
    fetchBucketName();
};
</code></pre>
<h3 id="heading-key-points-1">Key Points</h3>
<ul>
<li><p><strong>File Upload Handling:</strong></p>
<ul>
<li><p>The script prevents the default form submission behavior.</p>
</li>
<li><p>It creates a <code>FormData</code> object to package the file data.</p>
</li>
<li><p>An <code>XMLHttpRequest</code> is used to post the file to the <code>/upload</code> endpoint.</p>
</li>
</ul>
</li>
<li><p><strong>Progress Bar:</strong></p>
<ul>
<li>The <code>xhr.upload.addEventListener("progress", ...)</code> event calculates the percentage of the upload and adjusts the width of the progress bar accordingly.</li>
</ul>
</li>
<li><p><strong>Dynamic Content:</strong></p>
<ul>
<li><p><code>listFiles()</code> fetches the list of files from the S3 bucket and dynamically updates the table in the HTML.</p>
</li>
<li><p><code>fetchBucketName()</code> retrieves the bucket name from the server to display it for user confirmation.</p>
</li>
</ul>
</li>
<li><p><strong>User Experience:</strong></p>
<ul>
<li>The upload progress, immediate file list update after a successful upload, and bucket name display all contribute to a seamless user experience.</li>
</ul>
</li>
</ul>
<h2 id="heading-environment-setup-env">Environment Setup (.env)</h2>
<p>Make sure to create a <code>.env</code> file (or set environment variables in your deployment environment) with the following content:</p>
<pre><code class="lang-yaml"><span class="hljs-string">AWS_ACCESS_KEY_ID=your-access-key</span>
<span class="hljs-string">AWS_SECRET_ACCESS_KEY=your-secret-key</span>
<span class="hljs-string">AWS_S3_BUCKET=file-upload-s3-jpatel-aws-bucket</span>
</code></pre>
<p>Replace the placeholders with your actual AWS credentials and bucket name.</p>
<h2 id="heading-running-the-app">Running the App</h2>
<ol>
<li><p><strong>Install Dependencies:</strong><br /> Make sure you have Flask and boto3 installed:</p>
<pre><code class="lang-python"> pip install flask boto3 python-dotenv
</code></pre>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739136492459/3d25e62f-f351-4733-a9e0-30d13fd2070f.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Set Up AWS Credentials:</strong><br /> Ensure your AWS credentials and bucket name are properly configured in your <code>.env</code> file or environment.</p>
</li>
<li><p><strong>Run the S3Upload App locally:</strong><br /> Start the application by running:</p>
<pre><code class="lang-python"> python app.py
</code></pre>
<p> Your application should now be accessible at <strong>Localhost aka</strong> <a target="_blank" href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a><br /> <mark>Note</mark>: if above two python commands runs successfully, your application will be shown on the above localhost address. Meaning, your application is working.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739136591900/8341d6aa-3c04-41eb-9aea-07df1a837fd6.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p>Wooaallaaa !!! Open your App successfully running on <a target="_blank" href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739137808915/3b1a68b7-d2d1-4d5b-8999-88339d4b31ab.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>We’ve just built a fully functional file uploader that stores files directly to AWS S3 Bucket using simple AWS SDK for Python(boto3) and JavaScript! This guide covered:</p>
<ul>
<li><p>Configuring your Web App with AWS S3 using AWS SDK for Python <code>boto3</code>.</p>
</li>
<li><p>Creating endpoints for file upload and file listing.</p>
</li>
<li><p>Building a responsive front end with HTML, CSS, and JavaScript.</p>
</li>
<li><p>Implementing real-time progress updates during file uploads.</p>
</li>
</ul>
<p>This project not only demonstrates the power of combining these technologies but also gives you a solid foundation for integrating cloud storage into your own projects.</p>
<p>For more information and reference on this, please follow<br />Boto3 Documentation : <a target="_blank" href="https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html">Uploading Files</a></p>
<hr />
<p>Now that we've built a robust <strong>AWS S3 file uploader</strong> with Flask and JavaScript, our journey has just begun. I encourage you to take this guide further by adapting and expanding upon it to fit your unique needs. Experiment with various hosting providers—whether it's Heroku, AWS Elastic Beanstalk, DigitalOcean, or any another host platform—to deploy your application and scale it to meet real-world demands or integrate to create API Endpoint to use it in your app.</p>
<p>As you host and optimize your project, keep iterating: add new features, refine your code, and tailor the experience for your users. Share your improvements and insights with the community, and collaborate with fellow developers to push the boundaries of what's possible. Your creativity and persistence are the keys to transforming this simple guide into a fully-fledged, dynamic solution.</p>
<p>I hope this blog post has been helpful. If you have any further questions or encounter any issues, please feel free to leave a comment below.</p>
<p>Thank you for reading! Happy Learning!</p>
<p>Like and Follow for more content.</p>
<p>Thank you,<br /><a target="_blank" href="https://jineshkumar.bio.link/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Enhancing S3 Security: Configuring MFA Delete with S3 Versioning]]></title><description><![CDATA[In today's digital landscape, data protection is paramount. Amazon S3, a popular cloud storage service, offers robust security features to safeguard your data. One such feature is Multi-Factor Authentication (MFA) Delete, which works in conjunction w...]]></description><link>https://blog.jineshkumar.com/enhancing-s3-security-configuring-mfa-delete-with-s3-versioning</link><guid isPermaLink="true">https://blog.jineshkumar.com/enhancing-s3-security-configuring-mfa-delete-with-s3-versioning</guid><category><![CDATA[S3]]></category><category><![CDATA[S3-bucket]]></category><category><![CDATA[aws s3 security]]></category><category><![CDATA[aws security]]></category><category><![CDATA[storage]]></category><category><![CDATA[Cloud]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sat, 18 Jan 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738895488745/1b921763-827e-4a86-b40b-b6ed00cf5b00.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today's digital landscape, data protection is paramount. Amazon S3, a popular cloud storage service, offers robust security features to safeguard your data. One such feature is Multi-Factor Authentication (MFA) Delete, which works in conjunction with S3 Versioning to provide an additional layer of protection against accidental or unauthorized deletions. In this blog post, we'll explore how to configure MFA Delete and why it's a crucial security measure for your S3 buckets.</p>
<h2 id="heading-what-is-mfa-delete"><strong>What is MFA Delete?</strong></h2>
<p>MFA Delete is a security feature that requires additional authentication for two specific operations:</p>
<ol>
<li><p>Changing the versioning state of your S3 bucket</p>
</li>
<li><p>Permanently deleting an object version</p>
</li>
</ol>
<p>When enabled, MFA Delete requires two forms of authentication:</p>
<ul>
<li><p>Your standard AWS security credentials</p>
</li>
<li><p>A valid serial number and six-digit code from an approved MFA device</p>
</li>
</ul>
<p>This two-factor approach significantly reduces the risk of accidental deletions or unauthorized changes to your S3 bucket's versioning state.</p>
<h2 id="heading-why-use-mfa-delete"><strong>Why Use MFA Delete?</strong></h2>
<ol>
<li><p><strong>Enhanced Security</strong>: By requiring an additional authentication factor, MFA Delete adds an extra layer of protection to your S3 data.</p>
</li>
<li><p><strong>Prevention of Accidental Deletions</strong>: It helps prevent unintended permanent deletions of object versions or changes to bucket versioning.</p>
</li>
<li><p><strong>Compliance</strong>: For organizations with strict data protection requirements, MFA Delete can help meet compliance standards.</p>
</li>
<li><p><strong>Root Account Protection</strong>: Only the AWS account root user can enable or disable MFA Delete, providing an additional safeguard for critical operations.</p>
</li>
</ol>
<h2 id="heading-how-to-enable-mfa-delete"><strong>How to Enable MFA Delete</strong></h2>
<p>Enabling MFA Delete involves a few key steps:</p>
<ol>
<li><p>Enable S3 Versioning: MFA Delete can only be enabled on versioned buckets.</p>
</li>
<li><p>Use AWS CLI or API: MFA Delete can't be enabled through the AWS Management Console; you must use the AWS CLI or API.</p>
</li>
<li><p>Use the Root Account: Only the AWS account root user can enable or disable MFA Delete.</p>
</li>
</ol>
<p>Here's an example AWS CLI command to enable both S3 Versioning and MFA Delete:</p>
<p><code>aws s3api put-bucket-versioning --bucket YOUR-BUCKET-NAME --versioning-configuration Status=Enabled,MFADelete=Enabled --mfa "SERIAL-NUMBER MFA-CODE"</code></p>
<p>Replace "YOUR-BUCKET-NAME" with your actual bucket name, "SERIAL-NUMBER" with your MFA device's serial number, and "MFA-CODE" with the current six-digit code from your MFA device.</p>
<p>Example:</p>
<p><code>aws s3api put-bucket-versioning --bucket customer-pii-storage --versioning-configuration Status=Enabled,MFADelete=Enabled --mfa "arn:aws:iam::456789012345:mfa/root-account-mfa-device 234567"</code></p>
<p>Remember to replace the MFA device ARN and the six-digit MFA code with your actual values when running these commands</p>
<ol>
<li><p>Using the AWS Management Console:</p>
<ul>
<li><p>Sign in to the AWS Management Console</p>
</li>
<li><p>Navigate to the IAM service</p>
</li>
<li><p>Select "Users" from the left sidebar</p>
</li>
<li><p>Click on the user name</p>
</li>
<li><p>In the "Security credentials" tab, find the "Assigned MFA device" section</p>
</li>
<li><p>The ARN w<a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_checking-status.html">i</a>ll be displayed there</p>
</li>
</ul>
</li>
</ol>
<p>The MFA device ARN typically follows this format: <code>arn:aws:iam::ACCOUNT_ID:mfa/DEVICE_NAME</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738894488986/badb05f8-b8a7-4030-a9a5-2ac15131cc7f.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738894512590/9938546c-1246-4e4b-a352-60e04e97ec98.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-important-considerations"><strong>Important Considerations</strong></h2>
<ul>
<li><p>Once enabled, MFA Delete requires MFA authentication for disabling versioning or permanently deleting object versions.</p>
</li>
<li><p>IAM users, even with full S3 permissions, cannot enable, disable, or modify MFA Delete settings.</p>
</li>
<li><p>While MFA Delete prevents permanent deletions, IAM users with appropriate permissions can still create delete markers for objects.</p>
</li>
</ul>
<h2 id="heading-best-practices-for-imphttpsdocsawsamazoncomiamlatestuserguideidcredentialsmfachecking-statushtmllementing-mfa-delete"><strong>Best Practices for Im</strong><a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_checking-status.html"><strong>p</strong></a><strong>lementing MFA Delete</strong></h2>
<ol>
<li><p><strong>S</strong><a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_checking-status.html"><strong>e</strong></a><strong>t up a Backup MFA Device</strong>: To avoid losing access if your primary MFA device <a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_checking-status.html">i</a>s lost, set up a backup device when f<a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_checking-status.html">i</a>rst enabling MFA delete.</p>
</li>
<li><p><strong>Use Hardware or Virtual MFA Devices</strong>: Employ approved authentication devices to generate the required six-digit code.</p>
</li>
<li><p><strong>Encrypt Data</strong>: Always encrypt data at rest and in transit. Use client-side encryption or SSL/TLS for data transmission to and from S3.</p>
</li>
<li><p><strong>Implement Least Privilege Access</strong>: Use IAM policies, bucket policies, and ACLs to ensure users have only the necessary permissions.</p>
</li>
<li><p><strong>Enable Logging and Monitoring</strong>: Use AWS Config rules and tools like AWS Trusted Advisor to monitor your S3 setup and detect potential security issues.</p>
</li>
<li><p><strong>Consider S3 Object Lock</strong>: For critical data, use S3 Object Lock to prevent object deletion or modification for a specified period.</p>
</li>
<li><p><strong>Use Multi-Region Application Architecture</strong>: For critical data, consider using Cross-Region replication to enhance disaster recovery capabilities.</p>
</li>
<li><p><strong>Regularly Audit Access</strong>: Maintain a thorough record of all identities with access to your S3 resources and review regularly.</p>
</li>
</ol>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>MFA Delete is a powerful tool in your S3 security arsenal. By requiring additional authentication for critical operations, it provides an extra safeguard against data loss and unauthorized changes. While it may add a slight complexity to your workflow, the enhanced security it offers is well worth the effort, especially for sensitive or mission-critical data stored in S3. Remember, security in the cloud is a shared responsibility. By leveraging features like MFA Delete, you're taking an active role in protecting your data and ensuring the integrity of your S3 buckets. As cyber threats continue to evolve, implementing robust security measures like MFA Delete is not just a best practice—it's a necessity for maintaining the confidentiality, integrity, and availability of your valuable data assets.</p>
<p>I hope this blog post has been helpful. If you have any further questions or encounter any issues, please feel free to leave a comment below.</p>
<p>Thank you for reading! Happy Learning!</p>
<p>Like and Follow for more Azure and AWS content.</p>
<p>Thank you,<br /><a target="_blank" href="https://jineshkumar.bio.link/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Choosing the Right Throughput Mode for Amazon EFS: A Performance Guide]]></title><description><![CDATA[When using Amazon Elastic File System (EFS), selecting the right throughput mode is critical to balancing performance needs with cost efficiency. EFS offers three modes: Elastic Throughput (Default), Bursting Throughput, and Provisioned Throughput. L...]]></description><link>https://blog.jineshkumar.com/choosing-the-right-throughput-mode-for-amazon-efs-a-performance-guide</link><guid isPermaLink="true">https://blog.jineshkumar.com/choosing-the-right-throughput-mode-for-amazon-efs-a-performance-guide</guid><category><![CDATA[AWS]]></category><category><![CDATA[EFS]]></category><category><![CDATA[EFS Security]]></category><category><![CDATA[throughput]]></category><category><![CDATA[storage]]></category><category><![CDATA[performance]]></category><category><![CDATA[Performance Optimization]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sat, 11 Jan 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738823492653/f0c185c3-07a1-47d0-8ada-4437637ca1fa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When using <strong>Amazon Elastic File System (EFS)</strong>, selecting the right throughput mode is critical to balancing performance needs with cost efficiency. EFS offers three modes: Elastic Throughput (Default), Bursting Throughput, and Provisioned Throughput. Let's break down how they work and when to use each.</p>
<p>Here are the <mark>Performance Settings</mark> Options when Selecting Amazon EFS File system’s Throughput mode. (Image below)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738818902666/9c4e3459-2e2a-4010-a21c-6930704fc460.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-elastic-throughput-mode-default-and-aws-recommended"><strong><mark>Elastic Throughput Mode</mark> (Default and AWS Recommended)</strong></h2>
<h2 id="heading-how-it-works"><strong>How It Works</strong></h2>
<ul>
<li><p>Automatically scales throughput performance up or down to meet workload needs</p>
</li>
<li><p>No need to specify or provision throughput capacity</p>
</li>
<li><p>Pay only for the amount of metadata and data read or written</p>
</li>
<li><p>No accrual or consumption of burst credits</p>
</li>
</ul>
<h2 id="heading-best-for"><strong>Best For</strong></h2>
<ul>
<li><p>Spiky or unpredictable workloads</p>
</li>
<li><p>Performance requirements that are difficult to forecast</p>
</li>
<li><p>Applications that drive throughput at an average-to-peak ratio of 5% or less</p>
</li>
</ul>
<h2 id="heading-considerations"><strong>Considerations</strong></h2>
<ul>
<li><p>Available only for file systems using General Purpose performance mode</p>
</li>
<li><p>Simplifies management by eliminating the need for manual throughput adjustments</p>
</li>
</ul>
<h2 id="heading-bursting-throughput-mode"><strong><mark>Bursting Throughput Mode</mark></strong></h2>
<h2 id="heading-how-it-works-1"><strong>How It Works</strong></h2>
<ul>
<li><p>Baseline Throughput: Scales with storage size (50 KiB/s per GiB of data stored)</p>
</li>
<li><p>Burst Capability: Accumulate credits when below baseline, allowing temporary higher throughput</p>
</li>
</ul>
<h2 id="heading-best-for-1"><strong>Best For</strong></h2>
<ul>
<li><p>Variable workloads with occasional traffic spikes</p>
</li>
<li><p>Cost-efficient option for workloads not requiring sustained high throughput</p>
</li>
</ul>
<h2 id="heading-considerations-1"><strong>Considerations</strong></h2>
<ul>
<li><p>Monitor burst credits via Amazon CloudWatch (BurstCreditBalance)</p>
</li>
<li><p>Larger file systems (&gt;1 TiB) can sustain longer bursts</p>
</li>
</ul>
<h2 id="heading-provisioned-throughput-mode"><strong><mark>Provisioned Throughput Mode</mark></strong></h2>
<h2 id="heading-how-it-works-2"><strong>How It Works</strong></h2>
<ul>
<li><p>Manually define throughput (MiB/s) independent of storage size</p>
</li>
<li><p>Pay for storage fees + hourly charges for provisioned throughput</p>
</li>
</ul>
<h2 id="heading-best-for-2"><strong>Best For</strong></h2>
<ul>
<li><p>Steady, high-throughput needs</p>
</li>
<li><p>Predictable workloads requiring consistently high performance</p>
</li>
</ul>
<h2 id="heading-considerations-2"><strong>Considerations</strong></h2>
<ul>
<li><p>Use when baseline bursting limits are insufficient</p>
</li>
<li><p>Adjust provisioned throughput as needs change</p>
</li>
</ul>
<h2 id="heading-key-differences"><strong>Key Differences</strong></h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Factor</strong></td><td><strong>Elastic Throughput</strong></td><td><strong>Bursting Throughput</strong></td><td><strong>Provisioned Throughput</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Cost Model</td><td>Pay for read/write operations</td><td>Included with storage</td><td>Storage + hourly throughput fees</td></tr>
<tr>
<td>Performance</td><td>Automatically scales</td><td>Scales with storage size</td><td>Fixed, user-defined</td></tr>
<tr>
<td>Workload Type</td><td>Spiky/unpredictable</td><td>Variable with occasional spikes</td><td>Steady, high-demand</td></tr>
<tr>
<td>Complexity</td><td>Lowest (AWS manages scaling)</td><td>Low (AWS manages bursting)</td><td>Requires monitoring and adjustments</td></tr>
</tbody>
</table>
</div><h2 id="heading-how-to-choose"><strong>How to Choose</strong></h2>
<ol>
<li><p>Start with Elastic Throughput if:</p>
<ul>
<li><p>Your workload is unpredictable or spiky</p>
</li>
<li><p>You want simplified management and cost optimization</p>
</li>
</ul>
</li>
<li><p>Consider Bursting Throughput if:</p>
<ul>
<li><p>You have variable workloads with occasional spikes</p>
</li>
<li><p>Cost savings are a priority over guaranteed throughput</p>
</li>
</ul>
</li>
<li><p>Switch to Provisioned Throughput if:</p>
<ul>
<li><p>You need guaranteed throughput for latency-sensitive tasks</p>
</li>
<li><p>Your workload consistently requires high throughput</p>
</li>
</ul>
</li>
</ol>
<p>By aligning your EFS throughput mode with your application's needs, you can optimize both performance and costs.</p>
<p>Here's a summary of the key points:</p>
<ol>
<li><p>Elastic Throughput: Recommended for most workloads, especially those with unpredictable or spiky performance requirements.</p>
</li>
<li><p>Bursting Throughput: Suitable for variable workloads with occasional traffic spikes, offering a balance between cost and performance.</p>
</li>
<li><p>Provisioned Throughput: Ideal for steady, high-throughput needs and predictable workloads requiring consistently high performance.</p>
</li>
</ol>
<h2 id="heading-final-tips"><strong>Final Tips</strong></h2>
<ul>
<li><p>Utilize Amazon CloudWatch metrics to monitor your file system's performance, including throughput usage and, if applicable, burst credit balance.</p>
</li>
<li><p>During development, test different throughput modes to compare cost-effectiveness and performance for your specific workload<a target="_blank" href="https://aws.amazon.com/blogs/storage/performance-analysis-for-different-amazon-efs-throughput-modes-via-amazon-cloudwatch/">1</a>.</p>
</li>
<li><p>Keep in mind that you can switch between throughput modes, but there's a 24-hour waiting period before making another change.</p>
</li>
<li><p>For most use cases, start with Elastic Throughput as it automatically scales to meet workload needs without manual intervention.</p>
</li>
<li><p>If you're unsure about your application's peak throughput requirements or have very spiky workloads, Elastic Throughput is often the best choice.</p>
</li>
<li><p>Consider using Provisioned Throughput when you have a clear understanding of your workload's performance needs and require guaranteed throughput.</p>
</li>
</ul>
<p>By carefully considering these factors and leveraging the appropriate throughput mode, you can ensure that your Amazon EFS file system delivers optimal performance while maintaining cost efficiency for your specific use case.  </p>
<p>Adapted from the Amazon EFS Performance Guide: <a target="_blank" href="https://docs.aws.amazon.com/efs/latest/ug/performance.html">https://docs.aws.amazon.com/efs/latest/ug/performance.html</a></p>
<p>Hope you have enjoyed the Blog. Thank you for Reading.</p>
<p>Happy Learning.</p>
<p>Like and Follow for more Azure and AWS Content.</p>
<p>Thank you,<br /><a target="_blank" href="https://jineshkumar.bio.link/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Secure Temporary File Sharing in AWS S3 with pre-signed URLs: A Hands-On Guide]]></title><description><![CDATA[Why Presigned URLs Matter in the Real WorldImagine you're building a healthcare app where doctors need to securely access patient lab reports stored in a private S3 bucket. You don’t want to make the bucket public, but you need to grant time-limited ...]]></description><link>https://blog.jineshkumar.com/secure-temporary-file-sharing-in-aws-s3-with-pre-signed-urls-a-hands-on-guide</link><guid isPermaLink="true">https://blog.jineshkumar.com/secure-temporary-file-sharing-in-aws-s3-with-pre-signed-urls-a-hands-on-guide</guid><category><![CDATA[AWS]]></category><category><![CDATA[S3-bucket]]></category><category><![CDATA[S3]]></category><category><![CDATA[s3 presigned URL]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sat, 04 Jan 2025 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738807238384/85e07a50-0993-4863-83d8-abe0f6691a4a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Why Presigned URLs Matter in the Real World</strong><br />Imagine you're building a healthcare app where doctors need to securely access patient lab reports stored in a <em>private S3 bucket</em>. You don’t want to make the bucket public, but you need to grant time-limited access to specific files. Presigned URLs solve this by generating temporary, expiring links that authorize access to private S3 objects. Other use cases:</p>
<ul>
<li><p>Sharing confidential documents with clients.</p>
</li>
<li><p>Distributing time-sensitive media (e.g., concert recordings).</p>
</li>
<li><p>Allowing users to download purchased software securely.</p>
</li>
</ul>
<hr />
<h3 id="heading-how-to-grant-users-access-to-s3-objects">How to Grant Users Access to S3 Objects</h3>
<p>By default, all objects stored in Amazon S3 are private, meaning only the owner of the bucket has access to them. However, if you need to grant users access to specific buckets or objects without making them publicly available, you can do so by assigning the appropriate permissions through an IAM policy. Alternatively, you can use <strong>presigned URLs</strong> to provide temporary access without requiring users to have AWS credentials or IAM permissions.</p>
<h3 id="heading-so-why-to-use-presigned-urls">So Why to use Presigned URLs?</h3>
<p>A presigned URL is a time-limited URL that grants temporary access to a specific S3 object. These URLs allow users to either <strong>read</strong> or <strong>write</strong> (update) an object, depending on the permissions you configure. The URL includes specific parameters set by your application, ensuring controlled and secure access. These parameters include:</p>
<ul>
<li><p><strong>Bucket:</strong> The name of the bucket where the object is stored (or will be stored).</p>
</li>
<li><p><strong>Key:</strong> The name or path of the object.</p>
</li>
<li><p><strong>Expires:</strong> The duration for which the URL remains valid.</p>
</li>
</ul>
<p>Once the expiration time passes, the URL becomes invalid, and the user can no longer access the object. Importantly, presigned URLs are securely signed by the S3 bucket owner, ensuring that only authorized users can interact with the object during the specified time frame.</p>
<p><strong>Project Lab: Create and Test Presigned URLs</strong><br /><em>Objective</em>: Build a system to share private S3 objects securely and temporarily using pre-signed URLs.</p>
<p><strong>Prerequisites</strong>:</p>
<h3 id="heading-prerequisites-for-using-aws-s3-cp"><strong>Prerequisites for Using</strong> <code>aws s3 cp</code></h3>
<ol>
<li><strong>AWS CLI Installed</strong>:<br /> The AWS Command Line Interface (CLI) must be installed on your machine.</li>
</ol>
<ul>
<li><p>Installation instructions: <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">AWS CLI Installat</a><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">ion Guide.</a></p>
</li>
<li><p>Verify installation:</p>
<pre><code class="lang-bash">  <span class="hljs-comment"># Run to verify AWS CLI is installed </span>
  aws --version

  <span class="hljs-comment"># Configure AWS CLI with AWS Credential and Default Region. </span>
  aws configure
</code></pre>
</li>
<li><p>You’ll be prompted for:</p>
<ul>
<li><p><strong>AWS Access Key ID</strong>: Your IAM user’s access key.</p>
</li>
<li><p><strong>AWS Secret Access Key</strong>: Your IAM user’s secret key.</p>
</li>
<li><p><strong><em>Default</em> Region Name</strong>: The AWS region (e.g., <code>us-east-1</code>).</p>
</li>
<li><p><strong>Default Output Format</strong>: Optional (e.g. jason)</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">Verify configuration:</a></p>
<pre><code class="lang-bash">  cat ~/.aws/credentials  
  cat ~/.aws/config
</code></pre>
</li>
</ul>
<hr />
<h3 id="heading-step-1-create-an-s3-bucket-and-upload-a-test-filhttpsdocsawsamazoncomclilatestuserguideinstall-cliv2htmle"><strong>Step 1: Create an S3 Bu</strong><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html"><strong>cket and Upload a Test Fil</strong></a><strong>e</strong></h3>
<ol>
<li><p><strong>Create a private S3 bucket</strong>:</p>
<pre><code class="lang-bash"> aws s3api create-bucket --bucket your-unique-bucket-name --region us-east-1
</code></pre>
</li>
<li><p><strong>Upload a sample file</strong> (e.g., <code>medical-report.pdf</code>):</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">echo</span> <span class="hljs-string">"Confidential Patient Data"</span> &gt; medical-report.pdf  
 aws s3 cp medical-report.pdf s3://your-unique-bucket-name/
</code></pre>
</li>
</ol>
<h3 id="heading-step-2-generate-a-presigned-url-via-aws-cli"><strong>Step 2: Generate a Presigned URL via AWS CLI</strong></h3>
<p>Generate a URL that expires in <strong>5 minutes</strong> (300 seconds):</p>
<pre><code class="lang-bash">aws s3 presign s3://your-unique-bucket-name/medical-report.pdf --expires-in 300
</code></pre>
<pre><code class="lang-bash">https://your-unique-bucket-name.s3.amazonaws.com/medical-report.pdf?AWSAccessKeyId=...&amp;Signature=...&amp;Expires=...
</code></pre>
<h3 id="heading-step-3-generate-a-presigned-url-with-python-boto3"><strong>Step 3: Generate a Presigned URL with Python (Boto3)</strong></h3>
<ol>
<li><p><strong>Install Boto3</strong>:</p>
<pre><code class="lang-bash"> pip install boto3
</code></pre>
</li>
<li><p><strong>Python script</strong> (<code>generate_presigned_</code><a target="_blank" href="http://url.py"><code>url.py</code></a>):</p>
<pre><code class="lang-python"> <span class="hljs-keyword">import</span> boto3  
 <span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> timedelta  

 s3_client = boto3.client(<span class="hljs-string">'s3'</span>)  

 url = s3_client.generate_presigned_url(  
     ClientMethod=<span class="hljs-string">'get_object'</span>,  
     Params={  
         <span class="hljs-string">'Bucket'</span>: <span class="hljs-string">'your-unique-bucket-name'</span>,  
         <span class="hljs-string">'Key'</span>: <span class="hljs-string">'medical-report.pdf'</span>  
     },  
     ExpiresIn=<span class="hljs-number">300</span>  <span class="hljs-comment"># 5 minutes  </span>
 )  

 print(<span class="hljs-string">"Presigned URL:"</span>, url)
</code></pre>
</li>
<li><p><strong>Run the script</strong>:</p>
<pre><code class="lang-python"> python generate_presigned_url.py
</code></pre>
<p> When you run the script, it will generate a presigned URL that looks something like this:</p>
<p> plaintext</p>
<p> Copy</p>
<pre><code class="lang-bash"> Presigned URL: https://your-unique-bucket-name.s3.amazonaws.com/medical-report.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20231015%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20231015T123456Z&amp;X-Amz-Expires=300&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d
</code></pre>
<p> What Does This Mean?</p>
<ul>
<li><p><strong>URL Structure:</strong> The URL points to the <code>medical-report.pdf</code> file stored in the <code>your-unique-bucket-name</code> S3 bucket.</p>
</li>
<li><p><strong>Temporary Access:</strong> The URL is valid for <strong>5 minutes</strong> (as specified by <code>ExpiresIn=300</code>).</p>
</li>
<li><p><strong>Security:</strong> The URL includes a signature (<code>X-Amz-Signature</code>) and other parameters that ensure only authorized users can access the file during the specified time frame.</p>
</li>
</ul>
</li>
</ol>
<h3 id="heading-how-to-use-the-url">How to Use the URL</h3>
<ol>
<li><p>Copy the pre-signed URL and share it with the intended user.</p>
</li>
<li><p>The user can open the URL in a web browser or use it in a tool like <code>curl</code> or <code>wget</code> to download the file.</p>
</li>
<li><p>After 5 minutes, the URL will expire, and access to the file will be revoked.</p>
</li>
</ol>
<h3 id="heading-step-4-test-url-expiration"><strong>Step 4: Test URL Expiration</strong></h3>
<ol>
<li><p>Generate a URL with a <strong>10-second expiration</strong>:</p>
<pre><code class="lang-python"> aws s3 presign s3://your-unique-bucket-name/medical-report.pdf --expires-<span class="hljs-keyword">in</span> <span class="hljs-number">10</span>
</code></pre>
</li>
<li><p>Wait 15 seconds and try accessing the URL. You’ll see an <strong>HTTP 403 Forbidden</strong> error.</p>
</li>
</ol>
<h3 id="heading-step-5-security-best-practices"><strong>Step 5: Security Best Practices</strong></h3>
<ol>
<li><p><strong>Short Expiration Times</strong>: Use 5-15 minutes for most cases.</p>
</li>
<li><p><strong>HTTPS Only</strong>: Always generate presigned URLs with HTTPS.</p>
</li>
<li><p><strong>Restrict IAM Policies</strong>: Limit the IAM user/role to only <code>s3:GetObject</code> permissions.</p>
<pre><code class="lang-python"> {  
     <span class="hljs-string">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,  
     <span class="hljs-string">"Statement"</span>: [{  
         <span class="hljs-string">"Effect"</span>: <span class="hljs-string">"Allow"</span>,  
         <span class="hljs-string">"Action"</span>: <span class="hljs-string">"s3:GetObject"</span>,  
         <span class="hljs-string">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::your-unique-bucket-name/*"</span>  
     }]  
 }
</code></pre>
</li>
</ol>
<hr />
<p><strong>Conclusion</strong><br />Presigned URLs are a powerful way to securely share private S3 objects without exposing your bucket to the public. By following this guide, you’ve learned to generate URLs via CLI and SDK, test their expiration, and apply security best practices. Use this for secure document sharing, time-bound downloads, or even temporary access in serverless apps!</p>
<p>For more information and reference on this, please follow</p>
<ul>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html">AWS S3 Presigned URL Documentation</a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html"><strong>Download and upload objects with presigned URLs</strong></a></p>
</li>
<li><p><a target="_blank" href="https://aws.amazon.com/blogs/developer/generate-presigned-url-modular-aws-sdk-javascript/">Generate a presigned URL in modular AWS SDK for JavaScript</a></p>
</li>
</ul>
<p>I hope this Blog helps you understand Amazon S3 Presigned URLs' capabilities and gives you insights into the amazing new ways to share Temporary Files with Amazon S3 Objects.</p>
<p>For more information on this, please follow <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mountpoint.html"><strong>Working with Mountpoint for Amazon S3</strong></a></p>
<p>Thank you for the read. Hope you like it.<br />I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[S3 Bucket is Mounted using Mountpoint for Amazon S3]]></title><description><![CDATA[S3 Mountpoint Introduction
Mountpoint for S3 translates local file system API Calls to S3 Object API Calls. Presents Amazon S3 Objects as files in the local file system. Amazon S3 Mountpoint seamlessly integrates with Linux-based systems, allowing fi...]]></description><link>https://blog.jineshkumar.com/s3-bucket-is-mounted-using-mountpoint-for-amazon-s3</link><guid isPermaLink="true">https://blog.jineshkumar.com/s3-bucket-is-mounted-using-mountpoint-for-amazon-s3</guid><category><![CDATA[Amazon S3 Mountpoint]]></category><category><![CDATA[Amazon Web Services]]></category><category><![CDATA[S3]]></category><category><![CDATA[S3-bucket]]></category><category><![CDATA[mountpoint]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Tue, 05 Mar 2024 04:28:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709612687503/97176d5b-acab-4200-8e9b-27fa2ec08250.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-s3-mountpoint-introduction">S3 Mountpoint Introduction</h1>
<p>Mountpoint for S3 translates local file system API Calls to S3 Object API Calls. Presents Amazon S3 Objects as files in the local file system. Amazon S3 Mountpoint seamlessly integrates with Linux-based systems, allowing file-aware applications to connect directly to Amazon S3 buckets without the need for complex configurations or additional software.</p>
<p>In the realm of cloud storage solutions, Amazon Simple Storage Service (Amazon S3) stands tall as a reliable and scalable option for businesses of all sizes. Its flexibility, durability, and cost-effectiveness have made it a go-to choice for storing vast amounts of data securely in the cloud. However, integrating Amazon S3 with Linux/Windows server applications has often presented challenges, requiring additional tools and configurations. Enter <strong>Mountpoint for Amazon S3</strong>, an open-source file client that simplifies this process, enabling seamless connectivity between Application Servers and Amazon S3 buckets.</p>
<h3 id="heading-key-characteristics">Key Characteristics</h3>
<ul>
<li><p>Mountpoint for Amazon S3 boasts <strong>high performance</strong> and <strong>high throughput</strong></p>
</li>
<li><p><strong>Scalability</strong>: Whether you're dealing with small files or large datasets, Amazon S3 Mountpoint scales effortlessly to accommodate your storage operation needs, providing seamless access to Amazon S3 directly from your Compute instance.</p>
</li>
<li><p><strong>Cost-Effective</strong>: By eliminating the need for additional hardware or proprietary solutions, Amazon S3 Mountpoint helps reduce infrastructure costs associated with data storage and management.</p>
</li>
<li><p><strong>Reliability and Durability</strong>: Leveraging the robust infrastructure of Amazon S3, Amazon S3 Mountpoint offers high reliability and durability, with built-in redundancy and data protection mechanisms to safeguard against data loss or corruption.</p>
</li>
<li><p><strong>Encryption and Security</strong>: Amazon S3 Mountpoint prioritizes data security by supporting encryption in transit and at rest, ensuring that sensitive data remains protected throughout the transfer process.</p>
</li>
<li><p><strong>Use case:</strong> Mountpoint for Amazon S3 is ideal for workloads that read large datasets (terabytes to petabytes in size). Common use cases include large-scale machine learning (ML) training, autonomous vehicle simulation, genomics analysis, and image rendering. While these workloads read large datasets over several compute instances, they write sequentially to a file from a single node. This means they do not need shared file system features such as locking.</p>
</li>
</ul>
<p>Mountpoint for Amazon S3 serves as a bridge between Linux-based systems and Amazon S3 buckets, facilitating direct access to stored data without the need for complex configurations or additional software layers. By mounting S3 buckets as local filesystems, Mountpoint enables Linux applications to interact with S3 objects as if they were traditional files and directories, streamlining data management and enhancing compatibility.</p>
<p><strong>Note:</strong> For applications that require shared file system features such as file locking and POSIX permissions, you can use <a target="_blank" href="https://aws.amazon.com/fsx/lustre/">Amazon FSx for Lustre</a> with a <a target="_blank" href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/fsx-data-repositories.html">data repository association</a> to your S3 bucket.</p>
<p><strong>How it works</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709602977645/3200f66c-fc08-4c30-9e8d-b1cd5561e320.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-demo">Demo</h1>
<ol>
<li><p>Download the Mountpoint for the Amazon S3 package "mount-s3.rpm" .</p>
<pre><code class="lang-powershell"> <span class="hljs-built_in">wget</span> https://s3.amazonaws.com/mountpoint<span class="hljs-literal">-s3</span><span class="hljs-literal">-release</span>/latest/x86_64/<span class="hljs-built_in">mount</span><span class="hljs-literal">-s3</span>.rpm
</code></pre>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709604962023/9aa820c4-4128-4555-a840-9da116be2468.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Install the package by using the following command:</p>
<pre><code class="lang-powershell"> sudo yum install ./<span class="hljs-built_in">mount</span><span class="hljs-literal">-s3</span>.rpm
</code></pre>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709605753257/8c0cb2c2-0167-43fa-93c0-3738090ff871.png" alt class="image--center mx-auto" /></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709605956535/2922cefe-aef8-47ca-a74c-637f45b4a2ae.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Check the Mount S3 Version</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709606177498/c23c1957-7432-479d-b4bb-4898e0c5c679.png" alt class="image--center mx-auto" /></p>
<p> I have uploaded some .jpg files onto my S3 Bucket name "mountpoint-bucket"</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709610022834/ad39d857-3662-468e-86b6-82dd27eeb0c7.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>To use Mountpoint for Amazon S3, your host needs valid AWS credentials with access to the bucket or buckets that you would like to mount. For example, you can create a new AWS Identity and Access Management (IAM) user and role for this purpose. Make sure that this role has access to the bucket or buckets that you would like to mount.<br /> OR You can <a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html">pass the IAM role</a> <a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html">to your Amazon EC</a>2 instance with an instance profile. As shown below, I created a IAM Role that has access to S3 Bucket and have EC2 instance assume this role.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709607917579/8dec74e1-fdad-4251-bdb4-798ec1b2cfeb.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Run the mount-s3 command with s3 bucket ARN with instance mount directory</p>
<p> <code>run</code></p>
<p> <code>mkdir mntdir</code></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709608431166/486b46fb-0039-4ad1-8ee0-9481cd183485.png" alt class="image--center mx-auto" /></p>
<p> S3 BUCKET is MOUNTED using Mountpoint file client.</p>
</li>
<li><p>We can check the files (Objects) inside the S3 bucket directly from the mounted S3 mount point.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709608802909/2ef33f18-c4e3-4dce-b50e-5ba71bd92020.png" alt class="image--center mx-auto" /></p>
<p> from here, After you mount your bucket locally, you can use common Linux commands, such as <code>cat</code> or <code>ls</code>, to work with your S3 objects.</p>
</li>
</ol>
<p>Unmount your bucket by using the <code>umount</code> command. This command unmounts your S3 bucket and exits Mountpoint.</p>
<h3 id="heading-limitation-of-mountpoint">Limitation of Mountpoint</h3>
<p>\&gt; Unlike FUSE, Mountpoint mounts cannot be added to your fstab file so do not persist after stopping your machine. They need to be re-mounted each time the machine is restarted.</p>
<p>\&gt; Mountpoint for Amazon S3 is available only for Linux operating systems</p>
<p>\&gt; Mountpoint <strong>cannot access files archived in S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive tiers</strong>.</p>
<p>Here in this demo, I have used Mountpoint to access the existing S3 bucket mounted on Linux VM which contained image files which I can perform action against and Copy or push to S3 to my local mount directory and seamlessly push new images to S3 bucket using mountpoint.</p>
<p>Hope this Blog helps understand Amazon S3 Mountpoint capabilities and give you insights about the amazing new ways to connect with S3 from your Linux(Application) Instance.</p>
<p>For more information on this, please follow <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mountpoint.html">Working with Mountpoint for Amazon S3</a></p>
<p>Thank you for the read. Hope you like it.<br />I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Enabling or Disabling Detailed Monitoring for Amazon EC2 Instances]]></title><description><![CDATA[Monitoring your Amazon Elastic Compute Cloud (Amazon EC2) instances is crucial for ensuring optimal performance, identifying potential issues, and making informed decisions about resource management. One important aspect of monitoring is enabling det...]]></description><link>https://blog.jineshkumar.com/enabling-or-disabling-detailed-monitoring-for-amazon-ec2-instances</link><guid isPermaLink="true">https://blog.jineshkumar.com/enabling-or-disabling-detailed-monitoring-for-amazon-ec2-instances</guid><category><![CDATA[Detailed monitoring]]></category><category><![CDATA[monitoring]]></category><category><![CDATA[AWS]]></category><category><![CDATA[aws ec2]]></category><category><![CDATA[#CloudWatch]]></category><category><![CDATA[AWS Certified Solutions Architect Associate]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Mon, 26 Feb 2024 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709784943307/7af664c9-ff59-4ecb-9272-6fa2cec8bf73.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Monitoring your Amazon Elastic Compute Cloud (Amazon EC2) instances is crucial for ensuring optimal performance, identifying potential issues, and making informed decisions about resource management. One important aspect of monitoring is enabling detailed monitoring, which provides more granular metrics at shorter intervals. In this blog post, we'll explore how to enable or disable detailed monitoring for your Amazon EC2 instances using both the AWS Management Console and the AWS Command Line Interface (CLI).</p>
<h2 id="heading-detailed-monitoring-key-features">Detailed Monitoring Key Features</h2>
<p>AWS detailed monitoring offers several key features that provide enhanced visibility and insights into the performance of your Amazon EC2 instances. Some of the notable features include:</p>
<ol>
<li><p><strong>Granular Metrics</strong>: Detailed monitoring provides more granular metrics compared to basic monitoring. <strong>It collects data at a higher frequency (1-minute intervals) for a wide range of system-level metrics</strong>, including CPU utilization, disk I/O, network traffic, and more.</p>
</li>
<li><p><strong>Real-Time Visibility</strong>: With detailed monitoring, you get <strong>real-time visibility into the performance of your EC2 instances</strong>. The 1-minute data collection interval allows you to monitor changes and trends in system metrics with greater accuracy and responsiveness.</p>
</li>
<li><p><strong>Enhanced Analysis</strong>: Detailed monitoring enables you to perform <strong>in-depth analysis</strong> of your instance performance over short time intervals. This granularity is particularly useful for identifying performance spikes, bottlenecks, and other issues that may require immediate attention.</p>
</li>
<li><p><strong>Custom Alarms</strong>: You can create custom <strong>CloudWatch alarms based on detailed monitoring metrics to trigger notifications or automated actions when specific thresholds are breached.</strong> This allows you to proactively monitor and manage the health and performance of your EC2 instances.</p>
</li>
<li><p><strong>Billing and Cost Optimization</strong>: By leveraging detailed monitoring metrics, you can gain better insights into resource utilization patterns and optimize your EC2 instance usage to improve cost-effectiveness. This helps in identifying underutilized instances or instances with excessive resource consumption.</p>
</li>
<li><p><strong>Integration with AWS Services</strong>: Detailed monitoring metrics seamlessly integrate with other AWS services, such as Amazon CloudWatch, AWS CloudTrail, and AWS Config. This enables you to leverage the collected data for monitoring, troubleshooting, auditing, and compliance purposes across your AWS environment.</p>
</li>
<li><p><strong>Historical Analysis</strong>: Detailed monitoring provides historical data for up to 15 months, allowing you to analyze long-term trends and patterns in your EC2 instance performance. This historical perspective is valuable for capacity planning, performance optimization, and trend analysis.</p>
</li>
<li><p><strong>Flexible Monitoring Options</strong>: AWS offers flexible pricing options for detailed monitoring, allowing you to enable or disable it on a per-instance basis. This flexibility enables you to balance the level of monitoring granularity with cost considerations based on your specific requirements.</p>
</li>
</ol>
<h2 id="heading-using-aws-management-console"><strong>Using AWS Management Console</strong></h2>
<ol>
<li><p><strong>Sign in to AWS Management Console</strong>: Sign in to your AWS Management Console using your credentials.</p>
</li>
<li><p><strong>Navigate to Amazon EC2 Console</strong>: Navigate to the Amazon EC2 console by clicking on the "Services" dropdown menu and selecting "EC2" under the "Compute" section.</p>
</li>
<li><p><strong>Access Instances</strong>: In the navigation panel on the left-hand side, click on "Instances" under the "Instances" section.</p>
</li>
<li><p><strong>Select Instance</strong>: Select the Amazon EC2 instance that you want to examine from the list of instances displayed.</p>
</li>
<li><p><strong>Check Monitoring Configuration</strong>: On the selected Instance &gt; Select <strong>"Actions"</strong> &gt; Select the <strong>"Monitor and Troubleshoot"</strong> option and then &gt; Select <strong>"Manage Detailed Monitoring"</strong>.</p>
</li>
<li><p><strong>Enable</strong> Detailed Monitoring Checkbox configuration value to Enable.<br /> Similarly, Uncheck for Disable Detailed Monitoring.</p>
</li>
</ol>
<p>Save.</p>
<p><img src="https://static.us-east-1.prod.workshops.aws/public/7bfa1f53-fe95-42d4-ab43-f536c26d342a/static/images/monitoring/ec2_detail_mon.png" alt="ec2-detailed-monitoring" /></p>
<p><img src="https://static.us-east-1.prod.workshops.aws/public/7bfa1f53-fe95-42d4-ab43-f536c26d342a/static/images/monitoring/ec2_detail_mon1.png" alt="ec2-detailed-monitoring1" /></p>
<h2 id="heading-using-aws-cli"><strong>Using AWS CLI</strong></h2>
<ol>
<li><p>To enable or disable detailed monitoring for your Amazon EC2 instances using the AWS Command Line Interface (CLI), you can use the <code>aws ec2 monitor-instances</code> and <code>aws ec2 unmonitor-instances</code> commands respectively. Below are the steps to perform both operations:</p>
<h3 id="heading-enable-detailed-monitoring"><strong>Enable Detailed Monitoring:</strong></h3>
<ol>
<li><strong>List Instance IDs</strong>: First, you need to list the IDs of the Amazon EC2 instances for which you want to enable detailed monitoring. You can use the <code>describe-instances</code> command with custom filters to list the IDs.</li>
</ol>
</li>
</ol>
<pre><code class="lang-powershell">    bashCopy codeaws ec2 describe<span class="hljs-literal">-instances</span> \
      -<span class="hljs-literal">-region</span> &lt;your<span class="hljs-literal">-region</span>&gt; \
      -<span class="hljs-literal">-filters</span> Name=instance<span class="hljs-literal">-state</span><span class="hljs-literal">-name</span>,Values=running \
      -<span class="hljs-literal">-query</span> <span class="hljs-string">'Reservations[*].Instances[*].InstanceId'</span> \
      -<span class="hljs-literal">-output</span> text
</code></pre>
<p>    Replace <code>&lt;your-region&gt;</code> with the AWS region where your instances are located.</p>
<ol start="2">
<li><strong>Enable Detailed Monitoring</strong>: Once you have the instance IDs, you can enable detailed monitoring for them using the <code>monitor-instances</code> command.</li>
</ol>
<pre><code class="lang-powershell">    bashCopy codeaws ec2 monitor<span class="hljs-literal">-instances</span> \
      -<span class="hljs-literal">-instance</span><span class="hljs-literal">-ids</span> &lt;instance<span class="hljs-literal">-id</span><span class="hljs-literal">-1</span>&gt; &lt;instance<span class="hljs-literal">-id</span><span class="hljs-literal">-2</span>&gt; ... \
      -<span class="hljs-literal">-region</span> &lt;your<span class="hljs-literal">-region</span>&gt;
</code></pre>
<p>    Replace <code>&lt;instance-id-1&gt; &lt;instance-id-2&gt; ...</code> with the IDs of the instances you want to enable detailed monitoring for.</p>
<h3 id="heading-disable-detailed-monitoring"><strong>Disable Detailed Monitoring:</strong></h3>
<ol>
<li><p><strong>List Instance IDs</strong>: Similar to enabling, you need to list the IDs of the Amazon EC2 instances for which you want to disable detailed monitoring.</p>
</li>
<li><p><strong>Disable Detailed Monitoring</strong>: Use the <code>unmonitor-instances</code> command to disable detailed monitoring for the specified instances.</p>
</li>
</ol>
<pre><code class="lang-powershell">    bashCopy codeaws ec2 unmonitor<span class="hljs-literal">-instances</span> \
      -<span class="hljs-literal">-instance</span><span class="hljs-literal">-ids</span> &lt;instance<span class="hljs-literal">-id</span><span class="hljs-literal">-1</span>&gt; &lt;instance<span class="hljs-literal">-id</span><span class="hljs-literal">-2</span>&gt; ... \
      -<span class="hljs-literal">-region</span> &lt;your<span class="hljs-literal">-region</span>&gt;
</code></pre>
<p>    Replace <code>&lt;instance-id-1&gt; &lt;instance-id-2&gt; ...</code> with the IDs of the instances you want to disable detailed monitoring for.</p>
<h3 id="heading-example"><strong>Example:</strong></h3>
<p>    Let's say you want to enable detailed monitoring for an instance with ID <code>i-1234567890abcdef0</code> in the <code>us-east-1</code> region:</p>
<pre><code class="lang-powershell">    bashCopy codeaws ec2 monitor<span class="hljs-literal">-instances</span> \
      -<span class="hljs-literal">-instance</span><span class="hljs-literal">-ids</span> i<span class="hljs-literal">-1234567890abcdef0</span> \
      -<span class="hljs-literal">-region</span> us<span class="hljs-literal">-east</span><span class="hljs-literal">-1</span>
</code></pre>
<p>    To disable detailed monitoring for the same instance:</p>
<pre><code class="lang-powershell">    bashCopy codeaws ec2 unmonitor<span class="hljs-literal">-instances</span> \
      -<span class="hljs-literal">-instance</span><span class="hljs-literal">-ids</span> i<span class="hljs-literal">-1234567890abcdef0</span> \
      -<span class="hljs-literal">-region</span> us<span class="hljs-literal">-east</span><span class="hljs-literal">-1</span>
</code></pre>
<p>    By following these steps and using the appropriate CLI commands, you can easily enable or disable detailed monitoring for your Amazon EC2 instances.</p>
<p>In conclusion, enabling detailed monitoring for your Amazon EC2 instances is essential for gaining deeper insights into their performance, ensuring optimal resource utilization, and proactively managing your AWS environment. With its granular metrics, real-time visibility, custom alarm capabilities, and seamless integration with other AWS services, detailed monitoring empowers you to effectively monitor, analyze, and optimize the performance of your EC2 instances. Whether it's for cost optimization, troubleshooting, or capacity planning, detailed monitoring provides the necessary data and tools to make informed decisions and ensure the smooth operation of your AWS infrastructure. By leveraging detailed monitoring, you can enhance operational efficiency, improve resource utilization, and maintain the overall health and performance of your EC2 instances, ultimately contributing to a more reliable and scalable AWS environment.</p>
<p>Thank you for the read. Hope you like it. I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,</p>
<p><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Optimizing Storage Costs on AWS: A Comprehensive Guide]]></title><description><![CDATA[In today's digital landscape, efficient storage management is crucial for businesses of all sizes. With the increasing volume of data generated, stored, and processed, optimizing storage costs has become a top priority for organizations leveraging cl...]]></description><link>https://blog.jineshkumar.com/optimizing-storage-costs-on-aws-a-comprehensive-guide</link><guid isPermaLink="true">https://blog.jineshkumar.com/optimizing-storage-costs-on-aws-a-comprehensive-guide</guid><category><![CDATA[AWS s3]]></category><category><![CDATA[AWS]]></category><category><![CDATA[AWS Cost Optimization]]></category><category><![CDATA[AWS Certified Solutions Architect Associate]]></category><category><![CDATA[S3]]></category><category><![CDATA[ebs]]></category><category><![CDATA[ebs snapshots]]></category><category><![CDATA[Amazon EFS]]></category><category><![CDATA[cost-optimisation]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Mon, 19 Feb 2024 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709821430279/63a45a48-b68f-486e-b4ac-6941d3f790b0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In today's digital landscape, efficient storage management is crucial for businesses of all sizes. With the increasing volume of data generated, stored, and processed, optimizing storage costs has become a top priority for organizations leveraging cloud infrastructure. Amazon Web Services (AWS) offers a variety of tools and services to help businesses optimize their storage costs effectively. In this blog post, we'll explore key strategies and best practices for optimizing storage costs on AWS across three main areas: Storage Class, Lifecycle Management, and Data Reduction.</p>
<h3 id="heading-1-storage-class"><strong>1. Storage Class</strong></h3>
<p><strong>Amazon S3 Glacier Instant Retrieval</strong></p>
<p>Amazon S3 Glacier Instant Retrieval is designed for data archives that require immediate access. By leveraging this storage class, businesses can significantly reduce storage costs compared to standard S3 storage, while still ensuring fast retrieval times when needed.</p>
<p><strong>Amazon FSx for NetApp OnTap Single AZ</strong></p>
<p>Amazon FSx for NetApp OnTap Single AZ offers high-performance file storage optimized for enterprise workloads. With features like high availability and data deduplication, businesses can efficiently manage storage costs while meeting performance requirements.</p>
<h3 id="heading-2-lifecycle-management"><strong>2. Lifecycle Management</strong></h3>
<p><strong>Amazon S3 Intelligent Tiering</strong></p>
<p>Amazon S3 Intelligent Tiering automatically moves objects between two access tiers – <strong>frequent access and infrequent access</strong> – based on access patterns. This ensures that data is stored in the most cost-effective tier without sacrificing performance.</p>
<p><img src="https://d1.awsstatic.com/aws-storage/amazon-s3-intelligent-tiering-how-it-works-diagram.936ae9768ad84227feab5023c86432ce1aab4798.png" alt="How Amazon S3 Intelligent Tiering works with the automatic Access Tiers" /></p>
<p>More on S3 Storage Classes Intelligent Tiering <a target="_blank" href="https://aws.amazon.com/s3/storage-classes/intelligent-tiering/">here</a> .</p>
<p><img src="https://d1tcczg8b21j1t.cloudfront.net/strapi-assets/24_S3_intelligent_tiering_1_c2c89726c2.png" alt="S3 Intelligent Tiering: How it Helps to Optimize Storage Costs?" /></p>
<p>The graphics above is from <a target="_blank" href="https://www.stormit.cloud/blog/s3-intelligent-tiering-storage-class/">here</a>.</p>
<p><strong>Amazon EFS Intelligent Tiering</strong></p>
<p>Similar to Amazon S3 Intelligent Tiering, Amazon EFS Intelligent Tiering optimizes storage costs by automatically moving files to infrequent access storage classes based on access patterns. Choose a <strong>Transition into IA</strong> option to move infrequently accessed files to the IA storage classes. From the drop-down list, you can choose lifecycle policies of 7, 14, 30, 60, or 90 days. Additionally, choose a <strong>Transition out of IA</strong> option and select <strong>On first access</strong> to move files back to EFS Standard or EFS One Zone storage classes on access. This ensures that frequently accessed data is stored in the most cost-effective manner.</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2021/08/31/2021-efs-int-1.png" alt /></p>
<p>The screenshot above is taken from <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-amazon-efs-intelligent-tiering-optimizes-costs-for-workloads-with-changing-access-patterns/">here</a> credit to <a target="_blank" href="https://aws.amazon.com/blogs/aws/author/channy-yun/">Channy Yun</a>.</p>
<p><a target="_blank" href="https://aws.amazon.com/blogs/aws/author/channy-yun/">To disa</a>ble EFS Intelligent-Tiering, set both the <strong>Transition into IA</strong> and <strong>Transition out of IA</strong> options to <strong>None</strong>. This will disable lifecycle management, and your files will remain on the storage class they’re on.</p>
<p><strong>Amazon EBS Snapshots Archive</strong></p>
<p>Amazon EBS Snapshots Archive allows businesses to archive EBS snapshots to Amazon S3 Glacier, reducing storage costs while retaining data for long-term retention and compliance requirements.<br />Here's how Archive EBS Snapshot got created and put it into S3 Glacier.</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2021/11/18/2021-11-18_21-32-05.png" alt="New – Amazon EBS Snapshots Archive | AWS News Blog" /></p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2021/11/18/2021-11-18_21-32-17.png" alt="New – Amazon EBS Snapshots Archive | AWS News Blog" /></p>
<p>And restore Snapshot from Archive</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2021/11/18/2021-11-18_21-57-31.png" alt="New – Amazon EBS Snapshots Archive | AWS News Blog" /></p>
<p>Screenshots taken from <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-amazon-ebs-snapshots-archive/"><strong>Amazon EBS Snapshots Archive</strong></a> by <a target="_blank" href="https://aws.amazon.com/blogs/aws/author/stormacq/">Sébastien Stormacq</a></p>
<h3 id="heading-3-data-reduction"><strong>3. Data Reduction</strong></h3>
<p><strong>Compression and Deduplication on Amazon FSx Family Storage Data</strong></p>
<p>By enabling compression and deduplication on Amazon FSx family storage data, businesses can significantly reduce storage costs by eliminating redundant data and optimizing storage efficiency. Here is more about how to enable Deduplication is <a target="_blank" href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/using-data-dedup.html#enable-dedup">here</a>.</p>
<table><tbody><tr><td><p><strong>Enable-FSxDedup</strong></p></td><td><p>Enables data deduplication on the file share. Data compression after deduplication is enabled by default when you enable data deduplication.</p></td></tr></tbody></table>

<h3 id="heading-additional-strategies"><strong>Additional Strategies</strong></h3>
<ul>
<li><p><strong>Amazon S3 Storage Classes</strong>: Leveraging a combination of Amazon S3 storage classes, including Standard, Intelligent-Tiering, Glacier, and Glacier Deep Archive, based on data access patterns and performance requirements.</p>
</li>
<li><p><strong>Amazon S3 Lifecycle Policies</strong>: Implementing lifecycle policies to automatically transition objects to lower-cost storage classes or delete obsolete data based on predefined rules.</p>
</li>
<li><p><strong>Amazon EBS Volume Types</strong>: Selecting the appropriate EBS volume type (e.g., General Purpose SSD, Provisioned IOPS SSD, Cold HDD) based on performance requirements and cost considerations.</p>
</li>
<li><p><strong>AWS Data Transfer Optimization</strong>: Optimizing data transfer costs by using AWS Direct Connect or AWS DataSync for data transfer between AWS services and on-premises infrastructure.</p>
</li>
</ul>
<p>AWS S3 Pricing <a target="_blank" href="https://aws.amazon.com/s3/pricing/?gclid=CjwKCAiA6KWvBhAREiwAFPZM7qRGximtudNLtIhHRv9d7A8Mjss1a31kWeHfmnEEHDSNzeMT5rPsCxoCarUQAvD_BwE&amp;trk=fecf68c9-3874-4ae2-a7ed-72b6d19c8034&amp;sc_channel=ps&amp;ef_id=CjwKCAiA6KWvBhAREiwAFPZM7qRGximtudNLtIhHRv9d7A8Mjss1a31kWeHfmnEEHDSNzeMT5rPsCxoCarUQAvD_BwE:G:s&amp;s_kwcid=AL!4422!3!536456035337!p!!g!!aws%20s3%20data%20storage%20costs!11204620052!112938567274">here</a>.<br />AWS S3 Storage Classes <a target="_blank" href="https://aws.amazon.com/s3/storage-classes/?gclid=CjwKCAiA6KWvBhAREiwAFPZM7lSFqXOAs5FqQx_mjMZ009XUqqgR9dZ-Xid0nAwXZWeGX4qzeQ3_8BoCxGQQAvD_BwE&amp;trk=fecf68c9-3874-4ae2-a7ed-72b6d19c8034&amp;sc_channel=ps&amp;ef_id=CjwKCAiA6KWvBhAREiwAFPZM7lSFqXOAs5FqQx_mjMZ009XUqqgR9dZ-Xid0nAwXZWeGX4qzeQ3_8BoCxGQQAvD_BwE:G:s&amp;s_kwcid=AL!4422!3!536456035337!p!!g!!aws%20s3%20data%20storage%20costs!11204620052!112938567274">here</a>.<br />AWS S3 Pricing Calculator <a target="_blank" href="https://calculator.aws/#/">here</a>.</p>
<p>By implementing these strategies and leveraging AWS's comprehensive suite of storage optimization tools and services, businesses can effectively manage storage costs while ensuring performance, scalability, and data durability. As data continues to grow exponentially, optimizing storage costs on AWS remains a critical aspect of cloud infrastructure management.</p>
<p>In conclusion, optimizing storage costs on AWS requires a holistic approach that encompasses storage class selection, lifecycle management, data reduction techniques, and leveraging additional AWS services tailored to specific use cases and requirements. By following best practices and continuously monitoring and adjusting storage strategies, businesses can achieve significant cost savings while maintaining optimal performance and reliability for their storage workloads.</p>
]]></content:encoded></item><item><title><![CDATA[Selecting the "Right" Storage Solution on AWS]]></title><description><![CDATA[The AWS Well-Architected systems use multiple storage solutions and enable different features to improve performance and use resources efficiently.
The optimal storage solution for a system varies based on the following:

Type of access method (block...]]></description><link>https://blog.jineshkumar.com/selecting-the-right-storage-solution-on-aws</link><guid isPermaLink="true">https://blog.jineshkumar.com/selecting-the-right-storage-solution-on-aws</guid><category><![CDATA[S3]]></category><category><![CDATA[AWS]]></category><category><![CDATA[AWS Certified Solutions Architect Associate]]></category><category><![CDATA[storage]]></category><category><![CDATA[cost-optimisation]]></category><category><![CDATA[AWS Storage]]></category><category><![CDATA[Amazon EFS]]></category><category><![CDATA[Amazon Web Services]]></category><category><![CDATA[Amazon S3]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Mon, 12 Feb 2024 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709864171348/f3341142-c179-4041-b596-098a632e068b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The AWS Well-Architected systems use multiple storage solutions and enable different features to improve performance and use resources efficiently.</p>
<p>The optimal storage solution for a system varies based on the following:</p>
<ul>
<li><p>Type of access method (block, file, or object)</p>
</li>
<li><p>Patterns of access (random or sequential)</p>
</li>
<li><p>Required throughput</p>
</li>
<li><p>Frequency of access (online, offline, archival)</p>
</li>
<li><p>Frequency of update (WORM, dynamic)</p>
</li>
<li><p>Availability and durability constraints</p>
</li>
</ul>
<p>Characteristics such as <strong>shareable, file size, cache size, access patterns, latency, throughput, and persistence of data</strong>. Those characteristics can lead you toward the best storage solution, such as block storage, file storage, or object storage.</p>
<h3 id="heading-determine-storage-characteristics"><strong>Determine storage characteristics</strong></h3>
<p>When you evaluate a storage solution, determine the available storage characteristics, such as the following:</p>
<ul>
<li><p>Ability to share the storage</p>
</li>
<li><p>Ideal file size and maximum file size</p>
</li>
<li><p>Storage cache size</p>
</li>
<li><p>Average or expected latency</p>
</li>
<li><p>Maximum throughput</p>
</li>
<li><p>Maximum IOPS</p>
</li>
<li><p>Persistence of data</p>
</li>
</ul>
<p>Then match your requirements to the AWS service that best fits your needs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709835256924/0651ab64-9261-4772-bda1-6faf91b6b512.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-questions-to-help-determine-storage-requirements"><strong>Questions to help determine storage requirements</strong></h3>
<p>The following questions help you to segment data within each of your workloads and determine your storage requirements:</p>
<ul>
<li><p><strong>How often and how quickly do you need to access your data?</strong> AWS offers storage options and pricing tiers for frequently accessed, less frequently accessed, and infrequently accessed data.</p>
</li>
<li><p><strong>Does your data store require high IOPS or throughput?</strong> AWS provides categories of storage that are optimized for performance and throughput. Understanding IOPS and throughput requirements will help you provision the right amount of storage and avoid overpaying.</p>
</li>
<li><p><strong>What storage access protocols are required?</strong> Pre-existing applications are often developed based on specific operating systems. The operating system can affect the access protocol. For example, Linux-based applications that require file system access usually require NFS. Windows-based applications require SMB as the protocol.</p>
</li>
<li><p><strong>How critical (durable) is your data?</strong> Critical or regulated data needs to be retained at almost any expense and tends to be stored for a long time.</p>
</li>
<li><p><strong>How sensitive is your data?</strong> Highly sensitive data must be protected from accidental and malicious changes, not only data loss or corruption. Durability, cost, and security are equally important to consider.</p>
</li>
<li><p><strong>How large is your dataset?</strong> Knowing the total size of the dataset helps in estimating storage capacity and cost.</p>
</li>
<li><p><strong>How transient is your data?</strong> Transient data is short-lived and typically does not require high durability. (<strong>Note:</strong> Durability refers to average annual expected data loss.) Clickstream and Twitter data are good examples of transient data.</p>
</li>
<li><p><strong>How much are you prepared to pay to store the data?</strong> Setting a budget for data storage will inform your decisions about storage options.</p>
</li>
</ul>
<h3 id="heading-make-decisions-based-on-access-patterns-and-metrics"><strong>Make decisions based on access patterns and metrics</strong></h3>
<p>Choose storage systems based on your workload's access patterns. Configure them by determining how the workload accesses data. You can sometimes increase storage efficiency or increase a performance metric by choosing a different storage type. Configure the storage options you choose to match your data access patterns.</p>
<ul>
<li><p><strong>Optimize your storage usage and access patterns</strong> – Choose storage systems based on your workload's access patterns and the characteristics of the available storage options. Determine the best place to store data so that you can meet your requirements while reducing overhead. Use performance optimizations and access patterns when configuring and interacting with data based on the characteristics of your storage (for example, striping volumes or partitioning data).</p>
</li>
<li><p><strong>Select appropriate metrics for storage options</strong> – Ensure that you select the appropriate storage metrics for the workload. Each storage option offers various metrics to track how your workload performs over time. Make sure that you are measuring against any storage metrics indicating peak performance and trends. For storage systems that are fixed sized, such as Amazon Elastic Block Store (Amazon EBS) or Amazon FSx, ensure that you are monitoring the amount of storage used against the overall storage size. Create automation when possible to increase the storage size when reaching a threshold.</p>
</li>
<li><p><strong>Monitor metrics</strong> – Amazon CloudWatch can collect metrics across the resources in your architecture. You can also collect and publish custom metrics to surface business metrics or derived metrics. Use CloudWatch or third-party solutions to set alarms that indicate when thresholds are breached.</p>
</li>
</ul>
<p>For additional information, see <a target="_blank" href="https://docs.aws.amazon.com/wellarchitected/latest/performance-efficiency-pillar/storage-architecture-selection.html">Storage Architecture Selection</a> in the <em>AWS Well-Architected Framework</em>.</p>
<p>Here is the Decision Tree illustrated below published by <a target="_blank" href="https://aws.plainenglish.io/choosing-where-to-store-your-data-in-aws-f5088f85c67d">Adi Simon</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1676314971038/2eaeb6e8-6aa8-47c2-b214-992d5f464121.webp" alt class="image--center mx-auto" /></p>
<p>AWS Storage Offerings</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709835174042/3c50c775-6385-45d1-be2f-c4ca9021b2ca.jpeg" alt class="image--center mx-auto" /></p>
<p>In conclusion, selecting the right storage solution in AWS is crucial for optimizing performance, cost, and resource utilization in your system architecture. Understanding the characteristics and requirements of your data, such as access patterns, throughput, durability, and sensitivity, is essential for making informed decisions about storage options.</p>
<p>By considering factors like access methods, frequency of access, and data persistence, you can match your storage needs to the appropriate AWS service, whether it's block storage, file storage, or object storage. Additionally, leveraging AWS metrics and monitoring tools like CloudWatch allows you to track performance, trends, and usage patterns, enabling you to optimize storage usage and make data-driven decisions for your workload. By following these best practices and principles, you can design a well-architected storage infrastructure that meets your business needs efficiently and effectively on AWS.</p>
<p>Thank you for the read. Hope you like it. I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,</p>
<p><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Exploring the World of AWS Storage Gateway]]></title><description><![CDATA[In the realm of cloud computing, efficient storage solutions are paramount for businesses seeking scalable, cost-effective, and reliable data management. AWS Storage Gateway emerges as a pivotal tool in this landscape, offering a bridge between on-pr...]]></description><link>https://blog.jineshkumar.com/exploring-the-world-of-aws-storage-gateway</link><guid isPermaLink="true">https://blog.jineshkumar.com/exploring-the-world-of-aws-storage-gateway</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS Storage]]></category><category><![CDATA[AWS Storage gateway]]></category><category><![CDATA[#AWSCostOptimization #CloudManagement #EBSAutomation #AWSStorage #CloudCostSavings #AutomationInCloud #AWSBestPractices #OptimizeStorage #CloudEfficiency #AWSLambda #EBSsnapshots]]></category><category><![CDATA[gateway]]></category><category><![CDATA[AWS Certified Solutions Architect Associate]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Mon, 05 Feb 2024 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709947409052/ec6e0360-20bd-432b-9f32-aeb7bcf258c5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the realm of cloud computing, efficient storage solutions are paramount for businesses seeking scalable, cost-effective, and reliable data management. AWS Storage Gateway emerges as a pivotal tool in this landscape, offering a bridge between on-premises environments and the vast storage capabilities of Amazon Web Services (AWS). Let's dive into the diverse offerings of AWS Storage Gateway and how they empower businesses to seamlessly integrate cloud storage into their operations.</p>
<p><strong>Introduction to AWS Storage Gateway</strong></p>
<p>AWS Storage Gateway is a hybrid cloud storage service that enables businesses to securely integrate their on-premises applications with AWS cloud storage services. By providing a range of gateway options, AWS Storage Gateway accommodates various use cases and data storage requirements, facilitating smooth data transfer between on-premises environments and AWS.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709946415823/3b36435a-2aa4-4b54-9f2b-0cb944f8aa33.png" alt class="image--center mx-auto" /></p>
<p><strong>The Four Types of Gateways</strong></p>
<ol>
<li><p><strong>Amazon S3 File Gateway:</strong> This gateway offers a seamless connection to the cloud, allowing organizations to store application data files and backup images as durable objects in Amazon S3. With support for SMB or NFS-based access and local caching, Amazon S3 File Gateway ensures efficient data transfer and accessibility.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709946588953/21a85bcb-2619-4055-94fc-456646fca482.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Amazon FSx File Gateway:</strong> Designed for customers with unstructured or file data, Amazon FSx File Gateway optimizes on-premises access to fully managed, highly reliable file shares in Amazon FSx for Windows File Server. This gateway caters to low-latency requirements, providing seamless integration with SMB-based group shares and business applications.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709946660073/a36a4bcc-db6e-410b-8dde-11f0284b3a7d.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Volume Gateway:</strong> Volume Gateway presents cloud-backed iSCSI block storage volumes to on-premises applications, offering scalable and cost-effective storage solutions. With operating modes such as cache mode or stored mode, Volume Gateway efficiently manages on-premises data in Amazon S3, ensuring data availability and durability.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709946694311/26b3461c-9b1e-445b-a77f-87948df1ebfd.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>Tape Gateway:</strong> Tape Gateway simplifies data backup workflows by replacing physical tapes on premises with virtual tapes in AWS. Supporting leading backup applications and caching virtual tapes on-premises, Tape Gateway ensures low-latency data access while seamlessly integrating with existing backup processes.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709946728714/0351a396-4080-4b90-9f61-0cab6f828515.png" alt class="image--center mx-auto" /></p>
<p> Use Tape Gateway to replace physical tapes on premises with virtual tapes on AWS—reducing your data storage costs without changing your tape-based backup workflows. Tape Gateway supports all leading backup applications and caches virtual tapes on premises for low-latency data access. It compresses your tape data, encrypts it, and stores it in a virtual tape library in Amazon Simple Storage Service (Amazon S3). From there, you can transfer it to either Amazon S3 Glacier Flexible Retrieval or Amazon S3 Glacier Deep Archive to help minimize your long-term storage costs.</p>
</li>
</ol>
<p><strong>Benefits of AWS Storage Gateway</strong></p>
<ul>
<li><p><strong>Scalability:</strong> AWS Storage Gateway scales effortlessly to accommodate changing data storage needs, allowing businesses to expand their storage capacity as required.</p>
</li>
<li><p><strong>Cost-Effectiveness:</strong> By leveraging AWS's pay-as-you-go pricing model, businesses can optimize storage costs and eliminate the need for upfront hardware investments.</p>
</li>
<li><p><strong>Data Security:</strong> With robust encryption and access controls, AWS Storage Gateway ensures the security and integrity of data during transit and at rest, providing peace of mind to businesses.</p>
</li>
<li><p><strong>Seamless Integration:</strong> AWS Storage Gateway seamlessly integrates with existing on-premises environments and AWS services, enabling smooth data transfer and management across hybrid cloud architectures.</p>
</li>
<li><p><strong>Fully Managed Cache:</strong> The local gateway appliance maintains a cache of recently written or read data so your applications can have low-latency access to data that is stored durably in AWS. The gateways use a read-through and write-back cache, committing data locally, acknowledging the write operations, and then asynchronously copying data to AWS, reducing application la</p>
</li>
</ul>
<p><strong>Use Cases of AWS Storage Gateway</strong></p>
<ul>
<li><p><strong>Hybrid cloud workflows store:</strong> File data as objects using data generated by on-premises applications for processing by AWS services such as machine learning or big data analytics.</p>
</li>
<li><p><strong>Migrate application data to EBS:</strong> Use a snapshot of your on-premises volumes to recreate the data on EBS and use with Amazon EC2-based applications.</p>
</li>
<li><p><strong>Back up data to the cloud:</strong> Provide cloud-based backup for on-premises files and database applications for low-cost, virtually unlimited scale.</p>
</li>
</ul>
<p><strong>Conclusion</strong></p>
<p>As businesses navigate the complexities of modern data storage and management, AWS Storage Gateway emerges as a versatile solution to bridge the gap between on-premises environments and the cloud. With its diverse array of gateway options and seamless integration capabilities, AWS Storage Gateway empowers organizations to embrace the benefits of cloud storage while maintaining flexibility, scalability, and cost-efficiency. Embrace the power of AWS Storage Gateway and unlock new possibilities in data storage and management for your business.</p>
<p>Thank you for the read. I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[S3 Bucket Object Ownership: Explained]]></title><description><![CDATA[Amazon S3 (Simple Storage Service) is a popular cloud storage service provided by Amazon Web Services (AWS). It allows users to store and retrieve any amount of data, at any time and from anywhere on the web. S3 buckets are the basic unit of storage ...]]></description><link>https://blog.jineshkumar.com/s3-bucket-object-ownership-explained</link><guid isPermaLink="true">https://blog.jineshkumar.com/s3-bucket-object-ownership-explained</guid><category><![CDATA[AWS]]></category><category><![CDATA[S3]]></category><category><![CDATA[Amazon S3]]></category><category><![CDATA[file-permission]]></category><category><![CDATA[Object ownership]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Wed, 15 Mar 2023 20:47:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1678913145148/d4f6ae52-86b4-42ab-801b-2cfed859e67b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Amazon S3 (Simple Storage Service) is a popular cloud storage service provided by Amazon Web Services (AWS). It allows users to store and retrieve any amount of data, at any time and from anywhere on the web. S3 buckets are the basic unit of storage in S3, and they can contain an unlimited number of objects. In this blog, we will discuss <strong>S3 bucket object ownership</strong> and its significance.</p>
<p><strong>In Amazon S3, objects are owned by the AWS account that was used to upload the object to a bucket.</strong> By default, the owner of a bucket has full control over the bucket, and every objects (i.e., a files) stored in a bucket. Including the ability to delete it and modify its access controls. Moreover, the owner of a bucket can grant other AWS accounts or users permission to access and manage the objects in the bucket.</p>
<p><mark>This is important because it allows the </mark> <strong><mark>owner</mark></strong> <mark> to manage the security of their objects and ensure that only authorized users have access to them</mark>.</p>
<p>For example, consider a scenario where an AWS user named Alice has an S3 bucket called "unique-bucket-name" and she has stored several objects in it. Alice is the owner of these objects, so she has the ability to manage their access controls, delete them, and take other actions as needed when she is logged in into AWS Console using her Access. If another AWS user named Bob tries to access one of Alice's objects without permission, Alice can use the access controls on the object to prevent Bob from accessing it.</p>
<h3 id="heading-controlling-ownership-of-objects-and-disabling-acls-for-your-bucket">Controlling ownership of objects and disabling ACLs for your bucket</h3>
<h3 id="heading-acls-disabled-recommended"><strong>ACLs Disabled (Recommended)</strong></h3>
<ul>
<li><p>When ACLs are disabled and bucket owner enforcement is enabled (which is recommended), the bucket owner automatically becomes the owner of every object in the bucket and has full control over them.</p>
</li>
<li><p>With this setting, ACLs no longer determine access control for data in the S3 bucket. Access control policies are used instead to define who can access the bucket and its contents.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678905983686/62227279-a5d5-4d8c-8c33-6f840a20e988.png" alt class="image--center mx-auto" /></p>
<p><strong>ACL is disabled</strong>. Object Ownership is handled by Bucket Policies. "Edit" Grayed out.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678911054920/54b981b4-9fa5-4ee1-be31-3817daae8505.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-how-bucket-policy-work-important">How <mark>Bucket Policy</mark> work? (Important)</h3>
<p>Amazon S3 offers two types of policies, <mark>bucket,</mark> and <mark>user</mark> policies, which allow or deny permissions to different resources. A policy consists of the following elements,</p>
<p><em>Resources</em> – Resources refer to the Amazon S3 entities to that permissions can be granted or denied to. i.e. Buckets, objects, access points, and jobs</p>
<p><em>Actions</em> – Actions are the operations that can be performed on Amazon S3 resources. allow or deny.</p>
<p><em>Effect –</em> Effect determines whether a user is allowed or denied the action requested. If you do not explicitly grant access to (allow) a resource, access is implicitly denied.</p>
<p><em>Principal</em> – Principal is the entity or user that is being granted or denied permission to access the resources or perform the actions.</p>
<p><em>Condition</em> – Conditions specify the circumstances under which the policy is in effect and can be used to restrict access based on factors such as time or IP address.</p>
<p>For <strong>example</strong>, The following example bucket policy allows Dave, a user in account Account-ID, s3:GetObject, s3:GetBucketLocation, and s3:ListBucket Amazon S3 permissions on the awsexamplebucket1 bucket.</p>
<pre><code class="lang-apache">{
   "<span class="hljs-attribute">Version</span><span class="hljs-string">": "</span><span class="hljs-number">2012</span>-<span class="hljs-number">10</span>-<span class="hljs-number">17</span><span class="hljs-string">",
   "</span>Statement<span class="hljs-string">": [
      {
         "</span>Sid<span class="hljs-string">": "</span>Only <span class="hljs-literal">allow</span> writes to my bucket with bucket owner full control<span class="hljs-string">",
         "</span>Effect<span class="hljs-string">": "</span><span class="hljs-literal">Allow</span><span class="hljs-string">",
         "</span>Principal<span class="hljs-string">": {
            "</span>AWS<span class="hljs-string">": [
               "</span>arn:aws:iam::<span class="hljs-number">111122223333</span>:user/ExampleUser<span class="hljs-string">"
            ]
         },
         "</span>Action<span class="hljs-string">": [
            "</span>s<span class="hljs-number">3</span>:PutObject<span class="hljs-string">"
         ],
         "</span>Resource<span class="hljs-string">": "</span>arn:aws:s<span class="hljs-number">3</span>:::DOC-EXAMPLE-BUCKET/*<span class="hljs-string">",
         "</span>Condition<span class="hljs-string">": {
            "</span>StringEquals<span class="hljs-string">": {
               "</span>s<span class="hljs-number">3</span>:x-amz-acl<span class="hljs-string">": "</span>bucket-owner-full-control<span class="hljs-string">"
            }
         }
      }
   ]
}</span>
</code></pre>
<h3 id="heading-acls-enabled"><strong>ACLs enabled</strong></h3>
<ul>
<li><p><strong>Bucket owner preferred</strong> – The bucket owner owns and has full control over new objects that other accounts write to the bucket with the <code>bucket-owner-full-control</code> canned ACL.</p>
</li>
<li><p><strong>Object writer (default)</strong> – The AWS account that uploads an object owns the object, has full control over it, and can grant other users access to it through ACLs.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678907919728/8675c3c8-dcc9-4896-ac7f-e1e76aaf489b.png" alt class="image--center mx-auto" /></p>
<p><strong>Object Ownership - Bucket Owner Preferred with</strong> <strong>ACL Enabled</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678910656661/006edcd7-ecde-4ba9-b1b2-fd314ab66216.png" alt class="image--center mx-auto" /></p>
<p><strong>Object Ownership - Object Writer with ACL Enabled</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678911697407/4ee497b4-446b-4029-8076-7262a046a012.png" alt class="image--center mx-auto" /></p>
<p>This represents How editing ACL for list/read/write as per the requirement for Objects and Bucket ACL settings and enforce to related grantees for access Including other AWS Account.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678911970744/f9bc974a-8b9e-46ee-902a-3455b6e44bbc.png" alt class="image--center mx-auto" /></p>
<p><strong>Requiring the bucket-owner-full-control canned ACL for Amazon S3 PUT operations (in Object ownership - bucket owner preferred)</strong></p>
<p>When you enable the bucket owner preferred setting for Object Ownership, Bucket Owner have full control over the new objects that other accounts write to your bucket. If they use the "bucket-owner-full-control" canned ACL, you will be the owner of those objects. <mark>But, if they don't use this canned ACL</mark>, they will still have full control access. <mark>To prevent this</mark>, you can create a bucket policy that only allows writes with the "bucket-owner-full-control" canned ACL.</p>
<p>Example,<br />The following bucket policy specifies that account <code>111122223333</code> can upload objects to <code>DOC-EXAMPLE-BUCKET</code> only when the object's ACL is set to <code>bucket-owner-full-control</code>. Be sure to replace <code>111122223333</code> with your account and <code>DOC-EXAMPLE-BUCKET</code> with the name of your bucket.</p>
<pre><code class="lang-apache">{
   "<span class="hljs-attribute">Version</span><span class="hljs-string">": "</span><span class="hljs-number">2012</span>-<span class="hljs-number">10</span>-<span class="hljs-number">17</span><span class="hljs-string">",
   "</span>Statement<span class="hljs-string">": [
      {
         "</span>Sid<span class="hljs-string">": "</span>Only <span class="hljs-literal">allow</span> writes to my bucket with bucket owner full control<span class="hljs-string">",
         "</span>Effect<span class="hljs-string">": "</span><span class="hljs-literal">Allow</span><span class="hljs-string">",
         "</span>Principal<span class="hljs-string">": {
            "</span>AWS<span class="hljs-string">": [
               "</span>arn:aws:iam::<span class="hljs-number">111122223333</span>:user/ExampleUser<span class="hljs-string">"
            ]
         },
         "</span>Action<span class="hljs-string">": [
            "</span>s<span class="hljs-number">3</span>:PutObject<span class="hljs-string">"
         ],
         "</span>Resource<span class="hljs-string">": "</span>arn:aws:s<span class="hljs-number">3</span>:::DOC-EXAMPLE-BUCKET/*<span class="hljs-string">",
         "</span>Condition<span class="hljs-string">": {
            "</span>StringEquals<span class="hljs-string">": {
               "</span>s<span class="hljs-number">3</span>:x-amz-acl<span class="hljs-string">": "</span>bucket-owner-full-control<span class="hljs-string">"
            }
         }
      }
   ]
}</span>
</code></pre>
<p>This table shows the impact that each Object Ownership setting has on ACLs, objects, object ownership, and object uploads.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678906630387/da6836a4-63b0-46f7-89d2-c340a2f19ccd.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>If you use S3 Versioning, the bucket owner owns and has full control over all object versions in your bucket. Applying the bucket owner enforced setting does not add a new version of an object.</p>
</blockquote>
<p>Example, Using the AWS Command Line Interface (AWS CLI) s3api <code>put-object</code> operation includes the <code>bucket-owner-full-control</code> canned ACL, the object can be uploaded to a bucket with disabled ACLs.</p>
<pre><code class="lang-apache"><span class="hljs-attribute">aws</span> s<span class="hljs-number">3</span>api put-object --bucket DOC-EXAMPLE-BUCKET --key key-name --body path-to-file --acl bucket-owner-full-control
</code></pre>
<h2 id="heading-changes-introduced-by-disabling-acls"><strong>Changes introduced by disabling ACLs</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678909836736/665344a7-68e4-44bc-97f5-b08f64196b54.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-references-to-learn-more">References to learn more,</h3>
<ol>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html"><strong>Controlling ownership of Objects and Disabling ACLs for your bucket.</strong></a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/ensure-object-ownership.html#ensure-object-ownership-bucket-policy"><strong>Disabling CLs for all new Buckets and enforcing Object Ownership.</strong></a></p>
</li>
<li><p><a target="_blank" href="https://aws.amazon.com/blogs/aws/heads-up-amazon-s3-security-changes-are-coming-in-april-of-2023/">Heads-Up: Amazon S3 Security Changes Are Coming in April of 2023</a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html">Policies and Permissions in Amazon S3</a></p>
</li>
</ol>
<h3 id="heading-upcoming-changes-starting-april-2023"><strong>Upcoming changes starting April 2023</strong></h3>
<p><strong><mark>"Bucket owner enforced setting"</mark></strong> will be enabled for newly created buckets, making bucket ACLs and object ACLs ineffective, and ensuring that the bucket owner is the object owner no matter who uploads the object."</p>
<p>A subsequent attempt to set a bucket policy or an access point policy that grants public access will be rejected with a 403 Access Denied error.</p>
<p><strong><mark>"S3 Block Public Access"</mark></strong> – All four of the bucket-level settings will be enabled for newly created buckets.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678907662440/b673501d-9029-4263-a6be-988b469334cf.png" alt class="image--center mx-auto" /></p>
<p><strong><mark>The Bucket owner-enforced</mark></strong> setting will soon be enabled, which means that bucket and object ACLs will no longer be effective. This change is intended to ensure that the bucket owner is always the object owner, regardless of who uploads the object. If you wish to enable ACLs for a bucket, you will need to set the ObjectOwnership parameter to ObjectWriter in your CreateBucket request or call DeleteBucketOwnershipControls after creating the bucket. Please note that s3:PutBucketOwnershipControls permission will be required in order to use the parameter or function.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678906479799/884f8aef-550d-4fcb-8fc2-6a07b21dfd0c.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678908148922/bb2c746b-e5b4-4c9b-8754-018c83fd9a22.png" alt class="image--center mx-auto" /></p>
<p>I hope this blog provides an understanding of S3 Bucket Ownership, along with practical examples and screen capture references, to help you gain a better understanding of the topic. Also, some references to read and learn more.  </p>
<p>Thank you for the read. Hope you like it. I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,</p>
<p><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Top Storage Announcements at AWS re:Invent 2022]]></title><description><![CDATA[This blog is about AWS re:Invent 2022's exciting Storage related updates and Announcements regarding EFS, S3, Failover Controls, and AWS Backup.
Amazon EFS Elastic Throughput
"Use this mode for workloads with unpredictable I/O. With Elastic mode, you...]]></description><link>https://blog.jineshkumar.com/top-storage-announcements-at-aws-reinvent-2022</link><guid isPermaLink="true">https://blog.jineshkumar.com/top-storage-announcements-at-aws-reinvent-2022</guid><category><![CDATA[Amazon S3]]></category><category><![CDATA[S3]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Amazon Web Services]]></category><category><![CDATA[reInvent]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sun, 11 Dec 2022 07:49:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670744857905/pZCZoHMke.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This blog is about AWS re:Invent 2022's exciting Storage related updates and Announcements regarding EFS, S3, Failover Controls, and AWS Backup.</p>
<h2 id="heading-amazon-efs-elastic-throughput">Amazon EFS Elastic Throughput</h2>
<p><mark>"Use this mode for workloads with unpredictable I/O. With Elastic mode, your throughput scales automatically and you only pay for what you use".</mark></p>
<p>Amazon EFS (Elastic File System) is a service that provides fully elastic and serverless <strong>file storage</strong>. While creating Amazon EFS (Elastic File System), a New performance Setting is been introduced in Throughput Mode as <strong>Amazon EFS Elastic Throughput Mode.</strong></p>
<p>It is a new pay-as-you-use throughput mode for Amazon EFS that provides applications with as much throughput as they need. This mode is designed for dynamic and unpredictable workloads with difficult-to-forecast performance requirements. When enabled, Elastic Throughput actively manages file system performance and prevents over-payment for idle resources, ensuring optimal performance for applications.</p>
<p>Enabling Elastic Throughput eliminates the need to specify or provision throughput capacity, as Amazon EFS automatically delivers the required throughput performance. Customers only pay for the amount of data read or written.</p>
<p>With Elastic Throughput, Amazon EFS simplifies and extends its performance capabilities, allowing customers to use it for a wider range of file workloads. Amazon EFS is well suited for a variety of use cases, such as analytics, data science, machine learning, CI/CD tools, content management, web serving, and SaaS applications. Amazon EFS Elastic Throughput is available in all regions except for the AWS China regions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670708143245/_lm-3J4vP.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-failover-controls-for-amazon-s3-multi-region-access-points"><strong>Failover Controls for Amazon S3 Multi-Region Access Points</strong></h1>
<p><a target="_blank" href="https://aws.amazon.com/s3/features/multi-region-access-points/">Amazon S3 Multi-Region Access Points</a> provide a global endpoint for accessing S3 buckets in multiple AWS regions. This feature allows for the creation of multi-region applications using the same simple architecture as in a single region.</p>
<p>The Multi-Region Access Point uses <a target="_blank" href="https://aws.amazon.com/global-accelerator/">AWS Global Accelerator</a> to monitor network congestion and connectivity and routes traffic to the closest copy of the data.</p>
<p>If connectivity is lost between a client and a bucket in a particular region, the Multi-Region Access Point will automatically route traffic to the closest bucket (synchronized via S3 Replication) in another region.</p>
<p><strong><mark>Failover controls for Multi-Region Access Points </mark></strong> <mark>allow users to shift S3 data access request traffic routed through a Multi-Region Access Point to an alternate AWS region within minutes</mark>. This allows users to test and build highly available applications for business continuity.</p>
<p>The existing Multi-Region Access Point model treats all regions as active and can send traffic to any of them. The new model introduced at AWS re:Invent allows users to designate regions as either active or passive. Buckets in active regions receive traffic (GET, PUT, and other requests) from the Multi-Region Access Point, while buckets in passive regions do not. Amazon S3 Cross-Region Replication operates regardless of the active or passive status of a region concerning a particular Multi-Region Access Point.</p>
<p><a target="_blank" href="https://s3.console.aws.amazon.com/s3/get-started?region=us-east-1">Amazon S3</a> &gt; <a target="_blank" href="https://s3.console.aws.amazon.com/s3/mraps?region=us-east-1">Multi-Region Access Points</a> &gt; <strong>Create Multi-Region Access Point</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670712020725/j1OEEt7d_.png" alt class="image--center mx-auto" /></p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/09/mrap_create_top_1.png" alt class="image--center mx-auto" /></p>
<p>"By default, my new Multi-Region Access Point routes traffic to all of the buckets, and behaves as it did before we launched this new feature. However, I can now exercise control over routing and failover. I click on the Multi-Region Access Point, and on the <strong>Replication and failover</strong> tab (which used to be just a <strong>Replication</strong> tab). The map now allows me to see my replication rules and my failover status:" (Source from Author: <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-failover-controls-for-amazon-s3-multi-region-access-points/">Jeff Barr</a> )</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/11/mrap_rep_map_1.png" alt class="image--center mx-auto" /></p>
<p>The tab for <strong>failover configuration (NEW)</strong>: (source from Author: <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-failover-controls-for-amazon-s3-multi-region-access-points/">Jeff Barr</a> )</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/09/mrap_map_fc_1.png" alt class="image--center mx-auto" /></p>
<p>"To change my failover configuration, I select the buckets of interest and click <strong>Edit failover configuration.</strong> My application runs in the Asia Pacific (Tokyo) Region and makes use of a bucket there, so I leave the Tokyo Region active and make the others passive:" (Source from Author: <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-failover-controls-for-amazon-s3-multi-region-access-points/">Jeff Barr</a> )</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/09/mrap_edit_foc_4.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-new-for-aws-backup-protect-and-restore-your-cloudformation-stacks">New for AWS Backup – Protect and Restore Your CloudFormation Stacks</h1>
<p>AWS Backup is a service offered by Amazon Web Services (AWS) that provides automated backups for AWS resources. The new feature allows users to protect and restore their <a target="_blank" href="https://aws.amazon.com/cloudformation/">CloudFormation</a> stacks using AWS Backup.</p>
<p>CloudFormation is a service that allows users to create and manage infrastructure as code, and the ability to protect and restore these stacks using AWS Backup provides added security and resilience for users of the service.</p>
<p>When you use <mark>AWS Backup to protect your CloudFormation stacks, it creates a backup of all the stateful resources</mark> in the stack, such as Amazon Elastic Compute Cloud (Amazon EC2) instances and Amazon Elastic Block Store (Amazon EBS) volumes, at the same time. <mark>The backup also includes the stateless resources</mark> in the stack, such as IAM roles and Amazon VPC security groups, allowing you to restore the entire stack to its previous state if necessary.</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/16/backup-cloudformation-settings-1024x418.png" alt="Console screenshot." /></p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/01/backup-cloudformation-on-demand-1004x1024.png" alt="Console screenshot." /></p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/01/backup-cloudformation-jobs-1024x373.png" alt="Console screenshot." /></p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/01/backup-cloudformation-composite-recovery-points-1024x502.png" alt="Console screenshot." /></p>
<p>Above Images source from <a target="_blank" href="https://aws.amazon.com/blogs/aws/new-for-aws-backup-protect-and-restore-your-cloudformation-stacks/">here.</a></p>
<p>There is no additional cost for the stateless resources backed up and restored by AWS Backup. You only pay for the stateful resources such as databases, storage volumes, or file systems. For more information, see <a target="_blank" href="https://aws.amazon.com/backup/pricing/">AWS Backup pricing</a>.</p>
<h1 id="heading-amazon-redshift-supported-in-aws-backup">Amazon Redshift Supported in AWS Backup</h1>
<p><strong>Amazon Redshift</strong> is a fully managed, cloud-based data warehousing service offered by AWS. <mark>AWS Backup allows users to automate the process of creating backups of their Amazon Redshift clusters</mark>, and provides options for scheduling these backups and setting retention policies.<br />AWS Backup &gt; Settings &gt; Configure Resources &gt; Redshift - new</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670742123211/OoNyZIukl.png" alt class="image--center mx-auto" /></p>
<p>There is no additional cost for using AWS Backup compared to the native snapshot capability of Amazon Redshift. Overall costs depend on the amount of storage and retention you choose. For more information, see <a target="_blank" href="https://aws.amazon.com/backup/pricing/">AWS Backup pricing</a>.</p>
<h1 id="heading-automated-in-aws-failback-for-aws-elastic-disaster-recovery">Automated in-AWS Failback for AWS Elastic Disaster Recovery</h1>
<p><strong>Automated in-AWS failback</strong> for AWS Elastic Disaster Recovery (AWS EDR) is a feature that <mark>allows users to automatically fail back to their original primary AWS Region after a disaster recovery event</mark>. <strong>When a disaster occurs</strong>, AWS EDR automatically fails over to a specified secondary AWS Region to keep applications running. <strong>After the disaster has been resolved</strong> and the original primary AWS Region is available again, the automated in-AWS failback feature automatically fails back to the primary AWS Region, allowing users to resume normal operation in their primary environment. This helps to simplify the disaster recovery process and reduce downtime for applications.</p>
<p><strong>AWS Elastic Disaster Recovery (AWS EDR)</strong> is a service that helps users to protect their applications and data from disasters by maintaining a constant replication posture for their operating systems, applications, and databases.</p>
<p><strong>AWS EDR</strong> automatically fails over to a specified secondary AWS Region in the event of a disaster, allowing users to keep their applications running. The service now supports in-AWS failback, which allows users to automatically fail back to their primary AWS Region after the disaster has been resolved, as well as existing support for non-disruptive recovery drills and on-premises failback. This helps users to simplify the disaster recovery process and reduce downtime for their applications.</p>
<p><strong>Failover vs. Failback</strong></p>
<p><strong>Failover</strong> is switching the running application to another AZ or Region.</p>
<p><strong>Failback</strong> is the process of returning the application to the original AZ or Region.</p>
<p>Three Strages : 1. <mark>Preparation</mark> 2. <mark>Failover</mark> 3. <mark>Failback</mark> 4. <mark>Cleanup</mark></p>
<p>Let’s assume an incident occurs with an in-AWS application, so we initiate a failover to another AWS Region. When the issue has been resolved, we want to fail back to the original Region. The following animation illustrates the failover and failback processes. Source <a target="_blank" href="https://aws.amazon.com/blogs/aws/automated-in-aws-failback-for-aws-elastic-disaster-recovery/">here</a>.</p>
<p><img src="https://d2908q01vomqb2.cloudfront.net/da4b9237bacccdf19c0760cab7aec4a8359010b0/2022/11/17/DRS-AWS-Failover-and-Failback.gif" alt="Illustration of the failover and failback processes" /></p>
<p>Learn more about in-AWS failback with Elastic Disaster Recovery <a target="_blank" href="https://aws.amazon.com/disaster-recovery/">here</a>.</p>
<p>Those are Top Announcement regarding <strong><mark>Storage</mark></strong> in re:Invent this year(2022)</p>
<p>There are tons more announcements and exciting features announce throughout the year but mainly during re:invent. To keep up to date with AWS news, follow <a target="_blank" href="https://aws.amazon.com/blogs/aws/"><strong>AWS News Blog</strong></a><strong>.</strong></p>
<p>Thank you for the read. Hope you like it.<br />I appreciate your time.</p>
<p>Follow for more Azure and AWS Content. Happy Learning!</p>
<p>Regards,<br /><a target="_blank" href="https://www.linkedin.com/in/jineshkumarpatel/"><strong>Jineshkumar Patel</strong></a></p>
]]></content:encoded></item><item><title><![CDATA[Keep Your Amazon S3 Buckets Secure: 
Top Tips and Best Practices]]></title><description><![CDATA[Introduction
Amazon S3 (Simple Storage Service) is a cloud storage service provided by Amazon Web Services (AWS). S3 buckets are used to store and manage data in the cloud. S3 provides a simple and highly scalable way to store and retrieve large amou...]]></description><link>https://blog.jineshkumar.com/keep-your-amazon-s3-buckets-secure-top-tips-and-best-practices</link><guid isPermaLink="true">https://blog.jineshkumar.com/keep-your-amazon-s3-buckets-secure-top-tips-and-best-practices</guid><category><![CDATA[Amazon S3]]></category><category><![CDATA[AWS]]></category><category><![CDATA[awssecurity]]></category><category><![CDATA[AWS s3]]></category><category><![CDATA[S3]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sat, 10 Dec 2022 08:10:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670658911477/FYO2NmoID.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>Amazon S3 (Simple Storage Service) is a cloud storage service provided by Amazon Web Services (AWS). S3 buckets are used to store and manage data in the cloud. S3 provides a simple and highly scalable way to store and retrieve large amounts of data from anywhere on the internet. This makes it a useful service for a wide range of applications, including data storage, backup and recovery, and disaster recovery.</p>
<p><strong>S3 bucket security</strong> is very important for sensitive and confidential data stored in those storage buckets. Securing the data stored in S3 buckets from unauthorized access, accidental deletion, and other potential threats. Therefore, it is essential to ensure that the data stored in S3 is properly secured to protect against unauthorized access and other potential security risks.</p>
<h3 id="heading-tips-for-securing-your-s3-buckets">Tips for securing your S3 buckets</h3>
<ul>
<li><p><strong><mark>Enable versioning</mark></strong> <mark>to keep track of changes to your data</mark></p>
</li>
<li><p><strong><mark>Use encryption</mark></strong> <mark>to protect your data while in transit and at rest</mark></p>
<ul>
<li><p><strong>Server-Side Encryption</strong> – Request Amazon S3 to encrypt your object before saving it on disks in its data centers and then decrypt it when you download the objects.</p>
<ul>
<li>To configure server-side encryption, see <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/specifying-kms-encryption.html">Specifying server-side encryption with AWS KMS (SSE-KMS)</a> or <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/specifying-s3-encryption.html">Specifying Amazon S3 encryption</a>.</li>
</ul>
</li>
<li><p><strong>Client-Side Encryption</strong> – Encrypt data client-side and upload the encrypted data to Amazon S3. In this case, you manage the encryption process, the encryption keys, and related tools.</p>
<ul>
<li><p>To configure client-side encryption, see <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingClientSideEncryption.html">Protecting data using client-side encryption</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670634931304/MlKwFLWTM.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
</li>
<li><p><mark>Limit access to your S3 buckets using </mark> <strong><mark>Bucket policies</mark></strong> <mark>and </mark> <strong><mark>IAM policies</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670636730934/TdeEGFipK.png" alt class="image--center mx-auto" /></p>
<p><strong>Bucket Policy</strong></p>
<ul>
<li><p>AWS has given an easy way to generate S3 Bucket Policy as shown <a target="_blank" href="https://awspolicygen.s3.amazonaws.com/policygen.html">here</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670639523308/e1MBnO_y6.png" alt class="image--center mx-auto" /></p>
<p>AWS Console &gt; S3 &gt; Select Bucket &gt; Permissions &gt; Bucket Policy &gt; Edit</p>
<blockquote>
<p>Sample Bucket Policy</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670638809960/na1zt-Hws.jpg" alt class="image--center mx-auto" /></p>
<p>"<a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html">Principles"</a> &gt; "Effect" &gt; "<a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations.html">Actions</a>" &gt; "Resource" : S3 Bucket / Object / *</p>
<p><a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html">Principles</a>: Specifies whom the statement covers (Acc/Role/User/Srvs)<br /><strong>Effect</strong>: Specifies whether the policy results in "deny" or "allow"<br /><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations.html">Actions</a>: Specifies the actions that is/are being denied or allowed.</p>
<p><strong>Resource</strong>: Specifies which AWS Resource the Policy Applies to. S3 Bucket</p>
<p>Now, this Bucket Policy can be applied to a Bucket as needed.</p>
</blockquote>
<p><strong>IAM Policy</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670637069039/VUYpBg-id.png" alt class="image--center mx-auto" /></p>
<p>/AWS Console &gt; Security &amp; Identity &gt; IAM &gt; Create Policy</p>
<blockquote>
<p>Sample IAM Policy</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670638104651/-0Z_Icyeb.png" alt class="image--center mx-auto" /></p>
<p>"Effect" -- &gt; "<a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations.html">Action</a>" --&gt; "Resource" : S3 Bucket / Object / * (all)</p>
<p><strong>Effect</strong>: Specifies whether the policy results in "deny" or "allow"<br /><a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations.html">Actions</a>: Specifies the actions that is/are being denied or allowed.</p>
<p><strong>Resource</strong>: Specifies which AWS Resource the Policy Applies to. S3 Bucket / Object / *</p>
<p>Now, this IAM Policy can be applied to IAM User or IAM Role as needed.</p>
</blockquote>
<p>Additionally, We can add a Condition element to these IAM/Bucket Policies</p>
<blockquote>
<p>"Condition" : {<br />"<code>{condition-operator}</code>" : { "<code>{condition-key}</code>" : "<code>{condition-value}</code>" }}<br />"Condition": {<br />"StringEquals": {"aws:PrincipalTag/job-category": "iamuser-admin"}</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670640200150/X5Ktr4ilV.jpg" alt class="image--center mx-auto" /></p>
<p>Policy Example with Condition :</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670640121704/rNi06ooX-.jpg" alt class="image--center mx-auto" /></p>
</blockquote>
</li>
</ul>
</li>
<li><p><strong><mark>AWS S3 Block Public Access</mark></strong></p>
<ul>
<li><p>AWS applies protection by default against all accidental public access by Blocking all Public Access as a default setting while creating a Bucket.</p>
</li>
<li><p>This provides protection to permissions from ACL, Bucket Policy, or both.</p>
<p>At account Level</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670660223756/-Vv2TzN2K.png" alt class="image--center mx-auto" /></p>
<p>At Bucket Level:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670642533656/-7jy2aaaD.png" alt /></p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="heading-monitor-and-audit-access-to-your-s3-buckets">Monitor and audit access to your S3 buckets</h3>
<ul>
<li><p>Access Analyzer for S3</p>
<ul>
<li><p>It analyzes permissions for all Buckets in a particular AWS Region.</p>
</li>
<li><p>And Provides a Dashboard to show findings from public buckets and buckets shared with external users or accounts.</p>
</li>
</ul>
</li>
<li><p>Access Analyzer reviews all Bucket Policies, Access Control Lists, Access Point Policy, and Block all Public Access Settings to produce findings.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670643476293/_kAeo47OS.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-best-practices-for-s3-bucket-security"><strong>Best practices for S3 bucket security</strong></h3>
<ul>
<li><p>S3 Bucket Names are Globally UNIQUE (i.e. No two S3 buckets can have the same name Globally). Use unique and complex names for your S3 buckets to prevent unauthorized access.</p>
<ul>
<li><p>To prevent Brut Force attacks and prevent Malicious Actor to find out your S3 Bucket Name, It is important to choose a name that is complex and not easily guessable to prevent unauthorized access to your bucket.</p>
</li>
<li><p>This means avoiding using simple names or common words, and instead using a combination of letters, numbers, and special characters to make the bucket name more difficult to guess.</p>
</li>
</ul>
</li>
<li><p>Use multi-factor authentication for your AWS account to add an extra layer of security</p>
</li>
<li><p>Regularly review and update your IAM policies and bucket policies to ensure they are up to date.</p>
<ul>
<li><p>Amazon S3 uses Identity and Access Management (IAM) policies and bucket policies to control access to your S3 buckets and the objects they contain. These policies specify who is allowed to access your S3 resources and what actions they are allowed to perform on them. It is important to regularly review and update these policies to ensure they are up to date and still reflect your desired access control settings.</p>
</li>
<li><p>For example, if you have added new users to your AWS account, you will need to update your IAM policies to grant them access to your S3 resources. Similarly, if you have changed the way your data is organized in S3, you may need to update your bucket policies to reflect the new structure. Regularly reviewing and updating your IAM and bucket policies will help ensure that only authorized users have access to your S3 resources and that they can only perform the actions you have explicitly allowed.</p>
</li>
</ul>
</li>
<li><p>Use Amazon S3 ACLs to control access to specific objects in your S3 buckets</p>
<ul>
<li><p>In addition to using IAM policies and bucket policies to control access to your Amazon S3 resources, you can also use Access Control Lists (ACLs) to fine-tune access to specific objects within your S3 buckets. An S3 ACL is a set of rules that define who can access an individual object and what actions they are allowed to perform on it.</p>
</li>
<li><p>For example, you could use an S3 ACL to allow certain users to read an object but not write to it, or to allow public access to an object while preventing delete operations. This allows you to have more granular control over access to your S3 objects, enabling you to fine-tune your security settings as needed.</p>
</li>
<li><p>You can ensure that only authorized users have access to your S3 objects and that they can only perform the actions you have explicitly allowed.</p>
</li>
</ul>
</li>
<li><p>Keep Public Buckets in a Dedicated AWS Account.</p>
<ul>
<li>This will prevent any possibilities of public access to your S3 Bucket Data on Private Buckets by enabling "Block All Public Access" at AWS Account Level as it's in a separate AWS Account and Public Buckets are in a separate AWS Account.</li>
</ul>
</li>
<li><p>Run and Review Access Analyzer for S3 to see any Access Vulnerabilities and Findings can be analyzed and corrected.</p>
</li>
<li><p>Use Encryption at Rest for each S3 Bucket in your Account.</p>
<ul>
<li><p>Use Amazon S3-managed Keys (SSE-S3) - Free for all Buckets at least.</p>
</li>
<li><p>There are other Options for Encryption like "AWS KMS keys (SSE-KMS) with Customer Managed Keys" and "AWS KMS keys (SSE-KMS) with AWS Managed Key" to choose from.</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>There are several ways to secure an S3 bucket and the data it contains, including the following:</p>
<ul>
<li><p>Use access control lists (ACLs) to specify which users and groups are allowed to access the bucket and the types of actions they can perform. This can help prevent unauthorized access to the bucket and its contents.</p>
</li>
<li><p>Enable versioning on the bucket to protect against accidental deletion or overwriting of objects. This allows you to recover previous versions of objects if they are deleted or modified.</p>
</li>
<li><p>Enable server-side encryption for the bucket to protect the data stored in it. This encrypts the data at rest, so that it cannot be read by unauthorized users.</p>
</li>
<li><p>Use Amazon S3 bucket policies to define additional security controls for the bucket, such as requiring SSL/TLS for all connections to the bucket or restricting access to the bucket based on the source IP address of the request.</p>
</li>
<li><p>Monitor and log access to the bucket to identify potential security issues and to track who is accessing the bucket and its contents. This can help you detect and respond to potential security threats.</p>
<p>By implementing these security measures, you can help protect your S3 bucket and the data it contains from unauthorized access and other potential security risks.</p>
</li>
</ul>
<p>Thank you for reading and/or following along with the Blog.</p>
<p>Happy Learning.</p>
<p>Like and Follow for more Azure and AWS Content.</p>
<p>Regards,</p>
<p>Jineshkumar Patel</p>
]]></content:encoded></item><item><title><![CDATA[How to get started with AWS S3 CLI Commands]]></title><description><![CDATA[The AWS Command Line Interface is a unified tool that provides a consistent interface for interacting with all parts of AWS.  
This Blog explains frequently used concepts and commands for S3 CLI Tasks. 
It is widely used to save time, and customize a...]]></description><link>https://blog.jineshkumar.com/how-to-get-started-with-aws-s3-cli-commands</link><guid isPermaLink="true">https://blog.jineshkumar.com/how-to-get-started-with-aws-s3-cli-commands</guid><category><![CDATA[AWS]]></category><category><![CDATA[Amazon S3]]></category><category><![CDATA[S3]]></category><category><![CDATA[Amazon Web Services]]></category><category><![CDATA[S3 CLI]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Thu, 20 Oct 2022 13:00:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1666247375197/KywyrjPfE.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/index.html">The AWS Command Line</a> Interface is a unified tool that provides a consistent interface for interacting with all parts of AWS.  </p>
<p>This Blog explains frequently used concepts and commands for <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/reference/s3/">S3 CLI</a> Tasks. 
It is widely used to save time, and customize and automate S3 Storage Tasks.  </p>
<p>Let's Dive-In,  </p>
<ul>
<li>Install AWS CLI by following up <a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">here</a>, as per your OS and Processor.</li>
<li>Now, it’s time to configure the AWS profile. Use “AWS configure” 
It will need Admin User's (AdministratorAccess) AWS Access Key ID: and AWS Secret Access Key:<br />(find your credentials under  AWS console &gt; IAM &gt; Users &gt; Create/Choose your Admin User &gt;  Under Security Credentials tab &gt; Create Access Key (Securely Save this .cve file)
And put those key info in the prompt for "AWS configure" sign in on AWS CLI. Example,<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1665204883481/CV914yBZd.png" alt="screely-1665204869768.png" />
I am in, verified by "aws s3 ls"  command which listed available S3 buckets with its creation date and time.  </li>
</ul>
<p>Now We will go to list all useful commands for <strong>S3 CLI</strong> which will be useful to save you time, and automate S3 Storage operations with customization options.  </p>
<p>Note : <strong>Assume your local directory and Your unique S3 Bucket Names </strong>respectively in below examples and screenshots.  </p>
<h3 id="heading-aws-s3-copy-aws-s3-cp">AWS S3 Copy : <strong>aws s3 cp</strong></h3>
<p>Copy local file or S3 object to another S3 bucket or locally    </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666145962758/nyVjS3dTN.png" alt="screely-1666145945182.png" /></p>
<pre><code># Copying a local file to S3
aws s3 cp test.txt  s3:<span class="hljs-comment">//mybucket/test2.txt</span>

# Copying a file <span class="hljs-keyword">from</span> S3 to S3
aws s3 cp s3:<span class="hljs-comment">//mybucket/test.txt  s3://mybucket/test2.txt</span>
# Copying an S3 object to a local file
aws s3 cp s3:<span class="hljs-comment">//mybucket/test.txt  G:\test2.txt</span>
# Copying an S3 object <span class="hljs-keyword">from</span> one bucket to another
aws s3 cp s3:<span class="hljs-comment">//mybucket/test.txt  s3://mybucket2/</span>

# Setting the Access Control List (ACL) <span class="hljs-keyword">while</span> copying S3 object
aws s3 cp s3:<span class="hljs-comment">//mybucket/test.txt s3://mybucket/test2.txt --acl public-read-write</span>

# Recursively copying 
aws s3 cp s3:<span class="hljs-comment">//mybucket D:\testfolder --recursive</span>
aws s3 cp D:\testfolder  s3:<span class="hljs-comment">//mybucket/ --recursive </span>
aws s3 cp s3:<span class="hljs-comment">//mybucket/ s3://mybucket2/ --recursive</span>
</code></pre><h3 id="heading-aws-s3-list-aws-s3-ls">AWS S3 List : <strong>aws  s3  ls</strong></h3>
<p>List S3 objects and common prefixes under a prefix or all S3 buckets<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666202540781/HgRPUJy8l.png" alt="screely-1666202507831.png" /></p>
<pre><code># Lists all <span class="hljs-keyword">of</span> the buckets owned by the user
aws s3 ls
# Recursively list objects <span class="hljs-keyword">in</span> a bucket
aws s3 ls s3:<span class="hljs-comment">//mybucket --recursive</span>
# Recursively list objects <span class="hljs-keyword">in</span> a bucket <span class="hljs-keyword">with</span> human-readable
and summarize option 
aws s3 ls s3:<span class="hljs-comment">//mybucket --recursive --human-readable --summarize</span>
</code></pre><h3 id="heading-aws-s3-move-aws-s3-mv">AWS S3 Move : <strong>aws s3 mv </strong></h3>
<p>Move local file or S3 object to another S3 bucket or locally<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666241558100/9fLBG7LhA.png" alt="screely-1666241546692.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666241969996/vNanvZi2D.png" alt="screely-1666241950055.png" /></p>
<pre><code># Moves single/multi s3 object/s to a specified bucket 
- Changing the name <span class="hljs-keyword">of</span> the target bucket file optionally. 
aws s3 mv G:\test.txt  s3:<span class="hljs-comment">//mybucket/test2.txt</span>
# Move From local folder objects to move to s3 bucket 
aws s3 mv G:\testfolder  s3:<span class="hljs-comment">//mybucket/test2.txt</span>
# Move all Objects From one S3 Bucket to another S3 Bucket 
aws s3 mv s3:<span class="hljs-comment">//s3clibucket-1  s3://s3clibucket-2  --recursive</span>
# Moves all files but exclude some file <span class="hljs-keyword">with</span> specific extension
aws s3 mv G:\testfolder  s3:<span class="hljs-comment">//mybucket/ --recursive --exclude "*.jpg"</span>
</code></pre><h3 id="heading-create-an-s3-buckets-aws-s3-mb">Create an S3 buckets : <strong>aws s3 mb</strong></h3>
<p><strong>mb (Make Bucket) command creates a bucket.</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666242962665/4pTFZs6ZI.png" alt="screely-1666242941267.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666243183371/x-MKBT0s6.png" alt="screely-1666243171794.png" /></p>
<pre><code># Creates a bucket (Unique name <span class="hljs-keyword">in</span> <span class="hljs-keyword">default</span> region) 
aws s3 mb s3:<span class="hljs-comment">//myuniquenamebucket</span>
# Create a s3 bucket <span class="hljs-keyword">in</span> a specific Region
aws s3 mb s3:<span class="hljs-comment">//mybucket --region us-west-1</span>
</code></pre><h3 id="heading-generate-pre-sign-url-for-s3-object">Generate pre-sign URL for S3 Object:</h3>
<p><strong>aws s3 presign</strong> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666244100997/3BlXDySLJ.png" alt="screely-1666243991892.png" /></p>
<pre><code># s3 presign url (<span class="hljs-keyword">default</span> <span class="hljs-number">3600</span> seconds)
aws s3 presign s3:<span class="hljs-comment">//s3clibucket-1/test1.txt</span>
aws s3 presign s3:<span class="hljs-comment">//s3clibucket-2/test2.txt --expires-in 60</span>
</code></pre><h3 id="heading-to-delete-an-s3-bucket-aws-s3-rb">To delete an S3 bucket: <strong>aws s3 rb</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1666244984442/FqcgQeSQL.png" alt="screely-1666244720733.png" /></p>
<pre><code># Remove an empty bucket
aws s3 rb s3:<span class="hljs-comment">//mybucket</span>
# Remove all the objects forcefully <span class="hljs-keyword">in</span> the bucket and then remove
the bucket itself.
aws s3 rb s3:<span class="hljs-comment">//mybucket --force</span>
</code></pre><h3 id="heading-to-delete-s3-object-aws-s3-rm">To delete S3 object: <strong>aws s3 rm</strong></h3>
<pre><code># Delete an object <span class="hljs-keyword">from</span> S3 Bucket
aws s3 rm s3:<span class="hljs-comment">//mybucket/test2.txt</span>
# Recursively deletes all objects under a specified bucket
aws s3 rm s3:<span class="hljs-comment">//mybucket --recursive</span>
# Deletes all objects but excluding some objects
aws s3 rm s3:<span class="hljs-comment">//mybucket/ --recursive --exclude "*.jpg"</span>
aws s3 rm s3:<span class="hljs-comment">//mybucket/ --recursive --exclude "another/*"</span>
</code></pre><h3 id="heading-s3-static-website-configuration-for-bucket">S3 Static Website configuration for bucket:</h3>
<p><strong>aws s3 website</strong></p>
<pre><code># Configures a bucket name <span class="hljs-keyword">as</span> a <span class="hljs-keyword">static</span> website
aws s3 website s3:<span class="hljs-comment">//my-bucket/ --index-document</span>
index.html --error-<span class="hljs-built_in">document</span> error.html
</code></pre><h3 id="heading-to-sync-directories-and-s3-prefixes">To Sync directories and S3 prefixes:</h3>
<p><strong>aws s3 sync </strong></p>
<pre><code># Syncs objects <span class="hljs-keyword">with</span> S3 bucket to local directory
aws s3 sync G:\Testfolder  s3:<span class="hljs-comment">//mybucket</span>

# Syncs files between two buckets <span class="hljs-keyword">in</span> different regions
aws s3 sync s3:<span class="hljs-comment">//s3clibucket-1 s3://s3clibucket-2 --source-region us-west-2 --region us-east-1</span>

# Syncs objects under a two different buckets
aws s3 sync s3:<span class="hljs-comment">//s3clibucket-1 s3://s3clibucket-2</span>

# Sync but exclude objects <span class="hljs-keyword">with</span> specific extensionor directory
aws s3 sync G:\Testfolder  s3:<span class="hljs-comment">//s3clibucket-1 --exclude "*.jpg"</span>
aws s3 sync s3:<span class="hljs-comment">//s3clibucket-1/  G:\TestFolder --exclude "*another/*"</span>
</code></pre><p>With this blog, I hope it clears out the starter concepts with AWS S3 CLI Commands and encouraged you to try it out yourself. </p>
<p>Thank you for reading and/or following along with the Blog.</p>
<p>Happy Learning.</p>
<p>Like and Follow for more Azure and AWS Content.</p>
<p>Regards,<br /><a target="_blank" href="https://jineshkumar.bio.link/">Jineshkumar Patel</a></p>
]]></content:encoded></item><item><title><![CDATA[Amazon S3: Cross-Region Replication]]></title><description><![CDATA[This Blog is about Amazon S3 cross-region replication as a managed service available in AWS. With this Service, We can take our data and workloads global and maintain version control of our s3 objects. 
Reasons why we may need to copy our  data to re...]]></description><link>https://blog.jineshkumar.com/amazon-s3-cross-region-replication</link><guid isPermaLink="true">https://blog.jineshkumar.com/amazon-s3-cross-region-replication</guid><category><![CDATA[Amazon S3]]></category><category><![CDATA[S3]]></category><category><![CDATA[AWS]]></category><category><![CDATA[AWS Certified Solutions Architect Associate]]></category><category><![CDATA[Amazon Web Services]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Tue, 04 Oct 2022 16:01:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1664899043334/UK1RgZAcX.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This Blog is about Amazon S3 cross-region replication as a managed service available in AWS. With this Service, We can take our data and workloads global and maintain version control of our s3 objects. </p>
<h3 id="heading-reasons-why-we-may-need-to-copy-our-data-to-reside-in-more-than-one-aws-region">Reasons why we may need to copy our  data to reside in more than one AWS  region</h3>
<ol>
<li>Business Requirement or Compliance Reasons </li>
<li>Disaster Recovery Policy and in need to enhance the durability of Data</li>
<li>Need Second Copy in different S3 Storage Class / AWS Account / AWS Region for availability / latency or optimization reasons.<br />We can achieve all of the above objectives and more with S3 cross-region replication.  </li>
</ol>
<h3 id="heading-key-points-for-s3-cross-region-replication">Key points for S3 Cross Region Replication</h3>
<ul>
<li>When an object is replicated into another AWS region by default, all of the objects, metadata, access control lists and object tags are also replicated and any further changes made to the source objects,  metadata, access control list, or object tags also trigger replication to the destination. </li>
<li>We can choose to replicate entire Buckets OR Objects under a shared prefix only OR at the object level using certain object tags only replication.  </li>
<li>Additionally, We have added controls to change the ownership of the replicated object to a different AWS account to protect against accidental or malicious actions if the source account is compromised.</li>
<li>In 2020, AWS introduce,  S3 Replication (multi-destination) : It is intended for customers that want to create and maintain multiple copies of their data in one or more AWS Regions. Amazon S3 Replication now gives usthe ability to replicate data from one source bucket to multiple destination buckets in the same, or different AWS Regions.  </li>
<li>We can also configure S3 to store replicated data in any S3 storage class including S3 glacier irrespective of the storage class of the source objects to meet compliance requirements.  </li>
<li>Versioning must be enabled on both the source and destination bucket.  </li>
</ul>
<h3 id="heading-how-s3-replication-works">How S3 replication works</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664855856181/CA03SzE76.png" alt="image.png" /></p>
<h3 id="heading-how-to-set-up-s3-bucket-replication-and-its-options">How to set up S3 Bucket Replication and It's Options</h3>
<ol>
<li>Creating Two Buckets in S3<br />Source Region Bucket : s3replicationsource-us-east-1<br />Target Region Bucket : s3replicationtarget-us-west-1  </li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664856067373/FP1FvipjM.png" alt="image.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664856262910/qKIe4fo83.png" alt="image.png" /></p>
<ol>
<li>Create a Bucket Replication Rule<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664895986966/2IiGpbM8y.jpg" alt="Screenshot 2022-10-04 110535.jpg" /></li>
</ol>
<p><strong>Replication Rule Options :  </strong></p>
<ul>
<li>Choose the replication rule status to enable and the name of the replication rule. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896073120/VQ6C6XZsr.png" alt="image.png" /></li>
<li>Scope to Filter by Prefix , Tag or All Objects to replicate in Source Bucket.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896215360/GvWQ0LMvY.png" alt="image.png" /></li>
<li>Choose Destination Bucket. Option of Same Account or Different Account. I choose my previously created us-west-1 bucket in the same account.<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896398293/7D--PbdnH.png" alt="image.png" /></li>
<li>Create new IAM Role or use existing S3 Required permissions enabled IAM Role. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896558666/8C3P1ZB3j.png" alt="image.png" /></li>
<li>Choose if We want to enable "Encryption" on replication<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896703423/db78dleRA.png" alt="image.png" /></li>
<li>We can Choose the Destination Bucket Storage Class<br /><a target="_blank" href="https://aws.amazon.com/s3/storage-classes/">More on S3 Storage Classes</a> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896787554/e3c_oABzA.png" alt="image.png" /></li>
<li>Choose Appropriate Additional Option and Save<br />Options are for notification, monitoring, delete marker replication and modification sync related. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664896949727/nXA56rMrx.png" alt="image.png" /></li>
<li>One Time Popup Option to "Replicate Existing Objects" as a batch job when We save the Replication Rule.<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664897177505/yV1bJCFvB.png" alt="image.png" /></li>
<li>Our Replication Rule and Created and in Enabled State<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664897288436/gu_TU4eEJ.png" alt="image.png" /></li>
</ul>
<p>From this point forward, any objects added to my Source bucket (s3replicationsource-us-east-1) will be replicated to my Destination Bucket (s3replicationtarget-us-west-1).<br />And Not only that, Any modification, edit , overwrite, delete will be replication to destination bucket as well.  </p>
<p>Test :<br />Object "1.jpg" i uploaded to my Source Bucket (us-east-1) in Standard Storage Class is automatically Replicated to my Destination Bucket(us-west-1) in One-Zone Storage Class.  </p>
<p>Source Bucket<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664897538777/aXm-bxMK5.png" alt="image.png" />
Destination Bucket<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664897648191/L8K-4GiGb.png" alt="image.png" /></p>
<p>Delete Operations on Objects in Source Bucket is also replicated.<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664897784560/Sra0f_3Vl.png" alt="image.png" /></p>
<p>Additionally, 
Amazon S3 can publish replication events as in Event Notification.<br />Amazon S3 sends event notifications when an object fails replication, exceeds the 15-minute threshold, replicates after the 15-minute threshold, and misses tracking by replication metrics.  </p>
<p>In Source S3 Bucket Properties &gt; Select Event Notification &gt; Create Event Name and Type : Replication Event and Desitnation to SNS Topic
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664898076271/vqDjsuOuP.png" alt="image.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664898137665/GpeaLx0zN.png" alt="image.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1664898224167/cBCpGmA4c.png" alt="image.png" /></p>
<p>In this Blog, I showed how <strong>Amazon S3 replication</strong> is an easy, fully managed, a customizable and low-cost feature that replicates objects between buckets in Cross-Region (CRR) or Same-Region(SRR) Replication within same AWS Account or Separate AWS Account.<br />Anyone can use this solution to build a data redundancy capability to meet regulatory compliance, business continuity, and disaster recovery requirements.</p>
<p>Thank you for reading and following along with the Blog.</p>
<p>Happy Learning.</p>
<p>Like and Follow for more Azure and AWS Content.</p>
<p>Regards,<br /><a target="_blank" href="https://jineshkumar.bio.link/">Jineshkumar Patel</a></p>
]]></content:encoded></item><item><title><![CDATA[All you need to know about encrypting Amazon S3 buckets]]></title><description><![CDATA[Security is often a deciding factor when choosing a public cloud provider. Encryption of data at rest is increasingly required by industry protocols, government regulations, and internal organizational security standards. Encryption helps you protect...]]></description><link>https://blog.jineshkumar.com/all-you-need-to-know-about-encrypting-amazon-s3-buckets</link><guid isPermaLink="true">https://blog.jineshkumar.com/all-you-need-to-know-about-encrypting-amazon-s3-buckets</guid><category><![CDATA[Amazon S3]]></category><category><![CDATA[S3]]></category><category><![CDATA[encryption]]></category><category><![CDATA[Security]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Jineshkumar Patel]]></dc:creator><pubDate>Sat, 10 Sep 2022 05:59:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1662790791355/SLkINjKbU.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Security is often a deciding factor when choosing a public cloud provider. Encryption of data at rest is increasingly required by industry protocols, government regulations, and internal organizational security standards. Encryption helps you protect your stored data against unauthorized access and other security risks.  </p>
<p>That way, even if there are any security breaches or attacks on your company’s system, all of the information will be protected.<br /><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662774207923/HqMxsU_zQ.png" alt="Screenshot 2022-09-09 214223.png" /></p>
<blockquote>
<p>"Dance like nobody is watching. Encrypt like everyone is.”<br />-Werner Vogels - VP &amp; CTO - Amazon.com  </p>
</blockquote>
<p>Is your Data Protected at-rest in S3 Buckets ?<br />Is your Data Encrypted in-transit to &amp; from S3 Buckets ? </p>
<p>Not sure?<br />Don't Worry. This Blog will cover almost all aspects of S3 Bucket Data Protection and Encryption with Why and How to do so.   </p>
<p>And if you are doing so or know few aspects of it, This blog will help you avoid common but critical pitfalls.  </p>
<blockquote>
<p>Data protection refers to protecting data while<br />In-transit (as it travels to and from Amazon S3) and<br />At rest (while it is stored on disks in Amazon S3 data centers)</p>
</blockquote>
<h3 id="heading-key-objects-to-cover">Key Objects to Cover:</h3>
<ul>
<li>Options for S3 Encryption: Server-Side(SSE) or Client-Side Encryption </li>
<li>How to configure S3 Default Encryption ? </li>
<li>Common Best Practices for Data Protection and Compliance</li>
<li>Avoid Unnecessary Costs when Enabling SSE. </li>
<li>Why S3 Bucket Policy is Important to Enforce Encryption </li>
<li>Cost of Encryption  </li>
</ul>
<h3 id="heading-options-for-protecting-data-at-rest-in-amazon-s3">Options for protecting data "at-rest" in Amazon S3:</h3>
<p><strong>Server-Side Encryption</strong> – Request Amazon S3 to encrypt your object before saving it on disks in its data centers and then decrypt it when the Customer request to download the objects.
To configure server-side encryption,<br />During Creation of a Bucket, Enable server-side encryption with  </p>
<ul>
<li>AWS Key Management Service key (SSE-KMS)<br /><strong>or</strong></li>
<li>Specify Amazon S3-managed keys (SSE-S3)
<strong>or</strong> </li>
<li>Customer-provided encryption keys (SSE-C)</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662790659912/QoMHu8Nli.png" alt="AWS-S3-Encryption-Way-removebg-preview.png" />
<strong>Client-Side Encryption</strong> – Encrypt data client-side and upload the encrypted data to Amazon S3. In this case, Customer manage the encryption process, the encryption keys, and related tools.
Client-side encryption is the act of encrypting data locally to ensure its security as it passes to the Amazon S3 service. The Amazon S3 service receives your encrypted data and it does not play a role in encrypting or decrypting it.<br />To enable client-side encryption, you have the following options:</p>
<ul>
<li>Use a key stored in AWS Key Management Service (AWS KMS).</li>
<li>Use a key that you store within your application. (Not-Recommended)
AWS's Note : Your client-side keys and your unencrypted data are never sent to AWS. It's important that you safely manage your encryption keys. If you lose them, you can't decrypt your data.  </li>
</ul>
<h3 id="heading-setting-default-server-side-encryption-behavior-for-amazon-s3">Setting <strong>default "server-side encryption"</strong> behavior for Amazon S3</h3>
<blockquote>
<p>With Amazon S3 default encryption, you can set the default encryption behavior for an S3 bucket so that all new objects are encrypted when they are stored in the bucket.<br />The objects are encrypted using server-side encryption with either Amazon S3-managed keys (SSE-S3) or AWS KMS keys stored in AWS Key Management Service (AWS KMS) (SSE-KMS).  </p>
</blockquote>
<h3 id="heading-s3-default-encryption">S3 Default Encryption</h3>
<p>When you configure your bucket to use default encryption <strong>with SSE-KMS</strong>, you can also enable S3 Bucket Keys to decrease request traffic from Amazon S3 to AWS Key Management Service (AWS KMS) and reduce the cost of encryption. </p>
<blockquote>
<p>When Creating an S3 Bucket,<strong> there will be option to Enable SSE</strong><br />Note: There are no additional fees for using server-side encryption with Amazon S3-managed keys (SSE-S3). However, requests to configure the default encryption feature incur standard Amazon S3 request charges. See <a target="_blank" href="https://aws.amazon.com/s3/pricing/">S3 Pricing</a> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662775102871/fOThNL4EY.png" alt="screely-1662775090697.png" /></p>
</blockquote>
<h3 id="heading-encrypting-existing-unencrypted-objectshttpsawsamazoncomblogsstorageencrypting-objects-with-amazon-s3-batch-operations"><a target="_blank" href="https://aws.amazon.com/blogs/storage/encrypting-objects-with-amazon-s3-batch-operations/">Encrypting existing unencrypted objects</a></h3>
<p>To encrypt your existing Amazon S3 objects, you can use Amazon S3 Batch Operations. You provide S3 Batch Operations with a list of objects to operate on, and Batch Operations calls the respective API to perform the specified operation.  </p>
<blockquote>
<p>You can use the Batch Operations Copy operation to copy existing unencrypted objects and write them back to the same bucket as encrypted objects. A single Batch Operations job can perform the specified operation on billions of objects. More on that <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html">here</a>   </p>
<p>I would love to perform this Batch Operation for S3 Encryption as a Hands-On Lab in upcoming Blogs. (Added in To-Do List) </p>
</blockquote>
<h3 id="heading-encrypting-existing-amazon-s3-objects-with-the-aws-cli">Encrypting existing Amazon S3 objects with the AWS CLI</h3>
<p>Simply, If you must encrypt all objects in your S3 bucket, you can run the following command: (More options on this <a target="_blank" href="https://aws.amazon.com/blogs/storage/encrypting-existing-amazon-s3-objects-with-the-aws-cli/">here</a>)</p>
<pre><code><span class="hljs-attribute">aws</span> s<span class="hljs-number">3</span> cp s<span class="hljs-number">3</span>://awsexamplebucket/ s<span class="hljs-number">3</span>://awsexamplebucket/ --sse aws:kms --recursive
</code></pre><h3 id="heading-is-your-data-encrypted-in-transit-to-andamp-from-s3-buckets">Is your Data Encrypted in-transit to &amp; from S3 Buckets ?</h3>
<ul>
<li>Data is more vulnerable when it’s in motion. To protect data in transit, companies should implement network security controls like firewalls and network access control. These will help secure the networks used to transmit information against malware attacks or intrusions.  </li>
<li>SSL/TLS uses both asymmetric and symmetric encryption to protect the confidentiality and integrity of data-in-transit. Both the client and server use HTTPS (SSL/TLS + HTTP) for their communication and can be used for File(Data) Transfer.   </li>
<li>TLS is a cryptographic protocol that provides end-to-end security of data sent between applications over the Internet. It should be noted that TLS does not secure data on end systems(When at-rest). It simply ensures the secure delivery of data over the Internet, avoiding possible eavesdropping and/or alteration of the content.  </li>
</ul>
<h3 id="heading-why-s3-bucket-policy-is-important-to-enforce-encryption">Why S3 Bucket Policy is Important to Enforce Encryption</h3>
<ul>
<li>Bucket Policy can be set to prevent Users or Applications requests to Put Objects without Encryption or with different encryption method. </li>
<li>Bucket Policy is Important with Default Encryption for the Bucket to make sure all the objects in the bucket comply with Certain Encryption Standard. (Making the Data Protection Officer Happy 🕵️😎😊🕵️‍♀️ for Compliance !! ) </li>
<li><strong>In order to enforce object encryption on S3 Bucket</strong>, create an S3 bucket policy that denies any S3 Put request that does not include the x-amz-server-side-encryption header. <strong>There are two possible values</strong> for the x-amz-server-side-encryption header: <strong>AES256</strong>, which tells S3 to use S3-managed keys, and <strong>aws:kms</strong>, which tells S3 to use AWS KMS–managed keys. </li>
</ul>
<p>the following bucket policy denies permissions to upload an object unless the request includes the x-amz-server-side-encryption header : <strong>AES256</strong> to request server-side encryption: </p>
<pre><code>{
  <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
  <span class="hljs-attr">"Id"</span>: <span class="hljs-string">"PutObjectPolicy"</span>,
  <span class="hljs-attr">"Statement"</span>: [
    {
      <span class="hljs-attr">"Sid"</span>: <span class="hljs-string">"DenyIncorrectEncryptionHeader"</span>,
      <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Deny"</span>,
      <span class="hljs-attr">"Principal"</span>: <span class="hljs-string">"*"</span>,
      <span class="hljs-attr">"Action"</span>: <span class="hljs-string">"s3:PutObject"</span>,
      <span class="hljs-attr">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::awsexamplebucket1/*"</span>,
      <span class="hljs-attr">"Condition"</span>: {
        <span class="hljs-attr">"StringNotEquals"</span>: {
          <span class="hljs-attr">"s3:x-amz-server-side-encryption"</span>: <span class="hljs-string">"AES256"</span>
        }
      }
    }
  ]
}
</code></pre><p>the Above bucket policy denies the upload object (s3:PutObject) permission to everyone if the request does not include the x-amz-server-side-encryption header requesting server-side encryption with SSE-KMS.</p>
<p>OR </p>
<pre><code>{
   <span class="hljs-attr">"Version"</span>:<span class="hljs-string">"2012-10-17"</span>,
   <span class="hljs-attr">"Id"</span>:<span class="hljs-string">"PutObjectPolicy"</span>,
   <span class="hljs-attr">"Statement"</span>:[{
         <span class="hljs-attr">"Sid"</span>:<span class="hljs-string">"DenyUnEncryptedObjectUploads"</span>,
         <span class="hljs-attr">"Effect"</span>:<span class="hljs-string">"Deny"</span>,
         <span class="hljs-attr">"Principal"</span>:<span class="hljs-string">"*"</span>,
         <span class="hljs-attr">"Action"</span>:<span class="hljs-string">"s3:PutObject"</span>,
         <span class="hljs-attr">"Resource"</span>:<span class="hljs-string">"arn:aws:s3:::DOC-EXAMPLE-BUCKET1/*"</span>,
         <span class="hljs-attr">"Condition"</span>:{
            <span class="hljs-attr">"StringNotEquals"</span>:{
               <span class="hljs-attr">"s3:x-amz-server-side-encryption"</span>:<span class="hljs-string">"aws:kms"</span>
            }
         }
      }
   ]
}
</code></pre><p>Both above Example Bucket Policy Enforcing Encryption to use "AES256" (SSE-S3) / aws:kms (Respectively) to Allow Put Objects to this Bucket. </p>
<h3 id="heading-cost-comes-after-security"><strong>Cost comes after Security</strong></h3>
<ul>
<li>Cost is also extremely important when dealing with Huge amount of Objects and their Buckets. And Enforcing S3 Security and Encryption comes with a Cost.  </li>
<li>Amazon S3 Bucket Keys reduce the request costs of Amazon S3 server-side encryption (SSE) with AWS Key Management Service (KMS) by up to 99% by decreasing the request traffic from S3 to KMS. With a few clicks in AWS Management Console and no changes to your client applications, you can configure your buckets to use an S3 Bucket Key for KMS-based encryption on new objects.  </li>
<li><h3 id="heading-reduce-the-cost-of-s3-encryption">Reduce the cost of S3 encryption</h3>
When you configure default encryption to your bucket <strong>with SSE-KMS</strong>, you can also <strong>enable S3 Bucket Keys</strong> to decrease request traffic from Amazon S3 to AWS Key Management Service (AWS KMS) and reduce the cost of encryption. For more information, see <a target="_blank" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-key.html">Reducing the cost of SSE-KMS with Amazon S3 Bucket Keys</a>.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662779070741/6cgnOAayn.png" alt="screely-1662779058797.png" />  </li>
</ul>
<blockquote>
<p>Workloads that access millions or billions of objects encrypted with SSE-KMS can generate large volumes of requests to AWS KMS.  </p>
</blockquote>
<ul>
<li><strong>When you use SSE-KMS to protect your data without an S3 Bucket Key</strong>, Amazon S3 uses an individual AWS KMS data key for every object. It makes a call to AWS KMS every time a request is made against a KMS-encrypted object.  </li>
<li><strong>When you configure your bucket to use an S3 Bucket Key for SSE-KMS</strong>, AWS KMS generates a bucket-level key that is used to create unique data keys for new objects that you add to the bucket. This 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.<br /><strong>This reduces traffic from S3 to AWS KMS</strong>, allowing to access AWS KMS-encrypted objects in S3 at a fraction of Cost compared to the <strong>previous approach(without an S3 Bucket Key)</strong>.   <h3 id="heading-one-magic-trick-that-can-save-998-on-aws-s3-kms-charges">One Magic Trick that can save 99.8% on AWS S3 KMS charges</h3>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662778673817/032ye_d7R.png" alt="screely-1662778667049.png" /></li>
</ul>
<p>Let me Summarise what I explained in this Blog regarding S3 Encryption.  </p>
<ul>
<li>Server-Side Encryption for S3 Buckets is Must for Data Protection. </li>
<li>Enable Default Encryption </li>
<li>Enforce Bucket Policy to Use S3 Encryption for Put Object. </li>
<li>Encrypt Unencrypted Objects in Bucket using Batch Job / AWS CLI </li>
<li>Use S3 Bucket Keys for SSE-KMS to Reduce Cost for Encryption. </li>
<li>Use Bucket Level Keys instead of Object Level Keys to reduce Cost on KMS requests.  </li>
</ul>
<p>Hope you have Enjoyed the Blog. Thank you for Reading.  </p>
<p>Feel free to ask questions about how to encrypt data at rest on S3. </p>
<p>Happy Learning.</p>
<p>Like and Follow for more Azure and AWS Content.</p>
<p>Thank you,<br /><a target="_blank" href="https://jineshkumar.bio.link/">Jineshkumar Patel</a></p>
]]></content:encoded></item></channel></rss>