<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by skukreja on Medium]]></title>
        <description><![CDATA[Stories by skukreja on Medium]]></description>
        <link>https://medium.com/@skukreja95?source=rss-1813fe6a14a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sfyw0srkx4E6lmbjJe3-wg.jpeg</url>
            <title>Stories by skukreja on Medium</title>
            <link>https://medium.com/@skukreja95?source=rss-1813fe6a14a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:49:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skukreja95/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Spec-Driven Development (SDD): From Requirements to Infrastructure with AI]]></title>
            <link>https://medium.com/@skukreja95/spec-driven-development-sdd-from-requirements-to-infrastructure-with-ai-b8531e86d819?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8531e86d819</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sdd]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 07:33:04 GMT</pubDate>
            <atom:updated>2026-10-30T07:33:04.707Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Over the past decade, software delivery has evolved through several major shifts:</p><pre>Manual Development<br>        ↓<br>Agile Development<br>        ↓<br>DevOps<br>        ↓<br>Infrastructure as Code<br>        ↓<br>AI-Assisted Development<br>        ↓<br>Spec-Driven Development</pre><p>While AI coding assistants can generate code quickly, many organizations are discovering that generating code is only part of the challenge.</p><p>The real question is:</p><blockquote><em>How do we ensure AI generates the right code, infrastructure, tests, and documentation consistently?</em></blockquote><p>This is where <strong>Spec-Driven Development (SDD)</strong> comes in.</p><h3>What is Spec-Driven Development?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7a-XnsJzmScbCtp3OYLa1g.png" /><figcaption><strong>Spec-Driven Development (SDD) Architecture for Multi-Cloud Delivery</strong></figcaption></figure><p>Spec-Driven Development is an approach where <strong>the specification becomes the source of truth</strong>.</p><p>Instead of engineers manually creating every artifact, they define a structured specification describing:</p><ul><li>What needs to be built</li><li>Functional requirements</li><li>Infrastructure requirements</li><li>Security requirements</li><li>Validation criteria</li></ul><p>AI then uses that specification to generate:</p><ul><li>Application code</li><li>Infrastructure</li><li>Tests</li><li>Documentation</li><li>Deployment pipelines</li></ul><p>Think of it this way:</p><p><strong>Traditional Development</strong></p><pre>Requirements<br>      ↓<br>Developer Interpretation<br>      ↓<br>Code<br>      ↓<br>Infrastructure<br>      ↓<br>Testing</pre><p>Every step introduces interpretation and variation.</p><h4>Spec-Driven Development</h4><pre>Requirements<br>      ↓<br>Specification<br>      ↓<br>AI Generation<br>      ↓<br>Validation<br>      ↓<br>Production</pre><p>The specification becomes the single source of truth.</p><h3>Why Do We Need SDD?</h3><p>Consider a common enterprise scenario.</p><p>A team receives a request to deploy a new Java application.</p><p>Different engineers might:</p><ul><li>Use different Kubernetes patterns</li><li>Configure monitoring differently</li><li>Implement security controls differently</li><li>Create different CI/CD structures</li></ul><p>Even if all solutions work, operational consistency suffers.</p><p>SDD addresses this by standardizing delivery through specifications.</p><p>Instead of telling engineers:</p><blockquote><em>“Go build it.”</em></blockquote><p>You tell AI:</p><blockquote><em>“Here is exactly what I want built.”</em></blockquote><p>And the specification drives the outcome.</p><h3>Understanding the SDD Lifecycle</h3><p>Most SDD implementations follow four stages.</p><h4>LX100 — Discovery</h4><p>Gather project context:</p><ul><li>Existing applications</li><li>Infrastructure requirements</li><li>Security requirements</li><li>Architecture constraints</li></ul><p>Output:</p><pre>Project Knowledge</pre><h4>LX200 — Specification</h4><p>Convert requirements into structured specifications.</p><p>Output:</p><pre>Approved Specification</pre><h4>LX300 — Generation</h4><p>AI generates:</p><ul><li>Code</li><li>Infrastructure</li><li>Tests</li><li>Pipelines</li><li>Documentation</li></ul><p>Output:</p><pre>Implementation Artifacts</pre><h4>LX400 — Validation</h4><p>Validate generated artifacts.</p><p>Output:</p><pre>Production Ready Solution</pre><h3>A Practical Infrastructure Example</h3><p>Now that we’ve covered the fundamentals of Spec-Driven Development, let’s look at how it can be applied to a real-world platform engineering use case.</p><p>Imagine a team needs to deploy a new Java-based API into a cloud environment.</p><p>Traditionally, infrastructure requirements might be communicated through emails, tickets, architecture diagrams, and meetings. Platform engineers would then manually create Kubernetes manifests, CI/CD pipelines, monitoring configurations, security settings, and deployment documentation.</p><p>With SDD, the process starts by clearly defining the desired outcome.</p><h4>Business &amp; Platform RequirementsDeploy on Kubernetes</h4><p>The platform team receives the following requirements:</p><ul><li>Deploy a Java API on Kubernetes</li><li>Use a managed relational database</li><li>Store secrets in a centralized secrets management service</li><li>Enable automatic scaling based on workload</li><li>Implement monitoring and observability</li><li>Create a CI/CD pipeline for automated deployments</li><li>Enforce security best practices</li><li>Ensure the solution is production-ready</li></ul><p>Notice that these requirements focus on <strong>what needs to be achieved</strong>, not <strong>how it should be implemented on a specific cloud provider</strong>.</p><h4>Converting Requirements into a Specification</h4><pre>application:<br>  name: vehicle-api<br><br>runtime:<br>  java: 21<br><br>platform:<br>  kubernetes<br><br>database:<br>  type: relational<br><br>security:<br>  secretsManagement: true<br><br>autoscaling:<br>  minReplicas: 2<br>  maxReplicas: 10<br><br>monitoring:<br>  enabled: true<br><br>cicd:<br>  enabled: true</pre><p>This specification becomes the single source of truth for the deployment.</p><h4>What AI Generates</h4><p>Once the specification is approved, the SDD platform generates the implementation artifacts required to deploy and operate the application.</p><p>Let’s assume our specification describes a Java API running on Kubernetes with autoscaling, secrets management, monitoring, and automated deployments.</p><p>Instead of platform engineers manually creating dozens of files, the SDD platform generates them automatically.</p><p><strong>Kubernetes Deployment</strong></p><pre>apiVersion: apps/v1<br>kind: Deployment<br><br>metadata:<br>  name: vehicle-api<br><br>spec:<br>  replicas: 2<br><br>  template:<br>    spec:<br>      containers:<br>      - name: vehicle-api<br>        image: vehicle-api:latest</pre><h4>Service</h4><pre>apiVersion: v1<br>kind: Service<br><br>metadata:<br>  name: vehicle-api<br><br>spec:<br>  ports:<br>  - port: 80</pre><h4>Horizontal Pod Autoscaler</h4><pre>apiVersion: autoscaling/v2<br><br>kind: HorizontalPodAutoscaler<br><br>spec:<br>  minReplicas: 2<br>  maxReplicas: 10</pre><h4>CI/CD Pipeline</h4><pre>name: Deploy Application<br><br>steps:<br><br>- Build<br>- Unit Test<br>- Containerize<br>- Security Scan<br>- Deploy</pre><h4>Secrets Management Configuration</h4><pre>security:<br><br>  secretsManagement: true<br><br>  identityBasedAccess: true</pre><h4>Monitoring</h4><pre>monitoring:<br><br>  metrics: enabled<br><br>  logging: enabled<br><br>  alerts: enabled</pre><h4>Validation Phase</h4><p>The platform can also verify compliance.</p><h4>Security Checks</h4><pre>✓ Key Vault configured<br><br>✓ No hardcoded credentials<br><br>✓ HTTPS enforced<br><br>✓ Managed Identity enabled</pre><h4>Reliability Checks</h4><pre>✓ Autoscaling enabled<br><br>✓ Resource limits defined<br><br>✓ Health probes configured</pre><h4>Observability Checks</h4><pre>✓ Metrics enabled<br><br>✓ Logging configured<br><br>✓ Alerts configured</pre><h3>The Same Specification, Different Cloud Implementations</h3><p>One of the most powerful aspects of SDD is that the business requirements and specifications remain unchanged while the generated implementation adapts to the target platform.</p><h4>Azure Implementation</h4><p>From the same specification, AI could generate infrastructure using:</p><pre>AKS<br>Azure SQL<br>Azure Key Vault<br>Azure Monitor<br>Azure Container Registry<br>Azure API Management</pre><h4>AWS Implementation</h4><p>Or the same specification could generate:</p><pre>Amazon EKS<br>Amazon RDS<br>AWS Secrets Manager<br>Amazon CloudWatch<br>Amazon ECR<br>Amazon API Gateway</pre><p>The business requirement never changed.</p><p>The specification never changed.</p><p>Only the generated infrastructure changed based on the target cloud environment.</p><h3>Why This Matters for Platform Teams</h3><p>Most platform engineers don’t struggle with deploying one application.</p><p>They struggle with deploying <strong>50 applications consistently</strong>.</p><p>Without standards:</p><pre>50 Applications<br>50 Different Deployments<br>50 Different Monitoring Configurations<br>50 Different Security Implementations</pre><p>With SDD:</p><pre>Standard Specification<br>            ↓<br>Consistent Platform Deployments</pre><p>The result is:</p><ul><li>Faster delivery</li><li>Reduced manual effort</li><li>Better governance</li><li>Improved security</li><li>Consistent architecture patterns</li></ul><h3>Infrastructure as Code vs Spec-Driven Development</h3><p>Infrastructure as Code was the first step.</p><pre>Terraform<br>        ↓<br>Infrastructure</pre><p>SDD is the next step.</p><pre>Specification<br>       ↓<br>AI<br>       ↓<br>Infrastructure<br>CI/CD<br>Security<br>Monitoring<br>Documentation<br>Validation</pre><p>Instead of generating only infrastructure, SDD generates and validates the entire platform ecosystem.</p><h3>Final Thoughts</h3><p>Spec-Driven Development isn’t about replacing engineers.</p><p>It’s about shifting engineering effort from writing repetitive implementation artifacts to defining clear intent.</p><p>For platform teams, the future may not be creating more YAML, Terraform, or pipeline definitions. The future may be writing high-quality specifications and allowing AI to generate, validate, and maintain everything else.</p><p>Just as Infrastructure as Code transformed infrastructure provisioning, Spec-Driven Development has the potential to transform software and platform delivery in the AI era.</p><p><strong>The key question is no longer “How do we build it?” but “How well can we describe what we want to build?”</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8531e86d819" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an AI-Powered DevOps Agent on AWS: Automating Incident Analysis, EKS Troubleshooting, and…]]></title>
            <link>https://medium.com/@skukreja95/building-an-ai-powered-devops-agent-on-aws-automating-incident-analysis-eks-troubleshooting-and-4ab021db381c?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ab021db381c</guid>
            <category><![CDATA[aiops]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 08:18:20 GMT</pubDate>
            <atom:updated>2026-10-15T08:21:11.045Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building an AI-Powered DevOps Agent on AWS: Automating Incident Analysis, EKS Troubleshooting, and Deployments</h3><h4>Introduction</h4><p>Modern DevOps teams are expected to do more than ever before.</p><p>On any given day, engineers may be required to:</p><ul><li>Investigate production incidents</li><li>Analyze CloudWatch logs</li><li>Troubleshoot Kubernetes issues</li><li>Review deployment failures</li><li>Check infrastructure health</li><li>Respond to alerts</li><li>Create support tickets</li><li>Coordinate across multiple teams</li></ul><p>While monitoring tools provide vast amounts of data, engineers still spend significant time gathering information before they can identify the actual problem.</p><p>This is where AI Agents can make a meaningful impact.</p><p>Instead of acting as another chatbot, an AI-powered DevOps Agent can function as a virtual Site Reliability Engineer (SRE), capable of collecting operational data, correlating events, identifying probable root causes, and even initiating remediation workflows.</p><p>In this article, we’ll explore how to build a production-ready DevOps Agent on AWS using Amazon Bedrock AgentCore and cloud-native AWS services.</p><h4>The Problem with Traditional Incident Response</h4><p>Consider a common production alert:</p><blockquote><em>“Orders API latency has exceeded threshold for the last 15 minutes.”</em></blockquote><p>A DevOps engineer typically needs to:</p><ol><li>Open CloudWatch</li><li>Review application logs</li><li>Check Kubernetes events</li><li>Verify recent deployments</li><li>Review infrastructure metrics</li><li>Analyze database performance</li><li>Correlate findings manually</li></ol><p>This process can take anywhere from 30 minutes to several hours.</p><p>The challenge isn’t lack of data.</p><p>The challenge is connecting the dots quickly.</p><h4>What is a DevOps Agent?</h4><p>A DevOps Agent is an AI-powered operational assistant that combines:</p><ul><li>Large Language Models (LLMs)</li><li>Operational telemetry</li><li>Infrastructure APIs</li><li>Organizational knowledge</li><li>Automation workflows</li></ul><p>Unlike traditional monitoring dashboards, the agent understands intent.</p><p>For example:</p><h4>User Question</h4><pre>Why is the Orders API experiencing high</pre><h3>Agent Actions</h3><pre>1. Query CloudWatch metrics<br>2. Analyze application logs<br>3. Review EKS events<br>4. Check deployment history<br>5. Validate database health<br>6. Correlate findings<br>7. Recommend remediation</pre><p>Instead of navigating multiple systems, engineers receive actionable insights in a single response.</p><h4>Business Benefits</h4><p>Organizations implementing DevOps Agents can realize improvements in:</p><h4>Mean Time to Detect (MTTD)</h4><p>Agents proactively identify issues before engineers manually investigate.</p><h4>Mean Time to Resolution (MTTR)</h4><p>Automated root cause analysis significantly reduces troubleshooting efforts.</p><h4>Operational Efficiency</h4><p>Engineers spend less time gathering data and more time solving problems.</p><h4>Knowledge Retention</h4><p>Agents preserve operational expertise and institutional knowledge.</p><h4>Faster Incident Response</h4><p>Critical incidents can be investigated immediately, regardless of team size.</p><h4>Reference Architecture</h4><p>A production-grade DevOps Agent architecture might look like this:</p><pre>                    Engineers<br>                        │<br>                        ▼<br>             Teams / Slack / Web UI<br>                        │<br>                        ▼<br>                  API Gateway<br>                        │<br>                        ▼<br>            Amazon Bedrock AgentCore<br>                        │<br>       ┌────────────────┼─────────────────┐<br>       │                │                 │<br>       ▼                ▼                 ▼<br><br> CloudWatch       Knowledge Base     Action Tools<br> Metrics &amp; Logs      (RAG)           (Lambda)<br><br>       │                │                 │<br>       ▼                ▼                 ▼<br><br>     AWS S3        Runbooks SOPs     EKS APIs<br>                                   GitHub APIs<br>                                   Jira APIs<br>                                   ServiceNow</pre><p>The AgentCore layer acts as the orchestration engine, deciding what information to retrieve and what actions to perform.</p><h4>Data Sources for the DevOps Agent</h4><p>The effectiveness of an AI Agent depends heavily on the quality of information it can access.</p><h4>CloudWatch</h4><p>The agent can retrieve:</p><ul><li>CPU utilization</li><li>Memory metrics</li><li>Request latency</li><li>Error rates</li><li>Application logs</li></ul><p>Example query:</p><pre>Show all ERROR logs from the Orders API<br>during the last 30 minutes.</pre><h4>Amazon EKS</h4><p>The agent can inspect:</p><ul><li>Pod status</li><li>Container restarts</li><li>Events</li><li>Resource utilization</li><li>Horizontal Pod Autoscaler activity</li></ul><p>Example question:</p><pre>Show all ERROR logs from the Orders API<br>during the last 30 minutes.</pre><p>Agent output:</p><pre>1 pods restarted due to OOMKilled events.<br>2 Memory utilization exceeded configured limits.</pre><h4>GitHub Actions</h4><p>Many incidents begin after deployments.</p><p>The agent can analyze:</p><ul><li>Workflow executions</li><li>Failed deployments</li><li>Configuration changes</li><li>Pull requests</li></ul><p>Example:</p><pre>Was anything deployed before the issue started?</pre><h4>ServiceNow / Jira</h4><p>The agent can access:</p><ul><li>Incident history</li><li>Problem records</li><li>Change requests</li><li>Known issues</li></ul><p>This allows the system to identify recurring failures.</p><h4>Building the Knowledge Layer</h4><p>Many organizations already have thousands of pages of documentation.</p><p>Examples include:</p><ul><li>Standard Operating Procedures</li><li>Incident Runbooks</li><li>Troubleshooting Guides</li><li>Platform Architecture Documents</li><li>Support Playbooks</li></ul><p>Most engineers struggle to find the right document under pressure.</p><p>By creating a Retrieval-Augmented Generation (RAG) layer, the agent can retrieve relevant knowledge instantly.</p><p>Example:</p><pre>How do we rotate EKS worker certificates?</pre><p>Instead of searching through documentation, the agent provides the approved process directly.</p><h3>Real-World Use Case #1: EKS Troubleshooting Agent</h3><p>A developer reports:</p><pre>My application is unavailable</pre><p>The agent automatically:</p><h4>Step 1</h4><p>Checks deployment status.</p><h4>Step 2</h4><p>Reviews pod health.</p><h4>Step 3</h4><p>Analyzes restart events.</p><h4>Step 4</h4><p>Inspects container logs.</p><h4>Step 5</h4><p>Reviews resource utilization.</p><h4>Step 6</h4><p>Provides findings.<br>Example output:</p><pre>Root Cause:<br><br>Pods are entering CrashLoopBackOff.<br><br>Reason:<br><br>Database connection timeout.<br><br>Evidence:<br><br>Connection refused errors detected in<br>application logs.<br><br>Recommendation:<br><br>Verify database endpoint and security groups.</pre><h4>Real-World Use Case #2: Deployment Analysis</h4><p>User query:</p><pre>Why did today&#39;s deployment fail?</pre><p>The agent:</p><ul><li>Reviews GitHub workflow logs</li><li>Validates Terraform output</li><li>Checks container image status</li><li>Reviews Kubernetes deployment events</li></ul><p>Possible response:</p><pre>1 Deployment failed because image<br>2 version v3.5.2 was not published<br>to ECR.<br>3 Workflow failed during image push step.</pre><p>This eliminates the need to manually navigate multiple tools.</p><h4>Real-World Use Case #3: Incident Commander Assistant</h4><p>During major incidents, teams often struggle to consolidate information.</p><p>A DevOps Agent can:</p><ul><li>Summarize active incidents</li><li>Provide timelines</li><li>Identify impacted services</li><li>Recommend escalation paths</li></ul><p>Example request:</p><pre>Provide a summary of the current incident.</pre><p>Result:</p><pre>1 Timeline<br>2 Impacted Services<br>3 Probable Root Cause<br>4 Work Completed<br>5 Next Recommended Actions</pre><p>This helps incident commanders make faster decisions.</p><h4>Moving Beyond Read-Only Access</h4><p>Initially, organizations should focus on investigation and recommendations.</p><p>Over time, controlled automation can be introduced.</p><p>Examples:</p><h4>Safe Automated Actions</h4><p>✅ Restart Kubernetes pods</p><p>✅ Trigger GitHub workflows</p><p>✅ Create Jira tickets</p><p>✅ Generate incident reports</p><p>✅ Scale deployments</p><p>Examples requiring approval:</p><p>❌ Production database changes</p><p>❌ IAM modifications</p><p>❌ Resource deletions</p><p>❌ Network policy updates</p><h4>Security Considerations</h4><p>AI Agents interacting with production environments require strong controls.</p><h4>Principle of Least Privilege</h4><p>The agent should only receive permissions required for its tasks.</p><p>For example:</p><pre>Read CloudWatch Logs<br>Read EKS Metrics<br>Create Jira Tickets</pre><p>Avoid broad administrative access.</p><h4>Human Approval Gates</h4><p>Production-impacting actions should require approval.</p><p>Example workflow:</p><pre>Agent Recommendation<br>        ↓<br>Human Review<br>        ↓<br>Approved Action<br>        ↓<br>Execution</pre><p>This balances automation and operational safety.</p><h4>Auditing</h4><p>Every action should be logged.</p><p>Capture:</p><ul><li>User requests</li><li>Agent decisions</li><li>Tool invocations</li><li>Execution results</li></ul><p>This supports governance and compliance requirements.</p><h4>Observability for the Agent Itself</h4><p>Many teams monitor applications but forget to monitor the agent.</p><p>Track metrics such as:</p><ul><li>Agent response time</li><li>Tool execution failures</li><li>LLM latency</li><li>Request success rate</li><li>Cost per request</li><li>Root-cause accuracy</li></ul><p>The AI Agent should be treated as a production service.</p><h4>Lessons Learned</h4><p>After working with cloud-native platforms, Kubernetes environments, and enterprise operational teams, several patterns emerge:</p><h4>1. Retrieval Quality Matters More Than Model Size</h4><p>A smaller model with the right operational data often outperforms a larger model without context.</p><h4>2. Start with Read-Only Access</h4><p>Organizations gain trust much faster when the agent first focuses on insights rather than actions.</p><h4>3. Documentation Is a Gold Mine</h4><p>Runbooks, SOPs, and troubleshooting guides significantly improve agent effectiveness.</p><h4>4. Human Oversight Remains Essential</h4><p>AI should augment engineers, not replace them.</p><h4>5. Incident Management Is a Strong First Use Case</h4><p>Operational troubleshooting delivers fast and measurable business value.</p><h4>The Future of DevOps</h4><p>The future DevOps engineer will spend less time searching dashboards and more time making decisions.</p><p>AI-powered DevOps Agents will increasingly become the first point of contact for operational issues by:</p><ul><li>Investigating incidents</li><li>Correlating telemetry</li><li>Recommending actions</li><li>Executing approved workflows</li></ul><p>Rather than replacing engineers, these agents will amplify engineering productivity and enable teams to manage increasingly complex cloud environments.</p><h4>Conclusion</h4><p>AI Agents are rapidly transforming how platform and DevOps teams operate.</p><p>By integrating Amazon Bedrock AgentCore with CloudWatch, EKS, GitHub, ServiceNow, Jira, and enterprise knowledge bases, organizations can build intelligent operational assistants capable of reducing MTTR, accelerating troubleshooting, and improving operational efficiency.</p><p>The most successful DevOps Agents won’t be the ones with the most advanced models.</p><p>They will be the ones connected to the right data, governed by the right controls, and focused on solving real operational problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ab021db381c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Now Monitors Azure: How to Configure Multicloud Security Posture Management]]></title>
            <link>https://medium.com/@skukreja95/aws-now-monitors-azure-how-to-configure-multicloud-security-posture-management-57076f66286b?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/57076f66286b</guid>
            <category><![CDATA[aws-now-monitors-azure]]></category>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 14:18:02 GMT</pubDate>
            <atom:updated>2026-07-16T14:21:02.151Z</atom:updated>
            <content:encoded><![CDATA[<p>Cloud architects and security leaders have fought the same battle for years: managing security alerts across mismatched, fragmented dashboards. If you operate a hybrid or multicloud footprint, you know the exact operational friction of constantly jumping between AWS Security Hub and Microsoft Defender for Cloud, normalizing alert severities, and stitching together complex third-party tools just to establish a clear risk baseline.</p><p>The cloud landscape shifted dramatically with a major multicloud update. <a href="https://aws.amazon.com/blogs/security/security-hub-adds-ai-workload-protection-and-multicloud-support-for-microsoft-azure/">AWS Security Hub</a> now natively supports Microsoft Azure.</p><p>Instead of forcing engineering teams to build custom API wrappers or pay for expensive third-party tools, AWS treats Azure infrastructure as a native citizen within Security Hub. This guide breaks down the underlying cross-cloud architecture and provides a step-by-step walkthrough to configure the integration.</p><h4>Shifting to True Cross-Cloud Security</h4><p>Through this integration, Security Hub automatically discovers, aggregates, and continuously evaluates major Azure assets. The system standardizes findings, converting incoming security telemetry into the Open Cybersecurity Schema Framework (OCSF) format.</p><p>This means your Azure alerts appear in the exact same format and severity model as your native AWS findings. Furthermore, AWS maps these resources directly against standard compliance frameworks, running continuous posture checks against the <strong>CIS Microsoft Azure Foundations Benchmark</strong>.</p><p>From a financial management perspective, there are no hidden third-party licensing contracts. The monitoring costs for these cross-cloud assets are consolidated directly into your standard AWS bill at regular usage rates, completely eliminating operational friction.</p><h4><strong>Normalised Findings, Consolidated Bills</strong></h4><p>The real value lies in standardisation. AWS ingests Azure data and normalises the findings. Your Azure alerts appear in the exact same format and severity model as your AWS alerts.</p><p>Even better, AWS maps these resources directly against standard compliance frameworks, such as the <strong>CIS Microsoft Azure Foundations Benchmark</strong>.</p><p>From a management perspective, there are no hidden contracts. The monitoring costs for these cross-cloud assets are consolidated directly into your standard AWS bill at regular usage rates.</p><h4><strong>The Big Picture</strong></h4><p>For organizations leveraging both clouds, this eliminates a massive amount of operational friction. While third-party tools like Wiz and Palo Alto Alto Networks have dominated this space, AWS is making a aggressive play to become your primary multicloud control plane.</p><p>If you are already utilizing Amazon CloudWatch, you can pair this with Azure Monitor to view your security posture and performance metrics (like Azure VM CPU usage) on a single screen.</p><p>The cloud walls are coming down. The question is: are you ready to let AWS watch your Azure environment?</p><h4>The Cross-Cloud Architecture</h4><p>The native integration leverages an agentless, API-driven approach across an <strong>Inter-Cloud Trust Boundary</strong>. AWS utilizes a service-linked mechanism to establish a secure, federated handshake with your Microsoft Entra ID tenant to poll resource configurations and ingest threat data.</p><p>The native integration leverages an agentless, API-driven approach. AWS utilizes a service-linked connector that establishes a secure, cross-tenant trust relationship with your Azure Active Directory / Microsoft Entra ID tenant.</p><p>Here is how the data flows between the two cloud environments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ICdD6UmdLBnRUKiX-LVDQ.png" /></figure><h4>Core Architectural Components:</h4><ol><li><strong>AWS Security Hub Connector App (App Registration)</strong>: A dedicated enterprise application registered inside <strong>Microsoft Entra ID (Active Directory)</strong>. This app acts as the security identity on the Azure side, assigned strict read-only access to specific target subscriptions (e.g., Azure Subscription A).</li><li><strong>OIDC Federated Identity Trust</strong>: The bridge across the cloud boundary. Instead of relying on vulnerable, long-lived client secrets, the <a href="https://aws.amazon.com/blogs/security/security-hub-adds-ai-workload-protection-and-multicloud-support-for-microsoft-azure/">AWS Security Hub</a> native <strong>Azure Connector</strong> uses passwordless OpenID Connect (OIDC) federation to authenticate its metadata polling loops securely.</li><li><strong>Azure Resource Management API (Configuration Pull)</strong>: The AWS Azure Connector issues structured API calls down to the Azure Resource Management layer. It pulls live configuration states directly from core infrastructure dependencies:<br><strong>Azure VMs</strong>: Checked for exposed ports and OS vulnerabilities. <br><strong>Container Registries (ACR)</strong>: Scanned for weak or out-of-date container image layers. <br><strong>Key Vaults</strong>: Evaluated for unsafe access policies and key rotation hygiene. <br><strong>Entra ID Configuration</strong>: Audited for global identity vulnerabilities.</li><li><strong>Microsoft Defender for Cloud (Threat Alerts Feed)</strong>: For active threat landscapes, real-time alert data generated within Azure bypasses standard polling intervals. Instead, an active <strong>Event Hub</strong> stream pushes continuous threat telemetry straight into the AWS Azure Connector.</li><li><strong>Findings Database (OCSF Normalization)</strong>: Once the raw security metadata and Defender alerts reach the AWS ecosystem, Security Hub translates everything into the Open Cybersecurity Schema Framework (<strong>OCSF</strong>) standard. This maps Azure risk signatures into standardized <strong>Security Standards (CIS Azure)</strong> baselines, where third-party scanners like <strong>Amazon Inspector</strong> can enrich the database natively.</li></ol><h4>Step-by-Step Configuration Guide</h4><p>Before starting, ensure that <strong>AWS Config</strong> is fully enabled in your designated AWS security account, as Security Hub requires it to process compliance metrics.</p><p><strong>Step 1: Set Up the App Registration in Azure</strong></p><p>First, you must create an identity that AWS can use to look into your Azure environment.</p><ol><li>Log into the <strong>Azure Portal</strong> and navigate to <strong>Microsoft Entra ID</strong>.</li><li>Select <strong>App registrations</strong> from the sidebar, then click <strong>New registration</strong>.</li><li>Name it AWS-SecurityHub-Connector and select <strong>Accounts in this organizational directory only</strong>. Click <strong>Register</strong>.</li><li>Take note of the <strong>Application (client) ID</strong> and <strong>Directory (tenant) ID</strong> displayed on the Overview page.</li></ol><p><strong>Step 2: Grant Permissions to the Azure Subscription</strong></p><p>The App Registration needs permission to see your resources.</p><ol><li>In the Azure Portal, search for and open <strong>Subscriptions</strong>.</li><li>Click on the subscription you want AWS to monitor.</li><li>Select <strong>Access control (IAM)</strong>, then click <strong>Add</strong> &gt; <strong>Add role assignment</strong>.</li><li>Assign the <strong>Reader</strong> and <strong>Security Reader</strong> roles to the AWS-SecurityHub-Connector app registration you created in Step 1.</li></ol><p><strong>Step 3: Establish the Trust Relationship in AWS Security Hub</strong></p><p>Now, configure the connection inside your AWS environment.</p><ol><li>Log into the <strong>AWS Management Console</strong> and navigate to <strong>AWS Security Hub</strong>.</li><li>In the left navigation menu, look under the <strong>Settings</strong> or <strong>Integrations</strong> section and select <strong>Azure integration</strong>.</li><li>Click <strong>Create Azure Connector</strong>.</li><li>Input a friendly name for your connector, then enter your <strong>Azure Tenant ID</strong> and <strong>Azure Subscription ID</strong>.</li><li>Security Hub will generate an <strong>AWS Role Amazon Resource Name (ARN)</strong> and an <strong>OIDC Provider URL</strong> unique to your account. Copy these parameters.</li></ol><p><strong>Step 4: Configure Federated Credentials in Azure</strong></p><p>Go back to Azure to finalize the secure, passwordless handshake using the parameters from AWS.</p><ol><li>Return to your <strong>App Registration</strong> (AWS-SecurityHub-Connector) in the Azure Portal.</li><li>Select <strong>Certificates &amp; secrets</strong>, then click the <strong>Federated credentials</strong> tab.</li><li>Click <strong>Add credential</strong> and choose <strong>Other issuer</strong> from the dropdown menu.</li><li>Paste the <strong>OIDC Provider URL</strong> provided by AWS into the <strong>Issuer</strong> field.</li><li>In the <strong>Subject identifier</strong> field, enter the AWS Role ARN or specific token parameters displayed in your AWS setup instructions.</li><li>Provide a name for the credential and click <strong>Add</strong>.</li></ol><p><strong>Step 5: Activate and Verify</strong></p><ol><li>Return to the <strong>AWS Security Hub console</strong> and click <strong>Verify and Connect</strong>.</li><li>Security Hub will run an initial handshake to validate the OIDC credentials.</li></ol><p>Once connected, the automated asset discovery process begins. Within a few hours, your Azure Virtual Machines, Container Registries (ACR), Function Apps, and Entra ID configurations will populate directly in your Security Hub console alongside your AWS infrastructure.</p><h4>Conclusion</h4><p>By expanding its perimeter directly into Azure, AWS has built a true cross-cloud posture engine. Teams can now decommission complex pipelines built solely to aggregate findings, letting cloud architects focus on what matters most: mitigating risk quickly and consistently across the entire corporate estate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57076f66286b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive: Amazon S3 Account-Regional Namespaces]]></title>
            <link>https://medium.com/@skukreja95/deep-dive-amazon-s3-account-regional-namespaces-0796e5acf5ae?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/0796e5acf5ae</guid>
            <category><![CDATA[aws-latest-updates]]></category>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 11:09:24 GMT</pubDate>
            <atom:updated>2026-03-17T11:18:52.423Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌍 Introduction</h3><p>For over a decade, <strong>Amazon S3</strong> enforced a strict rule:</p><blockquote><em>Bucket names must be </em><strong><em>globally unique across all AWS accounts and regions</em></strong></blockquote><p>While simple in theory, this created real-world challenges in large-scale systems, automation pipelines, and enterprise governance.</p><p>With the introduction of <strong>Account-Regional Namespaces for S3</strong>, AWS has fundamentally changed this behavior — and the implications are bigger than they appear at first glance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*SUOuAxGnFKqQZimdWpOCOg.png" /></figure><h3>The Legacy Model: Global Namespace</h3><p>Under the old model:</p><ul><li>Bucket name uniqueness = <strong>global</strong></li><li>Scope = all AWS customers</li></ul><h3>Example:</h3><pre>aws s3 mb s3://my-company-data</pre><p>Could fail if <em>anyone in the world</em> already created it.</p><h3>Architectural Problems This Caused</h3><h3>1. Non-Deterministic Infrastructure</h3><p>Infrastructure as Code (IaC) pipelines had to:</p><ul><li>Generate random suffixes</li><li>Retry creation</li><li>Maintain state of used names</li></ul><p>Example:</p><pre>my-company-data-8fj3k2l</pre><h3>2. Environment Inconsistency</h3><p>Across environments:</p><ul><li>Dev → different bucket name</li><li>UAT → different bucket name</li><li>Prod → different bucket name</li></ul><p>This broke:</p><ul><li>Reusability</li><li>Standardization</li><li>Automation</li></ul><h3>3. Security Risks</h3><p>A lesser-known issue:</p><ul><li>If a bucket was deleted</li><li>Another account could reuse the same name</li></ul><p>Leading to potential <strong>data exposure or takeover risks</strong></p><h3>✅ The New Model: Account-Regional Namespace</h3><p>AWS now scopes bucket names to:</p><blockquote><strong><em>AWS Account + Region</em></strong></blockquote><h3>What This Means</h3><p>You can now create:</p><pre>my-company-data</pre><p>In:</p><ul><li>Account A → ap-south-1</li><li>Account A → us-east-1</li></ul><p>Even if:</p><ul><li>Another AWS account uses the same name</li></ul><h3>Conceptual Shift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*eRhZP8ARksiB8kwWgmVIag.png" /></figure><h3>Deep Technical Impact</h3><h3>1️⃣ Deterministic Infrastructure (IaC)</h3><p>With tools like Terraform:</p><h3>Before:</h3><pre>resource &quot;aws_s3_bucket&quot; &quot;logs&quot; {<br>  bucket = &quot;acme-logs-${random_string.suffix.result}&quot;<br>}</pre><h3>After:</h3><pre>resource &quot;aws_s3_bucket&quot; &quot;logs&quot; {<br>  bucket = &quot;acme-logs&quot;<br>}</pre><p>No randomness required.</p><h3>2️⃣ CI/CD Simplification</h3><p>Previously, pipelines needed logic like:</p><ul><li>Check if bucket exists</li><li>Retry with new name</li><li>Handle failures</li></ul><p>Now:</p><ul><li>Predictable naming</li><li>Faster deployments</li><li>Fewer edge cases</li></ul><h3>3️⃣ Multi-Environment Design</h3><p>You can now standardize:</p><pre>acme-dev-logs<br>acme-uat-logs<br>acme-prod-logs</pre><p>This improves:</p><ul><li>Readability</li><li>Governance</li><li>Debugging</li></ul><h3>4️⃣ Multi-Region Strategy</h3><p>Same bucket name across regions:</p><pre>acme-data (ap-south-1)<br>acme-data (us-east-1)</pre><p>This enables:</p><ul><li>Clean DR architectures</li><li>Easier replication strategies</li><li>Consistent naming conventions</li></ul><h3>5️⃣ Security Improvements</h3><h3>Namespace Isolation</h3><ul><li>Bucket names are no longer globally reusable</li><li>Reduced risk of malicious takeover</li></ul><h3>Reduced Data Leakage Risk</h3><p>Old risk:</p><ol><li>Delete bucket</li><li>Another account creates same name</li><li>Applications still pointing to old name</li></ol><p>Data leakage possibility</p><p>New model:</p><ul><li>Names scoped to account</li><li>This scenario is significantly mitigated</li></ul><h3>⚙️ How It Works Internally</h3><p>AWS introduces a <strong>logical namespace boundary</strong> tied to:</p><ul><li>Account ID</li><li>Region</li></ul><p>This means:</p><ul><li>Bucket name resolution is no longer global</li><li>DNS and routing are handled within scoped namespaces</li></ul><p>However:</p><ul><li>S3 remains globally accessible</li><li>APIs remain unchanged</li></ul><h3>Limitations &amp; Considerations</h3><h3>️ 1. Existing Buckets</h3><ul><li>Existing buckets remain unchanged</li><li>Still globally unique</li></ul><h3>2. Naming Rules Still Apply</h3><p>You must still follow:</p><ul><li>Length constraints</li><li>Character rules</li><li>DNS-compliant naming</li></ul><h3>3. No Renaming</h3><p>As always:</p><ul><li>Bucket names cannot be changed after creation</li></ul><h3>4. Cross-Account Access</h3><p>Even with new namespaces:</p><ul><li>Access control still depends on IAM policies</li><li>Names may match across accounts, but access is isolated</li></ul><h3>Real-World Use Cases</h3><h3>✅ Enterprise Platforms</h3><ul><li>Standardized naming across environments</li><li>Easier governance policies</li></ul><h3>✅ SaaS Architectures</h3><ul><li>Tenant isolation with predictable bucket names</li><li>Cleaner onboarding automation</li></ul><h3>✅ Data Platforms</h3><ul><li>Simplified ingestion pipelines</li><li>Consistent storage patterns</li></ul><h3>✅ Migration Projects</h3><ul><li>Easier mapping from on-prem storage systems</li><li>No need to refactor naming logic</li></ul><h3>Migration Strategy (If You Want to Adopt)</h3><p>For new workloads:</p><ul><li>Start using deterministic naming immediately</li></ul><p>For existing workloads:</p><ul><li>No forced migration required</li><li>Gradual adoption recommended</li></ul><h3>Key Takeaways</h3><p>✔ No more global naming conflicts<br> ✔ Deterministic infrastructure becomes standard<br> ✔ CI/CD pipelines become simpler<br> ✔ Security posture improves<br> ✔ Multi-region architectures become cleaner</p><h3>Final Thoughts</h3><p>This change might look small on the surface, but for cloud architects and DevOps teams, it removes a <strong>long-standing friction point</strong> in AWS.</p><blockquote><em>The best cloud features are not always the most complex — sometimes they are the ones that simplify everything.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0796e5acf5ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is an MCP Server and Why It Matters in the AI Era]]></title>
            <link>https://medium.com/@skukreja95/what-is-an-mcp-server-and-why-it-matters-in-the-ai-era-fd0ed816e258?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd0ed816e258</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Sun, 28 Dec 2025 10:39:21 GMT</pubDate>
            <atom:updated>2025-12-28T10:39:21.987Z</atom:updated>
            <content:encoded><![CDATA[<p>As AI models become more powerful, a new challenge has emerged:</p><blockquote><strong><em>How do we reliably connect AI models to real-world tools, data, and systems — without hardcoding everything?</em></strong></blockquote><p>This is exactly the problem that <strong>MCP (Model Context Protocol)</strong> is designed to solve.</p><h3>What Is MCP (Model Context Protocol)?</h3><p><strong>MCP (Model Context Protocol)</strong> is an <strong>open protocol</strong> that standardizes how AI models interact with external tools, services, and data sources.</p><p>Think of MCP as:</p><blockquote><strong><em>“USB-C for AI tools”</em></strong></blockquote><p>A universal, structured way for AI models to:</p><ul><li>Discover tools</li><li>Understand how to use them</li><li>Invoke them safely</li></ul><p>Instead of building custom integrations for every AI model and tool, MCP introduces a <strong>common language</strong> between AI and systems.</p><h3>What Is an MCP Server?</h3><p>An <strong>MCP Server</strong> is a service that:</p><ul><li>Exposes tools, APIs, and resources</li><li>Describes them in a standardized, machine-readable format</li><li>Allows AI models (clients) to discover and invoke capabilities dynamically</li><li>Executes actions securely and returns structured results</li></ul><p>In simple terms:</p><blockquote><strong><em>An MCP Server is the bridge between AI models and real systems.</em></strong></blockquote><h3>Traditional AI Integration vs MCP</h3><h4>Before MCP (Old Approach)</h4><p>Each AI application had to:</p><ul><li>Hardcode API integrations</li><li>Write custom prompts for each tool</li><li>Maintain tool logic per model</li><li>Rebuild integrations when models changed</li></ul><pre>LLM → Custom Prompt → Custom API Logic → Tool</pre><p>This approach:</p><ul><li>Doesn’t scale</li><li>Is brittle</li><li>Is hard to maintain</li><li>Locks you into specific models</li></ul><h4>With MCP (Modern Approach)</h4><pre>LLM → MCP Client → MCP Server → Tools &amp; Data</pre><p>Now:</p><ul><li>Tools are self-describing</li><li>Models discover capabilities dynamically</li><li>Same tools work across multiple AI models</li><li>Clean separation of responsibilities</li></ul><h3>Key Components of MCP</h3><h4>MCP Client</h4><ul><li>Runs inside an AI application or agent</li><li>Used by the LLM to:</li><li>Discover tools</li><li>Invoke tools</li><li>Receive structured results</li></ul><h4>MCP Server</h4><ul><li>Hosts tools, APIs, and data</li><li>Describes capabilities using MCP schemas</li><li>Controls execution, validation, and permissions</li></ul><h4>Tools</h4><p>Functions exposed by the MCP server, such as:</p><ul><li>REST APIs</li><li>Databases</li><li>File systems</li><li>Cloud services</li><li>Internal enterprise systems</li></ul><h4>Example MCP Server Capabilities</h4><p>An MCP server might expose tools like:</p><ul><li>get_customer_details</li><li>create_support_ticket</li><li>fetch_sales_report</li><li>read_document</li><li>trigger_workflow</li></ul><p>Each tool defines:</p><ul><li>Input schema</li><li>Output schema</li><li>Description</li><li>Constraints</li></ul><p>So the AI knows <strong>exactly how to use it without guessing</strong>.</p><h3>Why MCP Is Needed in the AI Era</h3><h4>AI Is Moving from Chatbots to Agents</h4><p>Modern AI systems:</p><ul><li>Reason</li><li>Plan</li><li>Take actions</li><li>Use multiple tools</li></ul><p>MCP provides the <strong>missing standard</strong> that enables this safely and consistently.</p><h4>Tool Chaos Is a Real Problem</h4><p>Without MCP:</p><ul><li>Every team builds tools differently</li><li>Models require custom instructions</li><li>Integrations break easily</li></ul><p>MCP solves this by:</p><ul><li>Standardizing tool definitions</li><li>Making tools discoverable</li><li>Reducing prompt engineering complexity</li></ul><h4>Model-Agnostic Tooling</h4><p>With MCP, the same tools work with:</p><ul><li>Claude</li><li>OpenAI models</li><li>Amazon Bedrock models</li><li>Future LLMs</li></ul><p>This <strong>future-proofs</strong> your architecture.</p><h4>Better Security &amp; Governance</h4><p>MCP servers:</p><ul><li>Control what tools are exposed</li><li>Enforce permissions</li><li>Log tool usage</li><li>Validate inputs</li></ul><p>This is <strong>critical for enterprise AI adoption</strong>.</p><h4>Clean Separation of Responsibilities</h4><ul><li><strong>Tool logic</strong> → Platform / Backend teams</li><li><strong>Reasoning &amp; planning</strong> → AI model</li><li><strong>Execution control</strong> → MCP Server</li><li><strong>User experience</strong> → Application team</li></ul><p>This makes AI systems <strong>scalable, maintainable, and auditable</strong>.</p><h3>MCP in AWS-Based AI Architectures</h3><p>In AWS, an MCP server maps naturally to cloud-native services:</p><ul><li><strong>AWS Lambda</strong> — Tool execution</li><li><strong>Amazon API Gateway</strong> — MCP interface</li><li><strong>DynamoDB / RDS</strong> — State &amp; data</li><li><strong>EventBridge / Step Functions</strong> — Async workflows</li><li><strong>Amazon Bedrock</strong> — LLMs</li><li><strong>IAM</strong> — Security &amp; permissions</li><li><strong>CloudWatch / CloudTrail</strong> — Observability</li></ul><h3>How MCP Works: Architecture Deep Dive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*gXm6PPpAP1vGWOOvo45Dng.png" /></figure><h4>AI Agent (LLM)</h4><p>The reasoning engine:</p><ul><li>Understands intent</li><li>Plans steps</li><li>Decides <em>which</em> tool to use</li></ul><p>It <strong>never directly accesses AWS services or APIs</strong>.</p><h4>MCP Client</h4><ul><li>Lives inside the AI agent runtime</li><li>Discovers tools from the MCP server</li><li>Invokes tools using MCP schemas</li><li>Returns structured results to the LLM</li></ul><h4>MCP Server</h4><p>The heart of the architecture:</p><ul><li>Exposes tools</li><li>Validates permissions</li><li>Executes actions</li><li>Returns structured responses</li></ul><p>AWS now provides <strong>fully managed MCP servers</strong> (for example, EKS and ECS MCP servers) that allow AI agents to safely operate infrastructure through natural language.</p><h4>Tools &amp; Data Layer</h4><p>Actual execution happens here:</p><ul><li>AWS Lambda functions</li><li>Internal APIs</li><li>Databases</li><li>Storage systems</li><li>Event-driven workflows</li></ul><p>Each tool is <strong>self-describing and governed</strong>.</p><h4>End-to-End Flow</h4><ol><li>User submits a request</li><li>AI agent reasons about the task</li><li>MCP client discovers tools</li><li>MCP server executes the selected tool</li><li>Results return in structured form</li><li>AI agent responds or continues planning</li></ol><h4>MCP vs Function Calling</h4><p><strong>Function Calling</strong></p><ul><li>❌ No standardization</li><li>❌ Limited tool discovery</li><li>❌ Model-specific</li><li>⚠️ Partial enterprise support</li><li>❌ Minimal governance</li></ul><p><strong>MCP</strong></p><ul><li>✅ Fully standardized</li><li>✅ Built-in tool discovery</li><li>✅ Model-agnostic</li><li>✅ Enterprise-ready</li><li>✅ Strong governance</li></ul><p><strong>MCP is the evolution of function calling.</strong></p><h4>Real-World Use Cases</h4><ul><li>Enterprise AI assistants</li><li>DevOps copilots</li><li>Customer support automation</li><li>Data analysis agents</li><li>Workflow orchestration agents</li><li>IDE copilots</li></ul><p>Anywhere AI needs to <strong>take action</strong>, MCP makes it possible.</p><h3>Final Thoughts</h3><p>MCP is not just another protocol — it’s a <strong>foundational layer for the AI agent ecosystem</strong>.</p><p>In the same way REST standardized web APIs, <strong>MCP standardizes how AI models interact with the real world</strong>.</p><p>If you’re building AI systems today, understanding MCP is no longer optional <strong>it’s essential</strong>.</p><h4>References: AWS MCP &amp; Model Context Protocol</h4><h4>MCP (Model Context Protocol) — Core Concept</h4><ul><li><strong>MCP Official Specification (AWS Labs)</strong><br> <a href="https://awslabs.github.io/mcp/">https://awslabs.github.io/mcp/</a></li></ul><p>This is the best starting point to understand:</p><ul><li>MCP concepts</li><li>Protocol design</li><li>Client–server interaction model</li></ul><h4>Thanks for Reading</h4><p>Thanks for reading!<br> If you have any questions or want to discuss MCP, AI agents, or AWS-based implementations, feel free to reach out.</p><p><strong>Happy building in the AI era!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd0ed816e258" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Enterprise-Grade AI Agent on AWS (Architecture Deep Dive)]]></title>
            <link>https://medium.com/@skukreja95/building-an-enterprise-grade-ai-agent-on-aws-architecture-deep-dive-9cf1e8257f74?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cf1e8257f74</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 07:31:07 GMT</pubDate>
            <atom:updated>2025-12-23T07:31:07.771Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building an Enterprise-Grade AI Agent on AWS</h3><p>Artificial Intelligence is rapidly evolving beyond simple chatbots into <strong>autonomous AI agents</strong> — systems that can reason, plan, take actions, call APIs, and manage memory. AWS has made this evolution practical and production-ready through <strong>Amazon Bedrock Agents</strong> combined with <strong>serverless and event-driven services</strong>.</p><p>In this article, we’ll walk through a <strong>modern AI Agent architecture on AWS</strong>, explain each component in detail, and show how everything fits together to build a <strong>scalable, secure, enterprise-grade AI agent</strong>.</p><h3>Why AI Agents (Not Just Chatbots)?</h3><p>Traditional chatbots:</p><ul><li>Respond only to prompts</li><li>Lack context and memory</li><li>Cannot take real actions</li></ul><p>AI agents, on the other hand, can:</p><ul><li>Understand intent</li><li>Plan multi-step actions</li><li>Call tools and APIs</li><li>Retrieve enterprise knowledge</li><li>Execute workflows</li><li>Maintain long-term memory</li></ul><p>AWS provides <strong>native building blocks</strong> to design these systems cleanly.</p><h3>Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*0UMZPU-A2JDw--StXqQ9-A.png" /></figure><p>This architecture uses <strong>Amazon Bedrock Agents</strong> as the AI brain, supported by <strong>serverless AWS services</strong> for orchestration, memory, tools, and event handling.</p><h3>High-Level Flow</h3><ol><li>A user sends a query from Web, Mobile, or Slack</li><li>API Gateway or AppSync receives the request</li><li>A Lambda Orchestrator manages session and routing</li><li>Amazon Bedrock Agent reasons and plans actions</li><li>The agent:<br>. Retrieves knowledge<br>. Calls tools (APIs)<br>. Triggers workflows</li></ol><p>6. The response is returned and memory is updated</p><h3>Example Use Case</h3><p>Imagine an <strong>Enterprise AI Assistant</strong> that can:</p><ul><li>Answer business questions</li><li>Fetch data from internal systems</li><li>Generate reports</li><li>Create tickets</li><li>Send emails</li><li>Trigger workflows automatically</li></ul><p>For example:</p><blockquote>“Generate a weekly sales summary and email it to my manager.”<br>This architecture handles that end-to-end.</blockquote><h3>Architecture Components Explained</h3><h4>User Interface Layer</h4><p><strong>Examples</strong></p><ul><li>Web application</li><li>Mobile app</li><li>Slack / Microsoft Teams</li></ul><p><strong>Purpose</strong></p><ul><li>Entry point for user interaction</li><li>Sends natural language prompts to backend APIs</li></ul><p>This layer is intentionally thin and stateless.</p><h4>API Layer — API Gateway / AppSync</h4><p><strong>AWS Services</strong></p><ul><li>Amazon API Gateway (REST or WebSocket)</li><li>AWS AppSync (GraphQL, real-time)</li></ul><p><strong>Responsibilities</strong></p><ul><li>Secure API access</li><li>Authentication using Amazon Cognito</li><li>Request validation and throttling</li><li>Routing requests to backend services</li></ul><p>This layer decouples frontend clients from backend logic.</p><h4>Lambda Orchestrator (Control Plane)</h4><p><strong>AWS Service</strong></p><ul><li>AWS Lambda</li></ul><p>The Lambda Orchestrator acts as the <strong>control plane</strong> of the AI agent.</p><p><strong>Key Responsibilities</strong></p><ul><li>Session management</li><li>User context enrichment</li><li>Prompt preprocessing</li><li>Invoking the Bedrock Agent</li><li>Error handling and retries</li></ul><p>This keeps the AI agent <strong>stateless, scalable, and easier to govern</strong>.</p><h4>AI Agent Core — Amazon Bedrock Agents</h4><p>This is the <strong>brain of the architecture</strong>.</p><p><strong>What Bedrock Agents Provide</strong></p><ul><li>Natural language reasoning</li><li>Multi-step planning</li><li>Tool invocation</li><li>Guardrails and safety controls</li><li>Model abstraction</li></ul><p><strong>Supported Foundation Models</strong></p><ul><li>Claude</li><li>Llama</li><li>Amazon Titan</li></ul><p>The agent decides:</p><ul><li>Whether it can answer directly</li><li>Whether it needs enterprise knowledge</li><li>Whether it should call a tool or trigger a workflow</li></ul><h4>Knowledge Base — Retrieval-Augmented Generation (RAG)</h4><p><strong>AWS Services</strong></p><ul><li>Amazon S3 (document storage)</li><li>Amazon OpenSearch (vector search)</li><li>Bedrock Knowledge Base</li></ul><p><strong>Why RAG Matters</strong></p><ul><li>Prevents hallucinations</li><li>Grounds answers in enterprise data</li><li>Improves accuracy and trust</li></ul><p><strong>Typical Knowledge Sources</strong></p><ul><li>Internal policies</li><li>SOPs</li><li>FAQs</li><li>Product documentation</li><li>Reports</li></ul><p>The agent retrieves relevant content before generating responses.</p><h4>Tool Functions — Action Layer</h4><p><strong>AWS Service</strong></p><ul><li>AWS Lambda (Tool APIs)</li></ul><p><strong>What Tools Can Do</strong></p><ul><li>Query databases</li><li>Call internal microservices</li><li>Create Jira or ServiceNow tickets</li><li>Send emails</li><li>Trigger downstream systems</li></ul><p>The AI agent decides <strong>when and how</strong> to invoke these tools.</p><h4>Memory Store — DynamoDB</h4><p><strong>AWS Service</strong></p><ul><li>Amazon DynamoDB</li></ul><p><strong>What Is Stored</strong></p><ul><li>Conversation history</li><li>User preferences</li><li>Agent state</li><li>Past actions</li></ul><p><strong>Why External Memory?</strong></p><ul><li>Durable and scalable</li><li>Auditable</li><li>Supports long-term memory across sessions</li></ul><p>This allows the agent to feel <strong>context-aware and personalized</strong>.</p><h4>Async Workflows &amp; Event-Driven Processing</h4><p><strong>AWS Services</strong></p><ul><li>Amazon EventBridge</li><li>AWS Step Functions</li><li>Amazon SQS</li></ul><p><strong>Use Cases</strong></p><ul><li>Long-running processes</li><li>Parallel execution</li><li>Background tasks</li><li>Notifications and audits</li></ul><p><strong>Example</strong></p><blockquote><em>Agent → EventBridge → Step Functions → Report Generation → Email → Audit Log</em></blockquote><p>This keeps user interactions fast and non-blocking.</p><h4>Security &amp; Monitoring (Cross-Cutting Layer)</h4><p><strong>Security</strong></p><ul><li>IAM (least privilege)</li><li>Amazon Cognito (authentication)</li><li>AWS KMS (encryption)</li><li>Bedrock Guardrails (PII filtering, prompt safety)</li></ul><p><strong>Observability</strong></p><ul><li>Amazon CloudWatch (logs &amp; metrics)</li><li>AWS X-Ray (distributed tracing)</li><li>AWS CloudTrail (auditing)</li></ul><p>Security and monitoring are applied <strong>across every layer</strong>.</p><h4>End-to-End Request Flow</h4><ol><li>User submits a request</li><li>API Gateway authenticates and routes</li><li>Lambda Orchestrator invokes the AI agent</li><li>Agent:<br>. Retrieves knowledge<br>. Calls tools<br>. Triggers workflows</li></ol><p>5. Async processes run in the background</p><p>6. Final response is returned</p><p>7. Memory is persisted</p><h4>Benefits of This Architecture</h4><ul><li>Fully managed AI (no model hosting)</li><li>Automatic scaling</li><li>Pay-per-use pricing</li><li>Enterprise-grade security</li><li>Easy to extend with new tools</li><li>Production-ready and future-proof</li></ul><h4>When Should You Use This?</h4><p>This architecture is ideal for:</p><ul><li>Enterprise AI assistants</li><li>Customer support automation</li><li>DevOps copilots</li><li>HR &amp; Finance automation</li><li>Knowledge search platforms</li><li>AI-driven workflow automation</li></ul><h3>Final Thoughts</h3><p>AWS has made it possible to build <strong>real AI agents</strong>, not just chat interfaces. By combining <strong>Amazon Bedrock Agents</strong> with <strong>serverless, event-driven AWS services</strong>, you get a scalable, secure, and extensible foundation for next-generation intelligent applications.</p><p>If you’re designing AI systems, <strong>this is the reference architecture to start with</strong>.</p><h4>Thank You for Reading</h4><p>Thanks for taking the time to read this article on building an <strong>enterprise-grade AI agent on AWS</strong>. I hope this architecture and explanation help you design scalable, secure, and future-ready AI solutions.</p><p>If you have any questions, need clarifications, or would like to discuss implementation details, feel free to get back to me. I’d be happy to help or exchange ideas.</p><p><strong>Happy building!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cf1e8257f74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Intelligent Chatbot on Azure: A Deep Dive into a Robust Architecture]]></title>
            <link>https://medium.com/@skukreja95/building-an-intelligent-chatbot-on-azure-a-deep-dive-into-a-robust-architecture-9ee79d4e7811?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ee79d4e7811</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 07:15:43 GMT</pubDate>
            <atom:updated>2025-07-16T07:15:43.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAsJ84gYBFA4fLxeThXRKg.png" /></figure><p>In today’s fast-paced digital world, intelligent chatbots are becoming indispensable tools for enhancing user experience, streamlining operations, and providing instant access to information. This post will walk you through a robust and scalable chatbot architecture deployed on Azure, explaining each component and how they work together to deliver a seamless and powerful conversational AI experience.</p><h3>The Core Idea: Empowering Users with Instant Information</h3><p>The primary goal of such a solution is to enable users to quickly and accurately find answers to their queries by leveraging vast internal documentation, which can include PDFs, Word documents, PowerPoint presentations, and even transcripts of multimedia content. This requires a sophisticated backend capable of processing unstructured data, integrating with AI services, and providing a user-friendly interface.</p><h3>Component-by-Component Breakdown</h3><p>Let’s break down the key elements of this architecture:</p><p><strong>1. User Access and Authentication:</strong></p><ul><li><strong>User:</strong> The journey begins with the end-user, who interacts with the chatbot.</li><li><strong>Azure AD SSO (SAML 2.0):</strong> For secure and streamlined access, an organization might implement Azure Active Directory Single Sign-On (SSO) using SAML 2.0. This ensures that only authorized personnel can access the chatbot, leveraging existing enterprise credentials.</li></ul><p><strong>2. Front-End and API Management:</strong></p><ul><li><strong>App Service (UI):</strong> This is the user-facing component of the chatbot. Hosted on Azure App Service, it provides the intuitive graphical interface where users interact with the bot.</li><li><strong>API Management (API MGMT):</strong> Acting as a crucial gateway, Azure API Management sits between the UI and the backend. It handles request routing, security policies, rate limiting, and ensures efficient communication with backend services. This layer is vital for managing and securing API calls.</li></ul><p><strong>3. Backend Processing and Logic:</strong></p><ul><li><strong>App Service (Backend):</strong> This is the core intelligence of the chatbot, housing the main business logic. It receives requests from the UI (via API Management), orchestrates interactions with various AI and data services, and prepares responses for the user.</li><li><strong>Azure Container Registry (ACR):</strong> The entire application (both UI and Backend code) is typically containerized. ACR serves as the central repository for these Docker images, enabling efficient version control and deployment.</li></ul><p><strong>4. The Intelligence Layer: AI and Data Retrieval:</strong></p><ul><li><strong>Containerized Image (UI and Backend Code):</strong> This represents the deployed application, running the UI and backend logic. It acts as the orchestrator for the AI and data interactions.</li><li><strong>OpenAI:</strong> For advanced natural language understanding and generation capabilities, the backend integrates with OpenAI. This allows the chatbot to understand complex queries, generate human-like responses, and engage in more nuanced conversations.</li><li><strong>AI Search:</strong> This is a critical component for retrieving relevant information from a vast document repository. Azure AI Search (formerly Azure Cognitive Search) indexes documents, enabling fast and accurate keyword and semantic searches.</li><li><strong>Blob Storage:</strong> Unstructured data — such as PDFs, Word documents, PowerPoint presentations, and multimedia transcripts — are securely stored in Azure Blob Storage. AI Search then indexes these documents to make them searchable.</li><li><strong>SQL Server (Structured Data):</strong> While much of the data might be unstructured, a SQL Server can be leveraged for structured data. This could be used for specific lookup tables, user profiles, or other structured information relevant to chatbot operations.</li><li><strong>Cosmos DB (To store conversation history):</strong> Azure Cosmos DB, a globally distributed, multi-model database service, is an excellent choice for storing conversation history. This is vital for maintaining context across interactions, personalizing responses, and for analytics purposes.</li></ul><p><strong>5. CI/CD and Deployment:</strong></p><ul><li><strong>App Service Deployments using containerized images on ACR:</strong> A robust development pipeline leverages Continuous Integration/Continuous Deployment (CI/CD) practices. New versions of the chatbot (both UI and Backend) are built as container images, pushed to ACR, and then automatically deployed to Azure App Services, ensuring rapid and reliable updates.</li></ul><h3>Why This Architecture Excels</h3><p>This architecture offers several key advantages for building intelligent chatbots:</p><ul><li><strong>Scalability:</strong> Azure App Services, Blob Storage, Cosmos DB, and AI Search are all highly scalable services, capable of handling increasing user loads and data volumes.</li><li><strong>Modularity:</strong> The clear separation of UI, Backend, API Management, and data services allows for independent development, deployment, and scaling of each component.</li><li><strong>Security:</strong> Azure AD SSO (if implemented) provides robust authentication, and API Management adds an extra layer of security and control over API access.</li><li><strong>Intelligence:</strong> The integration with OpenAI and Azure AI Search empowers the chatbot with advanced AI capabilities, enabling it to understand and respond intelligently to complex queries.</li><li><strong>Maintainability:</strong> Containerization simplifies deployment and ensures consistency across environments, while CI/CD pipelines automate the release process.</li><li><strong>Data Versatility:</strong> The ability to ingest and search both structured (SQL) and unstructured (Blob Storage with AI Search) data makes the chatbot highly versatile.</li></ul><h3>Looking Ahead</h3><p>This architecture provides a solid foundation for an intelligent chatbot. As solutions evolve, further enhancements can be explored, such as integrating more advanced analytics for conversation insights, expanding the knowledge base, and potentially incorporating voice capabilities.</p><p>By leveraging the power of Azure’s comprehensive suite of services, organizations can build chatbots that not only answer questions but truly empower users with instant, accurate, and intelligent information access.</p><p><strong>Thanks for reading! Please let me know in case of any queries or if you’d like to discuss this architecture further.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee79d4e7811" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Infrastructure as Code: Using Terragrunt with Terraform]]></title>
            <link>https://medium.com/@skukreja95/streamlining-infrastructure-as-code-using-terragrunt-with-terraform-bdab20718434?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdab20718434</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 07:34:47 GMT</pubDate>
            <atom:updated>2025-03-20T13:48:12.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-w-dPD_iNaGsXJUXnGjTQ.png" /></figure><p>Infrastructure as Code (IaC) is a critical component of modern DevOps practices. It allows teams to automate and scale infrastructure management while ensuring consistency, reproducibility, and efficiency. While <strong>Terraform</strong> has become the de facto tool for IaC, it can sometimes become cumbersome to manage multiple environments and configurations. This is where <strong>Terragrunt</strong>, a wrapper for Terraform, comes in to simplify the process.</p><p>In this blog post, we will walk you through how to use <strong>Terragrunt</strong> with <strong>Terraform</strong> to manage infrastructure more effectively, with a focus on creating modular, reusable, and environment-specific configurations.</p><h3>What is Terraform and Terragrunt?</h3><h4>Terraform</h4><p>Terraform is an open-source IaC tool developed by HashiCorp. It allows you to define cloud and on-prem infrastructure in declarative configuration files. With Terraform, you can automate the provisioning and management of infrastructure resources across multiple cloud providers like AWS, Azure, Google Cloud, and others.</p><h4>Terragrunt</h4><p>Terragrunt is a thin wrapper for Terraform that provides additional functionality to help manage Terraform configurations. It simplifies the use of Terraform in environments where configurations are large, complex, or shared across multiple teams. Some of its core features include:</p><ul><li><strong>Environment-specific configurations</strong>: Easily manage configurations for different environments (e.g., dev, staging, production).</li><li><strong>Remote backend configuration</strong>: Centralizes the configuration of remote backends like AWS S3, Azure Blob Storage, etc.</li><li><strong>DRY (Don’t Repeat Yourself)</strong>: Helps reduce redundancy in your Terraform code by allowing you to inherit common configurations.</li></ul><h3>Why Use Terragrunt with Terraform?</h3><p>Terraform alone is a powerful tool, but as your infrastructure grows and becomes more complex, maintaining multiple configurations and managing dependencies between resources can become challenging. Here’s why you might want to integrate <strong>Terragrunt</strong> into your workflow:</p><ol><li><strong>Manage Multiple Environments</strong>: Terragrunt makes it easier to manage multiple environments (e.g., dev, staging, prod) by allowing you to define shared configurations and environment-specific overrides.</li><li><strong>Reduce Redundancy</strong>: With Terragrunt, you can avoid duplication by allowing environments to inherit shared configurations, thus reducing repetitive code.</li><li><strong>Centralized Configuration</strong>: Terragrunt provides a way to centralize your Terraform backend configurations, making it easier to manage state files and avoid manual updates to each environment.</li><li><strong>Modular Infrastructure</strong>: Terragrunt helps you structure your infrastructure in a modular way, making it easier to reuse and maintain your Terraform modules.</li><li><strong>State Management</strong>: You can configure Terragrunt to use a remote backend, which helps centralize and manage Terraform’s state file, avoiding potential issues with local state files and allowing teams to collaborate effectively.</li></ol><h3>How to Use Terragrunt with Terraform</h3><p>Let’s look at how to use Terragrunt with Terraform to manage infrastructure in a multi-environment setup.</p><h4>1. Create a Terraform Module</h4><p>First, you need to define your Terraform modules. These modules can represent reusable resources such as networks, compute instances, storage accounts, etc.</p><p><strong>Example: Network Module (</strong><strong>network/main.tf)</strong></p><pre>resource &quot;azurerm_virtual_network&quot; &quot;vnet&quot; {<br>  name                = var.vnet_name<br>  location            = var.location<br>  resource_group_name = var.resource_group_name<br>  address_space       = var.address_space</pre><pre>tags = var.tags<br>}</pre><pre>resource &quot;azurerm_subnet&quot; &quot;subnet&quot; {<br>  name                 = var.subnet_name<br>  resource_group_name  = var.resource_group_name<br>  virtual_network_name = azurerm_virtual_network.vnet.name<br>  address_prefixes     = var.subnet_address_prefixes<br>}</pre><p>This simple module defines a <strong>Virtual Network</strong> and <strong>Subnet</strong> for Azure. The module can be used across multiple environments by passing different input values.</p><h4>2. Terragrunt Configuration for Environment-Specific Overrides</h4><p>Once your Terraform modules are ready, you can use <strong>Terragrunt</strong> to configure the environment-specific settings and manage infrastructure deployments. Let’s look at how you can organize the folder structure and use terragrunt.hcl files to manage the configuration.</p><p><strong>Folder Structure</strong>:</p><pre>/infrastructure<br>  ├── terragrunt.hcl                    # Common settings for all environments<br>  ├── environments/<br>  │   ├── dev/<br>  │   │   ├── terragrunt.hcl            # Dev environment configuration<br>  │   │   ├── network/                  # Network-specific configuration for dev<br>  │   │   ├── compute/                  # Compute-specific configuration for dev<br>  │   ├── prod/<br>  │   │   ├── terragrunt.hcl            # Prod environment configuration<br>  │   │   ├── network/                  # Network-specific configuration for prod<br>  │   │   ├── compute/                  # Compute-specific configuration for prod<br>  ├── modules/<br>  │   ├── network/                      # Reusable network module<br>  │   │   ├── main.tf                   # Network resources (e.g., VPC, Subnet, NSG, etc.)<br>  │   │   ├── variables.tf              # Variables for network module<br>  │   │   └── outputs.tf                # Outputs for network module<br>  │   ├── compute/                      # Reusable compute module<br>  │   │   ├── main.tf                   # Compute resources (e.g., Virtual Machines, Auto Scaling, etc.)<br>  │   │   ├── variables.tf              # Variables for compute module<br>  │   │   └── outputs.tf                # Outputs for compute module</pre><ul><li>The <strong>root-level </strong><strong>terragrunt.hcl</strong> contains shared configurations, such as remote backend configurations, provider settings, and common tags.</li><li>Each <strong>environment folder</strong> (e.g., dev, prod) contains its own terragrunt.hcl file, which overrides the common settings where necessary.</li><li>The <strong>modules</strong> directory contains reusable Terraform modules (like network, compute, etc.), which are used across multiple environments.</li></ul><p><strong>Root-Level </strong><strong>terragrunt.hcl Example</strong>:</p><pre># /infrastructure/terragrunt.hcl<br><br>terraform {<br>  backend &quot;azurerm&quot; {<br>    resource_group_name   = &quot;tfstate-rg&quot;<br>    storage_account_name  = &quot;tfstatestorage&quot;<br>    container_name        = &quot;tfstate&quot;<br>    key                   = &quot;terraform.tfstate&quot;<br>  }<br>}<br><br>locals {<br>  common_tags = {<br>    Project = &quot;MyProject&quot;<br>    Owner   = &quot;DevOps Team&quot;<br>  }<br>}<br><br>include {<br>  path = find_in_parent_folders()<br>}</pre><p><strong>Environment-Specific </strong><strong>terragrunt.hcl Example (Dev Environment)</strong>:</p><pre><br>#/infrastructure/environments/dev/terragrunt.hcl<br><br>locals {<br>  environment_name = &quot;dev&quot;<br>  resource_group   = &quot;dev-rg&quot;<br>  location         = &quot;East US&quot;<br>  tags             = merge(local.common_tags, {<br>    Environment = &quot;dev&quot;<br>  })<br>}<br><br>include {<br>  path = find_in_parent_folders()<br>}</pre><p><strong>Network Module with Terragrunt (</strong><strong>network/terragrunt.hcl)</strong>:</p><pre># /infrastructure/environments/dev/network/terragrunt.hcl<br><br>terraform {<br>  source = &quot;../../../modules/network&quot;<br>}<br><br>inputs = {<br>  resource_group_name   = local.resource_group<br>  location              = local.location<br>  vnet_name             = &quot;dev-vnet&quot;<br>  address_space         = [&quot;10.0.0.0/16&quot;]<br>  subnet_name           = &quot;dev-subnet&quot;<br>  subnet_address_prefixes = [&quot;10.0.1.0/24&quot;]<br>  tags                  = local.tags<br>}</pre><h4>3. Run the Pipeline with Terragrunt</h4><p>With your infrastructure defined and the Terragrunt configurations set up, you can now integrate the infrastructure deployment into a <strong>CI/CD pipeline</strong>. This allows for continuous deployment of infrastructure whenever changes are made to the configuration files.</p><p>For example, you can use <strong>GitHub Actions</strong> to automate the deployment process by triggering Terragrunt commands on pull requests or commits to the main branch.</p><p>Here’s an example of how a basic <strong>GitHub Actions CI/CD pipeline</strong> might look:</p><pre>name: Terragrunt CI/CD Pipeline<br><br>on:<br>  push:<br>    branches:<br>      - main  # Trigger the pipeline on push to the main branch<br>  pull_request:<br>    branches:<br>      - main  # Trigger the pipeline on PR to the main branch<br><br>jobs:<br>  terraform-init:<br>    name: Terraform Initialization<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v2<br><br>      - name: Set up Terraform<br>        uses: hashicorp/setup-terraform@v1<br>        with:<br>          terraform_version: 1.3.7  # Specify your Terraform version<br><br>      - name: Cache Terraform modules<br>        uses: actions/cache@v2<br>        with:<br>          path: ~/.terraform.d/plugin-cache<br>          key: terraform-modules-${{ runner.os }}-${{ hashFiles(&#39;**/*.tf&#39;) }}<br>          restore-keys: |<br>            terraform-modules-${{ runner.os }}-<br><br>      - name: Install Terragrunt<br>        run: |<br>          curl -sSL https://github.com/gruntwork-io/terragrunt/releases/download/v0.42.4/terragrunt_linux_amd64 -o /usr/local/bin/terragrunt<br>          chmod +x /usr/local/bin/terragrunt<br><br>  terraform-plan:<br>    name: Terraform Plan<br>    runs-on: ubuntu-latest<br>    needs: terraform-init<br>    environment:<br>      name: production  # This can be customized for staging or dev environments<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v2<br><br>      - name: Set up Terraform<br>        uses: hashicorp/setup-terraform@v1<br>        with:<br>          terraform_version: 1.3.7<br><br>      - name: Install Terragrunt<br>        run: |<br>          curl -sSL https://github.com/gruntwork-io/terragrunt/releases/download/v0.42.4/terragrunt_linux_amd64 -o /usr/local/bin/terragrunt<br>          chmod +x /usr/local/bin/terragrunt<br><br>      - name: Terraform Plan with Terragrunt<br>        run: |<br>          terragrunt plan --terragrunt-config=./environments/dev/terragrunt.hcl<br><br>  terraform-approval:<br>    name: Terraform Approval<br>    runs-on: ubuntu-latest<br>    needs: terraform-plan<br>    environment:<br>      name: production<br>    if: ${{ github.event_name == &#39;push&#39; }}  # Only proceed for push events, not PRs<br><br>    steps:<br>      - name: Manual approval required<br>        run: echo &quot;Manual approval required before applying Terraform changes.&quot;<br>        <br>      - name: Approve changes (manual step)<br>        uses: peter-evans/manual-approval-action@v2<br>        with:<br>          repo-token: ${{ secrets.GITHUB_TOKEN }}<br>          approvers: &#39;your-username&#39;  # Replace with the GitHub username(s) allowed to approve<br><br>  terraform-apply:<br>    name: Terraform Apply<br>    runs-on: ubuntu-latest<br>    needs: terraform-approval<br>    environment:<br>      name: production  # Set environment to prod or whatever environment you&#39;re working with<br><br>    steps:<br>      - name: Checkout code<br>        uses: actions/checkout@v2<br><br>      - name: Set up Terraform<br>        uses: hashicorp/setup-terraform@v1<br>        with:<br>          terraform_version: 1.3.7<br><br>      - name: Install Terragrunt<br>        run: |<br>          curl -sSL https://github.com/gruntwork-io/terragrunt/releases/download/v0.42.4/terragrunt_linux_amd64 -o /usr/local/bin/terragrunt<br>          chmod +x /usr/local/bin/terragrunt<br><br>      - name: Terraform Apply with Terragrunt<br>        run: |<br>          terragrunt apply --terragrunt-config=./environments/dev/terragrunt.hcl --auto-approve</pre><p>This GitHub Actions pipeline automates the process of initializing and applying your infrastructure using Terragrunt.</p><h3>Conclusion</h3><p>Using <strong>Terragrunt</strong> with <strong>Terraform</strong> significantly improves the management of complex infrastructure setups. By organizing your configurations into reusable modules and managing environment-specific overrides with Terragrunt, you can keep your infrastructure code DRY, scalable, and easy to maintain. Integrating this into a <strong>CI/CD pipeline</strong> ensures automated, repeatable, and consistent deployments, which is crucial for DevOps success.</p><p>If you’re not yet using Terragrunt with Terraform, consider adding it to your workflow to simplify infrastructure management across multiple environments.</p><p>Thanks for Reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdab20718434" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comprehensive Guide to AWS Service Control Policies (SCPs) and Tag Policies]]></title>
            <link>https://medium.com/@skukreja95/comprehensive-guide-to-aws-service-control-policies-scps-and-tag-policies-a73b4fbed834?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a73b4fbed834</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 06:55:29 GMT</pubDate>
            <atom:updated>2024-11-07T07:01:24.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Resource tag key enforcement using SCPs and tag values enforcement using tag policies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkuBEr_IT9ILUy6-XbjG_w.png" /></figure><h3>Introduction</h3><p>AWS provides a wide range of tools to help organizations manage, govern, and secure their cloud resources. Among the most powerful are <strong>Service Control Policies (SCPs)</strong> and <strong>Tag Policies</strong>. While they serve different purposes, both play critical roles in ensuring security, compliance, and cost management within AWS accounts. In this blog, we will explore both tools, explain their purpose and usage, and highlight how they can be leveraged to manage AWS resources effectively.</p><p>In this blog, we will explore how both Tag Policies and SCPs can be leveraged to enhance resource management, enforce governance, and maintain a secure AWS environment, ensuring your cloud infrastructure remains organized, compliant, and under control.</p><h3>1. What Are Tag Policies?</h3><p><strong>Definition</strong>:<br>Tag Policies in AWS are a governance tool designed to enforce consistent tagging practices across AWS resources in an organization. Tags are key-value pairs that can be applied to AWS resources to help identify, categorize, and manage those resources. Tagging can be used for a wide range of purposes, such as cost allocation, resource tracking, and automation.</p><p><strong>Importance</strong>:</p><ul><li><strong>Organize Resources</strong>: Tagging provides a way to categorize and organize resources logically across AWS accounts, which is crucial for large organizations with complex cloud environments.</li><li><strong>Cost Allocation</strong>: Tags help allocate costs to specific departments, projects, or business units.</li><li><strong>Compliance and Reporting</strong>: Many regulations require specific tagging standards to track and report resource usage. Tag Policies help enforce this compliance</li></ul><p><strong>Key Benefits</strong>:</p><ul><li><strong>Consistency</strong>: Ensures all resources follow a standardized tagging scheme.</li><li><strong>Automation</strong>: Tags can trigger automation processes, such as cleaning up unused resources or enabling cost optimization.</li><li><strong>Governance</strong>: Helps enforce governance rules by preventing the application of invalid or missing tags.</li></ul><h3>2. How Tag Policies Work in AWS</h3><p>Tag Policies are part of AWS Organizations and integrate directly with the AWS Resource Groups and AWS Identity and Access Management (IAM) systems.</p><p><strong>Key Features</strong>:</p><ul><li><strong>Policy Definition</strong>: A Tag Policy defines what tags are required for each resource and what format those tags should follow. For example, you might have a policy that enforces the use of Owner and Environment tags.</li><li><strong>Enforcement</strong>: When a resource is created, modified, or deleted, the Tag Policy ensures that the correct tags are present and meet the specified standards.</li><li><strong>Compliance Checking</strong>: AWS Organizations provides a compliance dashboard to monitor and audit resources for tagging consistency.</li></ul><p><strong>How to Create and Enforce Tag Policies</strong>:</p><ul><li><strong>AWS Management Console</strong>: You can define Tag Policies through the AWS Organizations console by specifying tag key names, value formats, and conditions for resources.</li><li><strong>AWS CLI</strong>: Use AWS CLI commands to create and manage Tag Policies programmatically.</li><li><strong>Service Integration</strong>: Tag Policies work across all AWS services that support tagging, such as EC2, S3, RDS, Lambda, etc.</li></ul><h4><strong>Tag policy Enforcement Example</strong></h4><p>Let’s take EC2 instances as an example. During instance creation, AWS Tag Policies can be configured to ensure that specific tags, such as ‘Environment’ or ‘Project,’ are applied. This ensures that all EC2 instances follow the predefined tagging conventions.</p><p><strong>Step 1: Access AWS Organizations Console</strong></p><ul><li>Navigate to the AWS Management Console.</li><li>Open the “AWS Organizations” service.</li><li>Enable Tag policies</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ki2JRoDqQ-k5lM-v.jpeg" /></figure><p><strong>Step 2. Create Tag Policy</strong></p><ul><li>In the left navigation pane, select “Tag policies.”</li><li>Click on “Create tag policy.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dmXWy6OQ8DMAk_lv.jpeg" /></figure><ul><li>Define the tag policy by specifying tag keys and values.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RytRsjeEY5watY_c.jpeg" /></figure><ul><li>Save the policy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eS6mTilt_i9YZEwv.jpeg" /></figure><p><strong>Step 3. Associate Tag Policy with Root or OU or Account</strong></p><ul><li>Associate the created tag policy with the root or specific organizational unit (OU) or Account to enforce it across your AWS organization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0CJYyElR3awjxl2G.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JSCfUIj421sctu9K.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H9cxJ0byF1EDbWSU.jpeg" /></figure><p><strong>Step4: Test the Tag Policy</strong></p><p>Create a new EC2 instance and verify that the tags specified in the tag policy are enforced during creation.</p><h4><strong>Step5: Testing</strong></h4><p><strong>Using the Wrong Tag values</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T9zinklLr8TzhXUH.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Puqc8XfCJ46ncx7S.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LDMhbzrffU1IjGwR.jpeg" /></figure><p><strong>Using the right Tag values</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PMO3gFCWmP3M20j5.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JYMmPreUqaHl4lmf.jpeg" /></figure><p>We have just created a tag policy, which will disallow the creation of an EC2 instance in the AWS accounts without the right values for the defined tags, ‘Environment and Project’.</p><p>Note that the Tag Policy solely validates the accepted value of a tag and not its existence. Users with the necessary IAM permissions will still be able to create resources without tags. To restrict the creation of AWS resources lacking the required tags, we will employ Service Control Policies (SCPs) to establish protective boundaries for resource creation requests.</p><h3>3. Best Practices for Tagging AWS Resources</h3><p>To make the most of Tag Policies, follow these best practices:</p><ol><li><strong>Standardize Tagging Conventions</strong>:</li></ol><ul><li>Create a consistent naming scheme for tag keys (e.g., Owner, Environment, Project).</li><li>Define value constraints (e.g., acceptable Environment values could be Production, Staging, Development).</li></ul><p>2. <strong>Automate Tagging</strong>:</p><ul><li>Use AWS Lambda and AWS CloudFormation to automatically apply tags to resources upon creation.</li><li>Consider using AWS Systems Manager Automation to correct missing or inconsistent tags.</li></ul><p>3. <strong>Ensure Compliance</strong>:</p><ul><li>Regularly audit your environment with AWS Config to ensure that resources adhere to your tagging policies.</li><li>Use AWS Cost Explorer to filter by tags for better resource cost visibility.</li></ul><h3>4. What Are Service Control Policies (SCPs)?</h3><p><strong>Definition</strong>:<br>Service Control Policies (SCPs) are a feature of AWS Organizations that allow administrators to manage permissions across multiple AWS accounts within an organization. SCPs act as a filter, controlling which AWS services and actions can be accessed by the accounts in the organization.</p><p><strong>Importance</strong>:</p><ul><li><strong>Granular Access Control</strong>: SCPs allow you to restrict access to AWS services and APIs across AWS accounts and organizational units (OUs).</li><li><strong>Security and Compliance</strong>: By enforcing least-privilege access, SCPs help prevent accidental or malicious misuse of cloud resources.</li><li><strong>Centralized Governance</strong>: SCPs are applied centrally at the organizational level, which means you can manage access policies for multiple accounts at once.</li></ul><p><strong>Key Benefits</strong>:</p><ul><li><strong>Prevent Unwanted Actions</strong>: Limit what actions users and services can perform, even if the IAM policies allow them.</li><li><strong>Enforce Compliance</strong>: Ensure that only approved actions and services are available to accounts in your organization, which is crucial for regulatory compliance.</li><li><strong>Account Isolation</strong>: SCPs help isolate accounts from each other by restricting cross-account access to services.</li></ul><h3>5. How SCPs Work in AWS</h3><p>SCPs work by defining permission boundaries for AWS accounts. They are attached to <strong>AWS Organizations Organizational Units (OUs)</strong> or individual accounts. SCPs are applied in a hierarchical model, meaning that policies applied to a parent OU will also apply to all its child accounts unless overridden.</p><p><strong>Key Concepts</strong>:</p><ul><li><strong>Allow vs Deny</strong>: SCPs use explicit Allow and Deny statements to grant or restrict access to services or actions. A Deny statement takes precedence over Allow.</li><li><strong>Inheritance</strong>: SCPs applied to a parent OU automatically inherit to its child OUs and accounts. This allows for a hierarchical, policy-driven approach to managing permissions.</li></ul><p><strong>How to Create and Manage SCPs</strong>:</p><ul><li><strong>AWS Management Console</strong>: Create and apply SCPs through the AWS Organizations console.</li><li><strong>AWS CLI</strong>: Use the CLI to programmatically manage SCPs.</li><li><strong>Example Scenario</strong>: Restrict access to specific AWS regions in your organization. You can deny ec2:RunInstances in any region outside the designated set of us-east-1 and us-west-2.</li></ul><h3>6. Common Use Cases for SCPs</h3><p>SCPs can be used in a wide range of scenarios, including:</p><ol><li><strong>Restricting Access to Specific Services</strong>:<br>For example, an organization may want to restrict certain accounts (e.g., non-production) from launching EC2 instances or using Amazon S3.</li><li><strong>Enforcing Security Best Practices</strong>:<br>Deny access to any action that could undermine security, such as disabling CloudTrail, or preventing users from creating IAM roles.</li><li><strong>Preventing Region-based Access</strong>:<br>SCPs can limit access to specific AWS regions, ensuring that resources are only provisioned in approved regions.</li><li><strong>Locking Down Permissions in Sensitive Accounts</strong>:<br>Apply strict policies to accounts with highly sensitive data, like billing or security, to prevent unauthorized actions.</li></ol><h4><strong>SCP Enforcement Example</strong></h4><p>Let’s continue on our previous example. Now we will create an SCP that denies the creation of Amazon EC2 instances when the tag keys ‘Environment’ and ‘Project’ along with their permitted values from the Tag Policy are absent.</p><h4><strong>Step 1: Access AWS Organizations Console</strong></h4><ul><li>Navigate to the AWS Management Console.</li><li>Open the “AWS Organizations” service.</li><li>Enable Service control policies</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DMKBlmB6cxEKYkY_.jpeg" /></figure><h4><strong>Step 2: Create SCP</strong></h4><ul><li>In the left navigation pane, select “Policies.” -&gt; “Service control policies”</li><li>Click on “Create policy.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h-2JsVz59imV3sx7.jpeg" /></figure><ul><li>You can use the tabs on the right side to define the Action, Resources, and Conditions or Choose the “JSON” tab and define the SCP to deny actions based on conditions, like creating EC2 instances without specific tags.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eN9Mgcmj5of1GNJ2.jpeg" /></figure><pre>{<br> &quot;Version&quot;: &quot;2012-10-17&quot;,<br> &quot;Statement&quot;: [<br>  {<br>   &quot;Sid&quot;: &quot;DenyEC2CreationSCP1&quot;,<br>   &quot;Effect&quot;: &quot;Deny&quot;,<br>   &quot;Action&quot;: [<br>    &quot;ec2:RunInstances&quot;<br>   ],<br>   &quot;Resource&quot;: [<br>    &quot;arn:aws:ec2:*:*:instance/*&quot;<br>   ],<br>   &quot;Condition&quot;: {<br>    &quot;Null&quot;: {<br>     &quot;aws:RequestTag/Environment&quot;: &quot;true&quot;<br>    }<br>   }<br>  },<br>  {<br>   &quot;Sid&quot;: &quot;DenyEC2CreationSCP2&quot;,<br>   &quot;Effect&quot;: &quot;Deny&quot;,<br>   &quot;Action&quot;: [<br>    &quot;ec2:RunInstances&quot;<br>   ],<br>   &quot;Resource&quot;: [<br>    &quot;arn:aws:ec2:*:*:instance/*&quot;<br>   ],<br>   &quot;Condition&quot;: {<br>    &quot;Null&quot;: {<br>     &quot;aws:RequestTag/Project&quot;: &quot;true&quot;<br>    }<br>   }<br>  }<br> ]<br>}</pre><ul><li>Save the policy.</li></ul><h4><strong>Step3: Attach SCP to OU or Accounts</strong></h4><ul><li>Associate the created SCP with the root or specific organizational unit (OU) or Account where you want to enforce the policy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yG6PVHCziQbEgBWJ.jpeg" /></figure><h4><strong>Step4: Test the SCP</strong></h4><p>Attempt to create an EC2 instance without the required tags, ensuring that the SCP prevents the action.</p><p><strong>EC2 Creation without the Required Tags</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pz9FPtFG-QzWvbiF.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Cnn0Lg17wveNiJT.jpeg" /></figure><p><strong>EC2 Creation with the Required Tags</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jl_O7Ym6biuVLqxM.jpeg" /></figure><h3>7. Tag Policies vs. SCPs: Key Differences and Use Cases</h3><p><strong>Tag Policies vs SCPs</strong>:<br>While both <strong>Tag Policies</strong> and <strong>SCPs</strong> are powerful tools for governance, they serve different purposes:</p><ul><li><strong>Tag Policies</strong>: Focus on <strong>resource management</strong>, ensuring that resources are tagged consistently for tracking, reporting, and automation purposes.</li><li><strong>SCPs</strong>: Focus on <strong>access control</strong>, ensuring that permissions for services and actions are appropriately restricted across AWS accounts and organizational units.</li></ul><p><strong>When to Use Each</strong>:</p><ul><li><strong>Tag Policies</strong>: Use when you need to enforce standardized tagging for resources to aid with resource management, cost allocation, and reporting.</li><li><strong>SCPs</strong>: Use when you need to manage access to services and resources across multiple accounts, ensuring compliance with security and governance rules.</li></ul><h3><strong>8. Some more examples of Tag Policies and SCPs which can be enforced on all the widely used AWS services</strong></h3><p><strong>Env-Name-App-SCP.json</strong></p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;NameTagEnforcement&quot;,<br>      &quot;Effect&quot;: &quot;Deny&quot;,<br>      &quot;Action&quot;: [<br>        &quot;rds:CreateDBCluster&quot;,<br>        &quot;rds:CreateDBInstance&quot;,<br>        &quot;rds:CreateGlobalCluster&quot;,<br>        &quot;eks:CreateCluster&quot;,<br>        &quot;elasticloadbalancing:CreateLoadBalancer&quot;,<br>        &quot;elasticache:CreateCacheCluster&quot;,<br>        &quot;elasticache:CreateReplicationGroup&quot;,<br>        &quot;ec2:CreateVpc&quot;,<br>        &quot;lambda:CreateFunction&quot;,<br>        &quot;kinesis:CreateStream&quot;,<br>        &quot;cloudfront:CreateDistribution&quot;,<br>        &quot;es:CreateElasticsearchDomain&quot;,<br>        &quot;es:CreateDomain&quot;,<br>        &quot;secretsmanager:CreateSecret&quot;,<br>        &quot;states:CreateActivity&quot;,<br>        &quot;states:CreateStateMachine&quot;,<br>        &quot;ec2:CreateImage&quot;,<br>        &quot;elasticloadbalancing:CreateTargetGroup&quot;<br>      ],<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:ec2:us-west-2:*:vpc/*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:replicationgroup:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:db:*&quot;,<br>        &quot;arn:aws:rds::*:global-cluster:*&quot;,<br>        &quot;arn:aws:ec2:us-west-2::image/*&quot;,<br>        &quot;arn:aws:cloudfront::*:distribution/*&quot;,<br>        &quot;arn:aws:lambda:us-west-2:*:function:*&quot;,<br>        &quot;arn:aws:kinesis:us-west-2:*:stream/*&quot;,<br>        &quot;arn:aws:es:us-west-2:*:domain/*&quot;,<br>        &quot;arn:aws:secretsmanager:us-west-2:*:secret:*&quot;,<br>        &quot;arn:aws:states:us-west-2:*:activity:*&quot;,<br>        &quot;arn:aws:eks:us-west-2:*:cluster/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:loadbalancer/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:targetgroup/*/*&quot;<br>      ],<br>      &quot;Condition&quot;: {<br>        &quot;Null&quot;: {<br>          &quot;aws:RequestTag/Name&quot;: &quot;true&quot;<br>        }<br>      }<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;EnvironmentTagEnforcement&quot;,<br>      &quot;Effect&quot;: &quot;Deny&quot;,<br>      &quot;Action&quot;: [<br>        &quot;rds:CreateDBCluster&quot;,<br>        &quot;rds:CreateDBInstance&quot;,<br>        &quot;rds:CreateGlobalCluster&quot;,<br>        &quot;eks:CreateCluster&quot;,<br>        &quot;elasticloadbalancing:CreateLoadBalancer&quot;,<br>        &quot;elasticloadbalancing:CreateTargetGroup&quot;,<br>        &quot;elasticache:CreateCacheCluster&quot;,<br>        &quot;elasticache:CreateReplicationGroup&quot;,<br>        &quot;ec2:CreateVpc&quot;,<br>        &quot;lambda:CreateFunction&quot;,<br>        &quot;kinesis:CreateStream&quot;,<br>        &quot;cloudfront:CreateDistribution&quot;,<br>        &quot;es:CreateElasticsearchDomain&quot;,<br>        &quot;es:CreateDomain&quot;,<br>        &quot;secretsmanager:CreateSecret&quot;,<br>        &quot;states:CreateActivity&quot;,<br>        &quot;states:CreateStateMachine&quot;,<br>        &quot;ec2:CreateImage&quot;<br>      ],<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:ec2:us-west-2:*:vpc/*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:replicationgroup:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:db:*&quot;,<br>        &quot;arn:aws:rds::*:global-cluster:*&quot;,<br>        &quot;arn:aws:ec2:us-west-2::image/*&quot;,<br>        &quot;arn:aws:cloudfront::*:distribution/*&quot;,<br>        &quot;arn:aws:lambda:us-west-2:*:function:*&quot;,<br>        &quot;arn:aws:kinesis:us-west-2:*:stream/*&quot;,<br>        &quot;arn:aws:es:us-west-2:*:domain/*&quot;,<br>        &quot;arn:aws:secretsmanager:us-west-2:*:secret:*&quot;,<br>        &quot;arn:aws:states:us-west-2:*:activity:*&quot;,<br>        &quot;arn:aws:eks:us-west-2:*:cluster/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:loadbalancer/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:targetgroup/*/*&quot;<br>      ],<br>      &quot;Condition&quot;: {<br>        &quot;Null&quot;: {<br>          &quot;aws:RequestTag/Environment&quot;: &quot;true&quot;<br>        }<br>      }<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;ApplicationTagEnforcement&quot;,<br>      &quot;Effect&quot;: &quot;Deny&quot;,<br>      &quot;Action&quot;: [<br>        &quot;rds:CreateDBCluster&quot;,<br>        &quot;rds:CreateDBInstance&quot;,<br>        &quot;rds:CreateGlobalCluster&quot;,<br>        &quot;eks:CreateCluster&quot;,<br>        &quot;elasticloadbalancing:CreateLoadBalancer&quot;,<br>        &quot;elasticloadbalancing:CreateTargetGroup&quot;,<br>        &quot;elasticache:CreateCacheCluster&quot;,<br>        &quot;elasticache:CreateReplicationGroup&quot;,<br>        &quot;ec2:CreateVpc&quot;,<br>        &quot;lambda:CreateFunction&quot;,<br>        &quot;kinesis:CreateStream&quot;,<br>        &quot;cloudfront:CreateDistribution&quot;,<br>        &quot;es:CreateElasticsearchDomain&quot;,<br>        &quot;es:CreateDomain&quot;,<br>        &quot;secretsmanager:CreateSecret&quot;,<br>        &quot;states:CreateActivity&quot;,<br>        &quot;states:CreateStateMachine&quot;,<br>        &quot;ec2:CreateImage&quot;<br>      ],<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:ec2:us-west-2:*:vpc/*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:elasticache:us-west-2:*:replicationgroup:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:cluster:*&quot;,<br>        &quot;arn:aws:rds:us-west-2:*:db:*&quot;,<br>        &quot;arn:aws:rds::*:global-cluster:*&quot;,<br>        &quot;arn:aws:ec2:us-west-2::image/*&quot;,<br>        &quot;arn:aws:cloudfront::*:distribution/*&quot;,<br>        &quot;arn:aws:lambda:us-west-2:*:function:*&quot;,<br>        &quot;arn:aws:kinesis:us-west-2:*:stream/*&quot;,<br>        &quot;arn:aws:es:us-west-2:*:domain/*&quot;,<br>        &quot;arn:aws:secretsmanager:us-west-2:*:secret:*&quot;,<br>        &quot;arn:aws:states:us-west-2:*:activity:*&quot;,<br>        &quot;arn:aws:eks:us-west-2:*:cluster/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:loadbalancer/*&quot;,<br>        &quot;arn:aws:elasticloadbalancing:us-west-2:*:targetgroup/*/*&quot;<br>      ],<br>      &quot;Condition&quot;: {<br>        &quot;Null&quot;: {<br>          &quot;aws:RequestTag/Application&quot;: &quot;true&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p><strong>Environment-Application-Version-TagPolicy.json</strong></p><pre>{    &quot;tags&quot;: {      &quot;Environment&quot;: {<br>        &quot;tag_key&quot;: {<br>          &quot;@@assign&quot;: &quot;Environment&quot;<br>        },<br>        &quot;tag_value&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;qa&quot;,<br>            &quot;prod&quot;,<br>            &quot;stage&quot;,<br>            &quot;uat&quot;,<br>            &quot;poc&quot;<br>          ]<br>        },<br>        &quot;enforced_for&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;acm:certificate&quot;,<br>            &quot;cloudfront:distribution&quot;,<br>            &quot;dynamodb:table&quot;,<br>            &quot;ec2:image&quot;,<br>            &quot;ec2:instance&quot;,<br>            &quot;ec2:security-group&quot;,<br>            &quot;ec2:snapshot&quot;,<br>            &quot;ec2:subnet&quot;,<br>            &quot;ec2:volume&quot;,<br>            &quot;ec2:vpc&quot;,<br>            &quot;elasticfilesystem:file-system&quot;,<br>            &quot;eks:cluster&quot;,<br>            &quot;ecr:repository&quot;,<br>            &quot;ecs:cluster&quot;,<br>            &quot;ecs:service&quot;,<br>            &quot;ecs:task-set&quot;,<br>            &quot;elasticache:cluster&quot;,<br>            &quot;es:domain&quot;,<br>            &quot;elasticloadbalancing:loadbalancer&quot;,<br>            &quot;elasticloadbalancing:targetgroup&quot;,<br>            &quot;kinesisanalytics:application&quot;,<br>            &quot;kms:key&quot;,<br>            &quot;lambda:function&quot;,<br>            &quot;rds:cluster-endpoint&quot;,<br>            &quot;rds:cluster-pg&quot;,<br>            &quot;rds:pg&quot;,<br>            &quot;rds:secgrp&quot;,<br>            &quot;rds:subgrp&quot;,<br>            &quot;rds:target-group&quot;,<br>            &quot;s3:bucket&quot;,<br>            &quot;secretsmanager:secret&quot;,<br>            &quot;states:activity&quot;,<br>            &quot;states:stateMachine&quot;,<br>            &quot;ssm:document&quot;<br>          ]<br>        }<br>      },<br>      &quot;Application&quot;: {<br>        &quot;tag_key&quot;: {<br>          &quot;@@assign&quot;: &quot;Application&quot;<br>        },<br>        &quot;tag_value&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;insaurance&quot;,<br>            &quot;finance&quot;,<br>            &quot;devops&quot;,<br>            &quot;pharma&quot;<br>          ]<br>        },<br>        &quot;enforced_for&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;acm:certificate&quot;,<br>            &quot;cloudfront:distribution&quot;,<br>            &quot;dynamodb:table&quot;,<br>            &quot;ec2:image&quot;,<br>            &quot;ec2:instance&quot;,<br>            &quot;ec2:security-group&quot;,<br>            &quot;ec2:snapshot&quot;,<br>            &quot;ec2:subnet&quot;,<br>            &quot;ec2:volume&quot;,<br>            &quot;ec2:vpc&quot;,<br>            &quot;elasticfilesystem:file-system&quot;,<br>            &quot;eks:cluster&quot;,<br>            &quot;ecr:repository&quot;,<br>            &quot;ecs:cluster&quot;,<br>            &quot;ecs:service&quot;,<br>            &quot;ecs:task-set&quot;,<br>            &quot;elasticache:cluster&quot;,<br>            &quot;es:domain&quot;,<br>            &quot;elasticloadbalancing:loadbalancer&quot;,<br>            &quot;elasticloadbalancing:targetgroup&quot;,<br>            &quot;kinesisanalytics:application&quot;,<br>            &quot;kms:key&quot;,<br>            &quot;lambda:function&quot;,<br>            &quot;rds:cluster-endpoint&quot;,<br>            &quot;rds:cluster-pg&quot;,<br>            &quot;rds:pg&quot;,<br>            &quot;rds:secgrp&quot;,<br>            &quot;rds:subgrp&quot;,<br>            &quot;rds:target-group&quot;,<br>            &quot;s3:bucket&quot;,<br>            &quot;secretsmanager:secret&quot;,<br>            &quot;states:activity&quot;,<br>            &quot;states:stateMachine&quot;,<br>            &quot;ssm:document&quot;<br>          ]<br>        }<br>      },<br>      &quot;DataClassification&quot;: {<br>        &quot;tag_key&quot;: {<br>          &quot;@@assign&quot;: &quot;DataClassification&quot;<br>        },<br>        &quot;tag_value&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;critical&quot;,<br>            &quot;highlycritical&quot;,<br>            &quot;restricted&quot;,<br>            &quot;internal&quot;,<br>            &quot;confidential&quot;<br>          ]<br>        },<br>        &quot;enforced_for&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;acm:certificate&quot;,<br>            &quot;cloudfront:distribution&quot;,<br>            &quot;dynamodb:table&quot;,<br>            &quot;ec2:image&quot;,<br>            &quot;ec2:instance&quot;,<br>            &quot;ec2:security-group&quot;,<br>            &quot;ec2:snapshot&quot;,<br>            &quot;ec2:subnet&quot;,<br>            &quot;ec2:volume&quot;,<br>            &quot;ec2:vpc&quot;,<br>            &quot;elasticfilesystem:file-system&quot;,<br>            &quot;eks:cluster&quot;,<br>            &quot;ecr:repository&quot;,<br>            &quot;ecs:cluster&quot;,<br>            &quot;ecs:service&quot;,<br>            &quot;ecs:task-set&quot;,<br>            &quot;elasticache:cluster&quot;,<br>            &quot;es:domain&quot;,<br>            &quot;elasticloadbalancing:loadbalancer&quot;,<br>            &quot;elasticloadbalancing:targetgroup&quot;,<br>            &quot;kinesisanalytics:application&quot;,<br>            &quot;kms:key&quot;,<br>            &quot;lambda:function&quot;,<br>            &quot;rds:cluster-endpoint&quot;,<br>            &quot;rds:cluster-pg&quot;,<br>            &quot;rds:pg&quot;,<br>            &quot;rds:secgrp&quot;,<br>            &quot;rds:subgrp&quot;,<br>            &quot;rds:target-group&quot;,<br>            &quot;s3:bucket&quot;,<br>            &quot;secretsmanager:secret&quot;,<br>            &quot;states:activity&quot;,<br>            &quot;states:stateMachine&quot;,<br>            &quot;ssm:document&quot;<br>          ]<br>        }<br>      },<br>      &quot;Version&quot;: {<br>        &quot;tag_key&quot;: {<br>          &quot;@@assign&quot;: &quot;Version&quot;<br>        },<br>        &quot;tag_value&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;v1&quot;,<br>            &quot;v2&quot;,<br>            &quot;v1.1&quot;,<br>            &quot;v1.2&quot;<br>          ]<br>        },<br>        &quot;enforced_for&quot;: {<br>          &quot;@@assign&quot;: [<br>            &quot;acm:certificate&quot;,<br>            &quot;cloudfront:distribution&quot;,<br>            &quot;dynamodb:table&quot;,<br>            &quot;ec2:image&quot;,<br>            &quot;ec2:instance&quot;,<br>            &quot;ec2:security-group&quot;,<br>            &quot;ec2:snapshot&quot;,<br>            &quot;ec2:subnet&quot;,<br>            &quot;ec2:volume&quot;,<br>            &quot;ec2:vpc&quot;,<br>            &quot;elasticfilesystem:file-system&quot;,<br>            &quot;eks:cluster&quot;,<br>            &quot;ecr:repository&quot;,<br>            &quot;ecs:cluster&quot;,<br>            &quot;ecs:service&quot;,<br>            &quot;ecs:task-set&quot;,<br>            &quot;elasticache:cluster&quot;,<br>            &quot;es:domain&quot;,<br>            &quot;elasticloadbalancing:loadbalancer&quot;,<br>            &quot;elasticloadbalancing:targetgroup&quot;,<br>            &quot;kinesisanalytics:application&quot;,<br>            &quot;kms:key&quot;,<br>            &quot;lambda:function&quot;,<br>            &quot;rds:cluster-endpoint&quot;,<br>            &quot;rds:cluster-pg&quot;,<br>            &quot;rds:pg&quot;,<br>            &quot;rds:secgrp&quot;,<br>            &quot;rds:subgrp&quot;,<br>            &quot;rds:target-group&quot;,<br>            &quot;s3:bucket&quot;,<br>            &quot;secretsmanager:secret&quot;,<br>            &quot;states:activity&quot;,<br>            &quot;states:stateMachine&quot;,<br>            &quot;ssm:document&quot;<br>          ]<br>        }<br>      }<br>    }<br>  }</pre><h3>9. Conclusion</h3><p>Tag Policies and SCPs are powerful tools that, when used together, can help organizations maintain control over both their AWS resources and access permissions. By enforcing consistent tagging practices, organizations can better track costs and ensure compliance with governance standards. Similarly, SCPs provide a robust mechanism for ensuring that security policies are adhered to across AWS accounts and organizational units.</p><p>By leveraging both Tag Policies and SCPs, AWS customers can improve resource management, enforce security best practices, and simplify compliance — creating a more efficient and secure cloud environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a73b4fbed834" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating centralized backup via AWS backup service]]></title>
            <link>https://medium.com/@skukreja95/automating-centralized-backup-via-aws-backup-service-377b0234fccf?source=rss-1813fe6a14a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/377b0234fccf</guid>
            <dc:creator><![CDATA[skukreja]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 06:02:23 GMT</pubDate>
            <atom:updated>2023-02-17T06:06:39.667Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Web Services (AWS) announced its new AWS Backup service which is designed to centralize and automate the backing up of data across AWS services in the AWS cloud as well as on-premises using the AWS Storage Gateway. This is Amazon’s first attempt to create a single solution that orchestrates and manages the life cycle of backups across their services.</p><p><strong>Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2NjQb_gqMZROkurejGTzA.png" /><figcaption><strong>AWS Backup Architecture</strong></figcaption></figure><p>We can use AWS Backup service to centrally manage and automate data protection in two ways:<br>1) <strong>Via Management account with backup policies</strong>(In case of Control tower implementation)<br>2) <strong>Via Individual accounts with backup plans</strong>(To manage backups of a single account)</p><p>In this blog, we will focus on how to configure backups using AWS backup service for Disaster Recovery scenarios (Control tower based environment)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3a1eUB3QheuOmEWM66-Iw.png" /><figcaption><strong>Backup architecture for DR scenario</strong></figcaption></figure><p>In the above diagram, we have 4 accounts:<br><strong>1) Management account</strong>(Master account where we will create and manage backup policies)<br><strong>2) Source account</strong>(Account configured for backup)<br><strong>3) Backup account</strong>(Account where all the backups of all accounts will be copied)<br><strong>4) Restoration account</strong>(Account where we will create resources using the backups in case of DR scenario)</p><p><strong>Pre-requisites:<br></strong>1) <strong>Backup Vault</strong> should be present in both the source and backup account<br>2) <strong>Multi-region KMS CMK Key</strong> which will encrypt the backup vault<br>3) <strong>IAM Role</strong> to be created in the source account which will be used by AWS Backup service to take backup and copy it to the backup account<br>4) <strong>SNS topic</strong> to which the failed backup notification will be sent</p><p>You can deploy the below-mentioned CFT in member/source and backup account which will create the above-mentioned resources for you:</p><pre>AWSTemplateFormatVersion: &#39;2010-09-09&#39;<br>Description: <br>  This template creates the Backup KMS Key and Vault required for the automated centralized backup at scale in AWS Organizations using AWS Backup.<br>  It should be deployed in each member account.<br>Metadata:<br>  AWS::CloudFormation::Interface:<br>    ParameterGroups:<br>      -<br>        Label:<br>          default: AWS Backup Configuration<br>        Parameters:<br>          - pCrossAccountBackupRole<br>          - pBackupKeyAlias<br>          - pMemberBackupVaultName<br>    ParameterLabels:<br>      pCrossAccountBackupRole:<br>        default: Enter the name of the Backup IAM Role <br>      pBackupKeyAlias:<br>        default: Name of the AWS Backup KMS key Alias<br>      pMemberBackupVaultName:<br>        default: Name of the AWS Backup vault (Case sensitive)<br><br>Parameters:<br>  pCrossAccountBackupRole:<br>    Type: String<br>    Default: backuprole<br>    Description: This is the name for the cross-account backup role that carries out the backup activities.<br>  pBackupKeyAlias:<br>    Type: String<br>    Default: backupkey<br>    Description: This is the name of the AWS Backup KMS key alias.<br>  pMemberBackupVaultName:<br>    Type: String<br>    Default: backup_vault<br>    Description: This is the name of the member account backup vaults.<br>    AllowedPattern: ^[a-zA-Z0-9\-\_\.]{1,50}$<br>    ConstraintDescription: Backup vault name is case sensitive. Must contain from 2 to 50 alphanumeric and &#39;-_&#39; characters.<br><br><br>  Environment:<br>    Type: String<br>    Description: This is the tag key to assign to resources.<br>  BusinessUnit:<br>    Type: String<br>    Description: This is the tag value to assign to resources.<br>  InfraOwner:<br>    Type: String<br>    Description: This is the tag key to assign to resources.<br>  DataClassification:<br>    Type: String<br>    Description: This is the tag key to assign to resources.   <br><br>Resources:<br>  CrossaccountRole:<br>    Type: &#39;AWS::IAM::Role&#39;<br>    Properties:<br>      RoleName: !Ref pCrossAccountBackupRole<br>      Description: &quot;IAM role for taking backup and to copy it to different account&quot;<br>      AssumeRolePolicyDocument:<br>        Version: &quot;2012-10-17&quot;<br>        Statement:<br>          - Effect: Allow<br>            Principal:<br>              Service:<br>                - backup.amazonaws.com<br>            Action:<br>              - &#39;sts:AssumeRole&#39;<br>      ManagedPolicyArns:<br>        - arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup<br>        - arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForRestores<br>        - arn:aws:iam::aws:policy/AWSBackupFullAccess <br>  rMemberAccountBackupKey:<br>    Type: AWS::KMS::Key<br>    Properties:<br>      Description: Symmetric AWS CMK for Member Account Backup Vault Encryption<br>      EnableKeyRotation: True<br>      MultiRegion: true<br>      KeyPolicy:<br>        Version: &quot;2012-10-17&quot;<br>        Id: !Sub ${pBackupKeyAlias}<br>        Statement:<br>          -<br>            Sid: &quot;Enable IAM User Permissions&quot;<br>            Effect: &quot;Allow&quot;<br>            Principal:<br>              AWS: !Sub arn:aws:iam::${AWS::AccountId}:root<br>            Action: &quot;kms:*&quot;<br>            Resource: &quot;*&quot;<br>          -<br>            Sid: Allow use of the key by authorized Backup principal<br>            Effect: &quot;Allow&quot;<br>            Principal:<br>              AWS: !Sub arn:aws:iam::${AWS::AccountId}:role/${CrossaccountRole}<br>            Action:<br>              - kms:DescribeKey<br>              - kms:Encrypt<br>              - kms:Decrypt<br>              - kms:ReEncrypt*<br>              - kms:GenerateDataKey<br>              - kms:GenerateDataKeyWithoutPlaintext<br>            Resource: &quot;*&quot;<br>            Condition:<br>              StringEquals:<br>                &quot;kms:ViaService&quot;: !Sub &quot;backup.amazonaws.com&quot;<br>          -<br>            Sid: Allow alias creation during setup<br>            Effect: &quot;Allow&quot;<br>            Principal:<br>              AWS: &quot;*&quot;<br>            Action: &quot;kms:CreateAlias&quot;<br>            Resource: &quot;*&quot;<br>            Condition:<br>              StringEquals:<br>                &quot;kms:CallerAccount&quot;: !Sub ${AWS::AccountId}<br>                &quot;kms:ViaService&quot;: !Sub &quot;cloudformation.${AWS::Region}.amazonaws.com&quot;        <br>      Tags:<br>        - Key: Name<br>          Value: !Sub &#39;${Product}-${AppName}-kms&#39;<br>        - Key: Environment<br>          Value: !Sub &#39;${Environment}&#39;<br>        - Key: BusinessUnit<br>          Value: !Sub &#39;${BusinessUnit}&#39;<br>        - Key: InfraOwner<br>          Value: !Sub &#39;${InfraOwner}&#39;<br>        - Key: DataClassification<br>          Value: !Sub &#39;${DataClassification}&#39;          <br><br>  rMemberAccountBackupKeyAlias:<br>    Type: AWS::KMS::Alias<br>    Properties:<br>      AliasName: !Sub alias/${pBackupKeyAlias}<br>      TargetKeyId:<br>        !Ref rMemberAccountBackupKey<br>  rMemberAccountBackupVault:<br>    Type: AWS::Backup::BackupVault<br>    Properties:<br>      BackupVaultName: !Ref pMemberBackupVaultName<br>      EncryptionKeyArn: !GetAtt rMemberAccountBackupKey.Arn<br>      Notifications:<br>        BackupVaultEvents:<br>          - &quot;BACKUP_JOB_EXPIRED&quot;<br>          - &quot;BACKUP_JOB_FAILED&quot;<br>        SNSTopicArn: !Ref FailedBackupTopic<br>      AccessPolicy:<br>        Version: &quot;2012-10-17&quot;<br>        Statement:<br>          - Sid: &quot;Allow access to backup vault&quot;<br>            Effect: Allow<br>            Action: backup:CopyIntoBackupVault<br>            Resource: &quot;*&quot;<br>            Principal: &quot;*&quot;        <br><br>  FailedBackupTopic:<br>    Type: AWS::SNS::Topic<br>    Properties:<br>      TopicName: !Sub &quot;${pMemberBackupVaultName}_failure_notifications&quot;  <br>      DisplayName: &quot;AWS Backup - Failed backup notification&quot;<br>      Tags:<br>        - Key: Name<br>          Value: !Sub &#39;${Product}-${AppName}-topic&#39;<br>        - Key: Environment<br>          Value: !Sub &#39;${Environment}&#39;<br>        - Key: BusinessUnit<br>          Value: !Sub &#39;${BusinessUnit}&#39;<br>        - Key: InfraOwner<br>          Value: !Sub &#39;${InfraOwner}&#39;<br>        - Key: DataClassification<br>          Value: !Sub &#39;${DataClassification}&#39;<br><br>  FailedBackupTopicPolicy:<br>    Type: &#39;AWS::SNS::TopicPolicy&#39;<br>    Properties:<br>      PolicyDocument:<br>        Id: SNSPolicyV1<br>        Version: &#39;2012-10-17&#39;<br>        Statement:<br>          - Sid: Sid1<br>            Effect: Allow<br>            Principal:<br>              Service:<br>                - &#39;backup.amazonaws.com&#39;<br>            Action: &#39;sns:Publish&#39;<br>            Resource: !Ref FailedBackupTopic<br>      Topics:<br>        - !Ref FailedBackupTopic<br><br>Outputs:<br>  oMemberAccountBackupVault:<br>    Value: !Ref rMemberAccountBackupVault<br>  oMemberAccountKMSKey:<br>    Value: !Ref rMemberAccountBackupKey</pre><p>5) <strong>Backup Policy</strong> to be created in the Management/Master account which will in turn take backups of the resources:</p><pre>{<br>  &quot;plans&quot;: {<br>    &quot;cross_account_policy&quot;: {<br>      &quot;regions&quot;: {<br>        &quot;@@assign&quot;: [<br>          &quot;us-east-1&quot;<br>        ]<br>      },<br>      &quot;rules&quot;: {<br>        &quot;cross_account_rule&quot;: {<br>          &quot;schedule_expression&quot;: {<br>            &quot;@@assign&quot;: &quot;cron(40 5 ? * * *)&quot;<br>          },<br>          &quot;start_backup_window_minutes&quot;: {<br>            &quot;@@assign&quot;: &quot;720&quot;<br>          },<br>          &quot;complete_backup_window_minutes&quot;: {<br>            &quot;@@assign&quot;: &quot;10080&quot;<br>          },<br>          &quot;lifecycle&quot;: {<br>            &quot;delete_after_days&quot;: {<br>              &quot;@@assign&quot;: &quot;7&quot;<br>            }<br>          },<br>          &quot;target_backup_vault_name&quot;: {<br>            &quot;@@assign&quot;: &quot;source_account_backup_vault&quot;<br>          },<br>          &quot;recovery_point_tags&quot;: {},<br>          &quot;copy_actions&quot;: {<br>            &quot;arn:aws:backup:region:source-acc-id:backup-vault:vaul-tname&quot;: {<br>              &quot;target_backup_vault_arn&quot;: {<br>                &quot;@@assign&quot;: &quot;arn:aws:backup:region:target-acc-id:backup-vault:targetacc_backup_vault&quot;<br>              },<br>              &quot;lifecycle&quot;: {<br>                &quot;delete_after_days&quot;: {<br>                  &quot;@@assign&quot;: &quot;1&quot;<br>                }<br>              }<br>            }<br>          },<br>          &quot;enable_continuous_backup&quot;: {<br>            &quot;@@assign&quot;: false<br>          }<br>        }<br>      },<br>      &quot;backup_plan_tags&quot;: {<br>        &quot;Name&quot;: {<br>          &quot;tag_key&quot;: {<br>            &quot;@@assign&quot;: &quot;Name&quot;<br>          },<br>          &quot;tag_value&quot;: {<br>            &quot;@@assign&quot;: &quot;cross_account_backup_plan&quot;<br>          }<br>        },<br>        &quot;Owner&quot;: {<br>          &quot;tag_key&quot;: {<br>            &quot;@@assign&quot;: &quot;Owner&quot;<br>          },<br>          &quot;tag_value&quot;: {<br>            &quot;@@assign&quot;: &quot;skukreja&quot;<br>          }<br>        }<br>      },<br>      &quot;selections&quot;: {<br>        &quot;tags&quot;: {<br>          &quot;cross_account_backup_assignment&quot;: {<br>            &quot;iam_role_arn&quot;: {<br>              &quot;@@assign&quot;: &quot;arn:aws:iam::$account:role/backuprole&quot;<br>            },<br>            &quot;tag_key&quot;: {<br>              &quot;@@assign&quot;: &quot;Backup&quot;<br>            },<br>            &quot;tag_value&quot;: {<br>              &quot;@@assign&quot;: [<br>                &quot;yes&quot;<br>              ]<br>            }<br>          }<br>        }<br>      }<br>    }<br>  }<br>}</pre><p>The above policy will run the below-mentioned steps:<br>1) Take a backup of all the resources with the tag as <strong>backup: yes</strong> at 5:40 AM every day<br>2) Save the backup to the backup vault of the source account<br>3) Copy the backup from the source account vault to the backup account vault<br>4) Retain the backup in the backup vault for 7 days</p><p>This policy should be created under the management account, Below mentioned are the steps to create the same:<br>1) Log in to the management account and go to AWS Organizations<br>2) Under that click on the policies tab and select Backup Policies<br>3) Click on create policy, enter the name of the policy<br>4) Select the JSON tab and paste the above JSON policy in it(Replace the name of your backup vault)<br>5) Click on create policy<br>6) Once done attach the policy to the source account(account which has to be configured for taking automated backups)</p><p>Once done it automatically creates the backups in the source account and copies the same to the backup account</p><p>Thanks for reading, If you have any queries or have anything to add then please send a response or add a note!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=377b0234fccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>