<?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 Deepak Singh Kushwah on Medium]]></title>
        <description><![CDATA[Stories by Deepak Singh Kushwah on Medium]]></description>
        <link>https://medium.com/@dskcloudsolutions?source=rss-8c3aa417c1ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lhiO_Dj1jrxVsREEGLjWaw.jpeg</url>
            <title>Stories by Deepak Singh Kushwah on Medium</title>
            <link>https://medium.com/@dskcloudsolutions?source=rss-8c3aa417c1ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:11:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dskcloudsolutions/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[Building Cross-Region Disaster Recovery on AWS with Amazon FSx for NetApp ONTAP and SnapMirror]]></title>
            <link>https://medium.com/@dskcloudsolutions/building-cross-region-disaster-recovery-on-aws-with-amazon-fsx-for-netapp-ontap-and-snapmirror-a2d82755bb9d?source=rss-8c3aa417c1ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2d82755bb9d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[disaster-recovery]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[netapp]]></category>
            <dc:creator><![CDATA[Deepak Singh Kushwah]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 16:48:47 GMT</pubDate>
            <atom:updated>2026-10-16T16:48:47.861Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A hands-on implementation of SMB file replication, regional failover, reverse resynchronization, and controlled failback between Paris and Frankfurt.</em></p><h3>1. Why cross-region disaster recovery matters</h3><p>Imagine a business-critical application that runs successfully in one AWS Region but depends on a shared SMB file system. If the primary Region becomes unavailable, restoring application servers alone is not sufficient: the application also needs access to a usable, consistent copy of its files.</p><p>In this implementation, I configured Amazon FSx for NetApp ONTAP with NetApp SnapMirror to replicate storage from <strong>Europe (Paris), eu-west-3</strong>, to <strong>Europe (Frankfurt), eu-central-1</strong>. Paris serves production writes, while Frankfurt holds a protected disaster recovery (DR) copy. The design also covers what happens after a disaster: promoting Frankfurt, returning the latest data to Paris, and restoring the original replication direction.</p><p>This is a practical storage DR design — not an automatic, zero-data-loss application failover solution. That distinction shaped the runbook and the operational safeguards.</p><h3>2. Architecture and technology choices</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoJBpzZMhMXOreBIRCu36w.png" /><figcaption>Figure 1: High-Level Cross-Region Disaster Recovery Architecture using Amazon FSx for NetApp ONTAP and SnapMirror.</figcaption></figure><p>The primary FSx for ONTAP file system in Paris hosts the production storage virtual machine (SVM), its read/write volume, and the SMB share accessed by application clients. A second FSx for ONTAP file system in Frankfurt hosts the destination SVM and data-protection (DP) volume. SnapMirror asynchronously replicates snapshots across Regions using a configured five-minute schedule.</p><p>The supporting AWS environment includes VPC networking, either Transit Gateway or inter-region VPC peering, security groups, DNS, Active Directory, and Windows EC2 instances for SMB access validation.</p><p><strong>Why this design?</strong> FSx for ONTAP combines AWS-managed file storage with familiar ONTAP replication features. A cross-region destination reduces dependency on a single regional storage environment, while an operator-controlled cutover provides an opportunity to validate the state of the data and application before accepting production writes.</p><h3>3. Establish network connectivity</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zS-rQK0CVutC3yi_42_Q0g.png" /><figcaption>Figure 2: Cross-Region Network Connectivity and Security Configuration for Amazon FSx for NetApp ONTAP.</figcaption></figure><p>Before configuring SnapMirror, ensure private routing between the Paris and Frankfurt VPCs and their ONTAP intercluster interfaces. The implementation runbook uses Transit Gateway or inter-region VPC peering as the connectivity option. Configure routes in both directions and restrict firewall/security-group access to the necessary endpoints.</p><p>The documented ports include <strong>TCP 11104 and 11105</strong> for ONTAP replication and inter-cluster communication and <strong>TCP 445</strong> for SMB clients. DNS, Kerberos, LDAP, and other directory-related ports are required according to the Active Directory design. Confirm routing and reachability before starting cluster peering.</p><h3>4. Configure DNS, Active Directory, and SMB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpDNODYq0rFByH-9oeNoPQ.png" /><figcaption>Figure 3: SMB and Active Directory Setup</figcaption></figure><p>Both SVMs need appropriate DNS configuration and SMB/CIFS integration. Replace the illustrative identifiers below with your own environment values.</p><pre>&gt;&gt; vserver services name-service dns create \<br>  -vserver paris_svm \<br>  -domains corp.example.com \<br>  -name-servers &lt;DNS_IP_1&gt;,&lt;DNS_IP_2&gt;<br><br><br>&gt;&gt; vserver services name-service dns show -vserver paris_svm<br><br>&gt;&gt; vserver services name-service dns check -vserver paris_svm</pre><p>Create and validate the SMB server:</p><pre>&gt;&gt; vserver cifs create \<br>  -vserver paris_svm \<br>  -cifs-server PARIS-FS \<br>  -domain corp.example.com<br><br><br>&gt;&gt; vserver cifs show</pre><p>Create the primary SMB share:</p><pre>&gt;&gt; vserver cifs share create \<br>  -vserver paris_svm \<br>  -share-name fsx1 \<br>  -path /fsx1</pre><p>Prepare corresponding SMB services in Frankfurt for DR activation. Check DNS, directory connectivity, share permissions, and authentication — not only port reachability.</p><h3>5. Establish cluster and SVM peering</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gs1FGsd5Co-nMbsQE79qeA.png" /><figcaption>Figure 4: ONTAP Cluster and SVM Peering</figcaption></figure><p>Cluster peering connects the two ONTAP systems. SVM peering authorizes the relevant storage virtual machines to participate in SnapMirror operations.</p><p>Inspect intercluster interfaces and configure the peer relationship using the actual peer IP addresses and the supported workflow for your ONTAP release:</p><pre>&gt;&gt; network interface show<br><br>&gt;&gt; cluster peer create -peer-addrs &lt;PEER_INTERCLUSTER_IPS&gt;<br><br>&gt;&gt; cluster peer show</pre><p>Then establish SVM peering and accept the request on the peer:</p><pre>&gt;&gt; vserver peer create \<br>  -vserver frankfurt_svm \<br>  -peer-vserver paris_svm \<br>  -applications snapmirror<br><br><br><br>&gt;&gt; vserver peer accept \<br>  -vserver paris_svm \<br>  -peer-vserver frankfurt_svm<br><br><br>&gt;&gt; vserver peer show</pre><p>The exact direction of request and acceptance depends on where you initiate peering. Never publish live intercluster IP addresses, credentials, or internal domain details in a public tutorial.</p><h3>6. Create and initialize SnapMirror</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZpEWIRvL6MfyJ214G9nfQ.png" /><figcaption>Figure 05: Initialize SnapMirror Replication</figcaption></figure><p>The documented setup uses an <strong>XDP SnapMirror relationship</strong>, the <strong>MirrorAllSnapshots</strong> policy, and a <strong>5min</strong> schedule. The destination volume must be prepared as an appropriate data-protection target.</p><p>On the destination environment:</p><pre>&gt;&gt; snapmirror create \<br>  -source-path paris_svm:fsx1 \<br>  -destination-path frankfurt_svm:fsx1 \<br>  -type XDP \<br>  -policy MirrorAllSnapshots \<br>  -schedule 5min<br><br><br>&gt;&gt; snapmirror initialize \<br>  -destination-path frankfurt_svm:fsx1<br><br><br><br>&gt;&gt; snapmirror show<br><br>&gt;&gt; volume show -vserver frankfurt_svm</pre><p>Initialization performs the baseline transfer; subsequent transfers replicate eligible changes. A five-minute schedule does <strong>not</strong> guarantee a five-minute RPO: the actual recovery point depends on successful transfers, transfer time, network health, and the last usable replicated snapshot.</p><h3>7. Seven scenarios: failover, recovery, and failback</h3><h3>Scenario 1 — Healthy steady state</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wD2lrcAEEpnCyGtuS0O9Kw.png" /><figcaption>Figure 06: Normal Operations</figcaption></figure><p>Paris is the production <strong>RW</strong> volume and Frankfurt is the protected <strong>DP</strong> destination. Application clients use the Paris SMB share. Validate relationship health, the last successful transfer, and destination volume state with snapmirror show and volume show.</p><h3>Scenario 2 — Paris becomes unavailable</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TEL_VwScaGjbmTbKxgwfeA.png" /><figcaption>Figure 07: Primary Region Disaster</figcaption></figure><p>When Paris is unreachable, replication transfers cannot complete. Frankfurt retains its last successfully replicated recovery point but remains a protected destination; it has not automatically become writable. The recovery team evaluates the outage and confirms the decision to activate DR.</p><h3>Scenario 3 — Promote Frankfurt and restore SMB access</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ely7r--tHGAz8qK79R8viQ.png" /><figcaption>Figure 08: Failover to Frankfurt</figcaption></figure><p>From the Frankfurt environment, break the SnapMirror relationship to make the DR volume writable:</p><pre>&gt;&gt; snapmirror break -destination-path frankfurt_svm:fsx1</pre><p>Mount the volume and create the share if these are not already present:</p><pre>&gt;&gt; volume mount -vserver frankfurt_svm -volume fsx1 -junction-path /fsx1<br><br>&gt;&gt; vserver cifs share show -vserver frankfurt_svm<br><br>&gt;&gt; vserver cifs share create -vserver frankfurt_svm -share-name fsx1 -path /fsx1</pre><p>On a Windows client:</p><pre>&gt;&gt; Test-NetConnection frankfurt-fs.corp.example.com -Port 445<br><br><br>&gt;&gt; net use Z: \\frankfurt-fs.corp.example.com\fsx1</pre><p>Validate authentication, share access, permissions, file reads, and authorized writes. Application recovery also requires healthy compute, DNS, identity, and endpoint configuration.</p><h3>Scenario 4 — Paris returns with stale data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SfU8M0zfLO0WiO1au_l8Q.png" /><figcaption>Figure 09: Primary Returns with Stale Data</figcaption></figure><p>When Paris comes back, its old volume may still be writable while Frankfurt contains the latest production changes. This is a <strong>split-brain risk</strong>. Do not let applications write to Paris. Frankfurt remains the authoritative source until the recovery process deliberately transfers authority back.</p><h3>Scenario 5 — Reverse synchronization: Frankfurt to Paris</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hj6O9sCWE6n8PjBTop7JBQ.png" /><figcaption>Figure 10: Reverse Resynchronization</figcaption></figure><p>The runbook reverses the replication direction so that the data written during DR can return to Paris:</p><pre>&gt;&gt; snapmirror resync \<br>  -source-path frankfurt_svm:fsx1 \<br>  -destination-path paris_svm:fsx1<br><br><br><br>&gt;&gt; snapmirror show</pre><p><strong>Safety checkpoint:</strong> Before running this command, verify the relationship state, the supported ONTAP resync procedure, common snapshots, and that Paris is prepared as a valid DP destination. Additional relationship or volume-state preparation may be necessary. Resync does not merge divergent writes; destination-only changes can be discarded.</p><h3>Scenario 6 — Controlled failback to Paris</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYMv2VDzsXLRZRRkisOD9A.png" /><figcaption>Figure 11: Controlled Failback</figcaption></figure><p>Stop application writes to Frankfurt, complete and validate the final reverse transfer, and confirm that Paris has the intended recovery point. Only then promote Paris and reconnect production clients:</p><pre>&gt;&gt; snapmirror break -destination-path paris_svm:fsx1<br><br><br>&gt;&gt; volume mount -vserver paris_svm -volume fsx1 -junction-path /fsx1</pre><pre>&gt;&gt; net use Z: \\paris-fs.corp.example.com\fsx1</pre><p>Validate application reads, writes, permissions, and business-critical workflows before declaring the failback complete.</p><h3>Scenario 7 — Restore Paris-to-Frankfurt protection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwDbfXlfK07BSkLCXqcGzQ.png" /><figcaption>Figure 12: Forward Replication Restored</figcaption></figure><p>After safely transitioning the reverse relationship and preparing Frankfurt as a valid DP destination, restore the original direction:</p><pre>&gt;&gt; snapmirror resync \<br>  -source-path paris_svm:fsx1 \<br>  -destination-path frankfurt_svm:fsx1<br><br>&gt;&gt; snapmirror show</pre><p>Confirm Paris is the sole production writer, Frankfurt is protected, and scheduled replication transfers are healthy. The original topology is now restored.</p><h3>8. Benefits of the implementation</h3><p><strong>Cross-region resilience.</strong> Keeping a protected copy in Frankfurt reduces reliance on the Paris storage environment and supports recovery from a regional disruption.</p><p><strong>Efficient incremental replication.</strong> SnapMirror uses snapshot-based transfers, avoiding a complete copy of the dataset on every scheduled update.</p><p><strong>Enterprise SMB compatibility.</strong> The approach preserves a familiar shared-file interface for Windows applications and integrates with directory-based access control.</p><p><strong>Controlled recovery.</strong> Operators can explicitly promote the DR volume, validate applications, and plan failback instead of assuming storage replication automatically restores the full service.</p><p><strong>Managed storage foundation.</strong> FSx for ONTAP provides managed infrastructure while retaining ONTAP replication, snapshots, and file-serving capabilities.</p><p><strong>Repeatable runbook.</strong> The seven-stage procedure documents how to return from disaster operation to the original protected state — a step that is often omitted in DR discussions.</p><h3>9. Limitations and safeguards</h3><p>This implementation uses <strong>manual failover</strong>; SnapMirror alone does not orchestrate application cutover. <strong>Asynchronous replication</strong> can leave a gap between the latest application write and the last replicated recovery point. <strong>Resync is destructive to destination-only changes</strong>, so source/destination direction must be verified. <strong>Split-brain protection</strong> requires operational controls to prevent both Regions from serving production writes. <strong>Cross-region transfer and secondary storage incur costs</strong>. Finally, a storage failover is not evidence that the application has recovered until SMB connectivity, identity, permissions, and business workflows are validated.</p><h3>10. RPO, RTO, and operational readiness</h3><p>The configured transfer schedule is five minutes, but the source material does not establish a measured RPO or RTO. A proper DR exercise should record the last usable replicated recovery point, time to promote the DR volume, time to reconnect clients, application validation time, and total time to restore service. Test the return journey as well: reverse resync, controlled failback, and re-established forward protection.</p><h3>11. Improvements to consider</h3><p>A future iteration could add replication-lag alerts, health dashboards, regular recovery exercises, approval-gated runbooks, and carefully orchestrated operations using AWS Systems Manager or AWS Step Functions. Automation should retain explicit safety checks for source selection, resync direction, and which Region owns production writes.</p><h3>12. Final thoughts</h3><p>The most important lesson from implementing Amazon FSx for NetApp ONTAP SnapMirror across Paris and Frankfurt is that <strong>disaster recovery is more than maintaining a second copy of the data</strong>. A resilient design also needs private connectivity, directory integration, application validation, safe write ownership, a documented reverse-sync procedure, and a tested path back to normal operations.</p><p>For enterprise file workloads on AWS, FSx for ONTAP and SnapMirror offer a practical foundation for building that recovery strategy. The real value comes from making the entire lifecycle understandable, repeatable, and safe.</p><p><em>What controls do you use to prevent split-brain writes during regional failover and failback? I’d be interested to hear how other AWS teams approach this challenge.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2d82755bb9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Boomi Package Build and Deployment Using AWS CodePipeline, CodeBuild, Bitbucket, and…]]></title>
            <link>https://medium.com/@dskcloudsolutions/automating-boomi-package-build-and-deployment-using-aws-codepipeline-codebuild-bitbucket-and-88f4ec3c015e?source=rss-8c3aa417c1ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/88f4ec3c015e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[boomi]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Deepak Singh Kushwah]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 08:42:32 GMT</pubDate>
            <atom:updated>2026-09-23T09:26:29.437Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating Boomi Package Build and Deployment Using AWS CodePipeline, CodeBuild, Bitbucket, and AtomSphere REST APIs</h3><blockquote>A Step-by-Step Guide to Building a Production-Ready CI/CD Pipeline for Boomi</blockquote><p>Managing Boomi deployments manually works when the number of components and environments is small. But as the environment grows, manually creating packaged components, identifying package IDs, selecting target environments, and deploying each component becomes repetitive and error-prone.</p><p>The implementation described both <strong>Boomi package creation and package deployment</strong> through CI/CD pipelines using metadata files, Python, and the <strong>Boomi AtomSphere REST API</strong>.</p><p>In this article, I am implementing the deployment model using:</p><ul><li><strong>Bitbucket Cloud</strong> for source control</li><li><strong>AWS CodePipeline</strong> for CI/CD orchestration</li><li><strong>AWS CodeBuild</strong> for executing Python automation</li><li><strong>AWS Secrets Manager</strong> for Boomi credentials</li><li><strong>Python</strong> for calling Boomi APIs</li><li><strong>Boomi AtomSphere REST API</strong> for package creation and deployment</li></ul><p>The complete automation is divided into two independent workflows:</p><blockquote><strong>Build Pipeline → Creates a Boomi Packaged Component</strong></blockquote><blockquote><strong>Release Pipeline → Deploys the Packaged Component to a target Boomi environment</strong></blockquote><h3>1. Why Automate Boomi Deployment?</h3><p>In a traditional Boomi deployment process, engineers usually perform several steps manually.</p><p>A developer creates or modifies a Boomi component, such as a process, API service, map, or connector.</p><p>Then someone has to:</p><pre>Open Boomi AtomSphere<br>        │<br>        ▼<br>Locate the Component<br>        │<br>        ▼<br>Create Packaged Component<br>        │<br>        ▼<br>Enter Package Version<br>        │<br>        ▼<br>Get Package ID<br>        │<br>        ▼<br>Select Target Environment<br>        │<br>        ▼<br>Deploy Package<br>        │<br>        ▼<br>Verify Deployment</pre><p>This introduces several challenges:</p><p><strong>Manual effort</strong> — engineers repeatedly perform the same deployment steps.</p><p><strong>Deployment inconsistency</strong> — different engineers may follow slightly different procedures.</p><p><strong>Limited traceability</strong> — identifying exactly what was deployed and from which configuration can become difficult.</p><p><strong>Human error</strong> — selecting an incorrect package version or environment can lead to deployment issues.</p><p><strong>Scalability problems</strong> — manual deployment becomes difficult when many components are managed.</p><p>The original implementation addressed these concerns by making the process consistent, traceable, separated between build and deployment, and aligned with CI/CD practices.</p><h3>2. Target Architecture</h3><p>AWS implementation uses <strong>AWS CodePipeline</strong> and <strong>Bitbucket Cloud</strong>.</p><p>The architecture looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rSW-0yL92yTni1HumBL5g.png" /><figcaption>Fig 1: Architecture overview showing a developer’s change flowing through Bitbucket and AWS CodeConnections into separate Build and Release pipelines, each running CodePipeline and CodeBuild, before converging on the Boomi AtomSphere REST API and landing in a Boomi environment.</figcaption></figure><h3>3. Repository Structure</h3><p>I prefer keeping build metadata, release metadata, Python scripts, and CodeBuild configuration separately.</p><p>A simple Bitbucket repository structure can look like this:</p><pre>boomi-cicd/<br>│<br>├── metadata/<br>│   ├── boomi_build_package.csv<br>│   └── boomi_release_package.csv<br>│<br>├── scripts/<br>│   ├── boomi_build_package.py<br>│   └── boomi_release_package.py<br>│<br>├── buildspec/<br>│   ├── build-package.yml<br>│   └── release-package.yml<br>│<br>└── README.md</pre><p>This gives us a clean separation between:</p><pre>Metadata<br>    │<br>    ▼<br>Python Automation<br>    │<br>    ▼<br>Pipeline Execution</pre><h3>4. Prerequisites</h3><p>Before implementing the pipeline, we need the following.</p><blockquote>Boomi Requirements:</blockquote><p>We need access to a Boomi AtomSphere account and the credentials required for API authentication.</p><p>For example:</p><pre>BOOMI_ACCOUNT_ID<br>BOOMI_USERNAME<br>BOOMI_PASSWORD</pre><p>An API token can also be used depending on the authentication model.</p><p>We also need the Component IDs of the Boomi processes, maps, connectors, or APIs that need to be packaged.</p><p>The original implementation identifies these values as prerequisites for the automation.</p><blockquote>AWS Requirements</blockquote><p>We need:</p><pre>AWS Account<br>AWS CodePipeline<br>AWS CodeBuild<br>AWS CodeConnections<br>AWS Secrets Manager<br>AWS IAM<br>Amazon CloudWatch</pre><h3>Bitbucket Requirements</h3><p>We need:</p><pre>Bitbucket Cloud Workspace<br>Bitbucket Repository<br>Required repository permissions</pre><h3>5. Store Boomi Credentials Securely</h3><p>The first step is securing our Boomi API credentials.</p><p>We should never store the following directly inside Python code or the Bitbucket repository:</p><pre>BOOMI_ACCOUNT_ID<br>BOOMI_USERNAME<br>BOOMI_PASSWORD</pre><p>Instead, store them in <strong>AWS Secrets Manager</strong>.</p><p>Create a secret similar to:</p><pre>boomi/cicd/api-credentials</pre><p>with values such as:</p><pre>{<br>  &quot;BOOMI_ACCOUNT_ID&quot;: &quot;xxxxxxxx&quot;,<br>  &quot;BOOMI_USERNAME&quot;: &quot;boomi-api-user&quot;,<br>  &quot;BOOMI_PASSWORD&quot;: &quot;xxxxxxxx&quot;<br>}</pre><p>The architecture becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYozJ2Qo1944Hrq7zwGsgw.png" /><figcaption>Fig 2: Boomi credentials flowing from AWS Secrets Manager into AWS CodeBuild, which authenticates to the Boomi AtomSphere REST API.</figcaption></figure><p>The CodeBuild IAM role should only be given permission to read the required secret.</p><h3>6. Understanding the Build and Release Flow</h3><p>Before configuring AWS, it is important to understand the two separate workflows.</p><h3>Build Workflow</h3><p>The Build Pipeline creates a <strong>Packaged Component</strong>.</p><pre>Boomi Component<br>      │<br>      ▼<br>Build Metadata<br>      │<br>      ▼<br>Build Pipeline<br>      │<br>      ▼<br>Python Script<br>      │<br>      ▼<br>AtomSphere REST API<br>      │<br>      ▼<br>Packaged Component</pre><p>The original automation uses metadata such as:</p><ul><li><strong><em>Component ID</em></strong></li><li><strong><em>Package Version</em></strong></li><li><strong><em>Component Type</em></strong></li><li><strong><em>Branch Name</em></strong></li><li><strong><em>Notes</em></strong></li></ul><h3>Release Workflow</h3><p>The Release Pipeline takes the already-created Packaged Component and deploys it to a target Boomi environment.</p><pre>Packaged Component<br>        │<br>        ▼<br>Release Metadata<br>        │<br>        ▼<br>Release Pipeline<br>        │<br>        ▼<br>Python Script<br>        │<br>        ▼<br>AtomSphere REST API<br>        │<br>        ▼<br>Target Environment</pre><p>For deployment, the original implementation uses:</p><ul><li><strong><em>Package ID</em></strong></li><li><strong><em>Environment ID</em></strong></li><li><strong><em>Notes</em></strong></li></ul><h3>7. Step 1 — Create Build Metadata</h3><p>Create the following file inside the repository:</p><pre>metadata/boomi_build_package.csv</pre><p>The CSV contains the component information required to create the Boomi package.</p><p>Example:</p><pre>componentId,packageVersion,componentType,branchName,notes<br>abc123-component-id,1.0,process,main,Customer transformation process</pre><p>Multiple components can also be maintained:</p><pre>componentId,packageVersion,componentType,branchName,notes<br>COMPONENT_ID_01,1.0,process,main,Customer transformation process<br>COMPONENT_ID_02,2.1,api-service,main,Customer API service<br>COMPONENT_ID_03,1.5,process,main,Invoice processing workflow</pre><p>The metadata has the following purpose.</p><h3>Component ID</h3><p>This uniquely identifies the Boomi component.</p><p>Obtains the Component ID by opening the component in Boomi and checking its component information/browser URL.</p><h3>Package Version</h3><p>The version we want to assign to the packaged component.</p><p>Example:</p><pre>1.0<br>1.1<br>2.0<br>2.1</pre><h3>Component Type</h3><p>The Boomi component type.</p><p>Examples:</p><pre>Process<br>API Service<br>Map<br>Connector</pre><h3>Branch Name</h3><p>The branch where the component exists in Boomi.</p><p>Example:</p><pre>main</pre><h3>Notes</h3><p>A description associated with the package.</p><p>Example:</p><pre>Customer API release for September</pre><h3>8. Step 2 — Create the Build Python Script</h3><p>Now create:</p><pre>scripts/boomi_build_package.py</pre><p>The Python script performs the actual automation.</p><p>Its responsibility is:</p><pre>Read Build CSV<br>      │<br>      ▼<br>Read Component Metadata<br>      │<br>      ▼<br>Authenticate to Boomi<br>      │<br>      ▼<br>Prepare REST API Payload<br>      │<br>      ▼<br>Call AtomSphere REST API<br>      │<br>      ▼<br>Create Packaged Component<br>      │<br>      ▼<br>Return Package Information</pre><p>This is the same underlying mechanism used in the original implementation, where the Python script reads the CSV file and calls the AtomSphere REST API.</p><p>A simplified structure can look like this:</p><pre>import csv<br>import os<br>import requests<br><br>account_id = os.environ[&quot;BOOMI_ACCOUNT_ID&quot;]<br>username = os.environ[&quot;BOOMI_USERNAME&quot;]<br>password = os.environ[&quot;BOOMI_PASSWORD&quot;]<br>with open(&quot;metadata/boomi_build_package.csv&quot;) as csv_file:<br>    reader = csv.DictReader(csv_file)<br>    for component in reader:<br>        component_id = component[&quot;componentId&quot;]<br>        package_version = component[&quot;packageVersion&quot;]<br>        component_type = component[&quot;componentType&quot;]<br>        branch_name = component[&quot;branchName&quot;]<br>        notes = component[&quot;notes&quot;]<br>        print(f&quot;Building component: {component_id}&quot;)<br>        print(f&quot;Package version: {package_version}&quot;)<br>        # Prepare Boomi API request<br>        # Call AtomSphere REST API<br>        # Validate response<br>        # Print generated Package ID</pre><p>The production script should reuse the tested AtomSphere API request and payload logic already implemented in the existing solution.</p><h3>9. Step 3 — Create the Build Buildspec</h3><p>AWS CodeBuild uses a <strong>buildspec file</strong> to define the commands that should run during the build.</p><p>Create:</p><pre>buildspec/build-package.yml</pre><p>Example:</p><pre>version: 0.2<br><br>env:<br>  secrets-manager:<br>    BOOMI_ACCOUNT_ID: &quot;boomi/cicd/api-credentials:BOOMI_ACCOUNT_ID&quot;<br>    BOOMI_USERNAME: &quot;boomi/cicd/api-credentials:BOOMI_USERNAME&quot;<br>    BOOMI_PASSWORD: &quot;boomi/cicd/api-credentials:BOOMI_PASSWORD&quot;<br>phases:<br>  install:<br>    runtime-versions:<br>      python: 3.12<br>    commands:<br>      - echo &quot;Installing Python dependencies&quot;<br>      - pip install requests<br>  pre_build:<br>    commands:<br>      - echo &quot;Validating Boomi build metadata&quot;<br>      - test -f metadata/boomi_build_package.csv<br>  build:<br>    commands:<br>      - echo &quot;Starting Boomi package build&quot;<br>      - python scripts/boomi_build_package.py<br>  post_build:<br>    commands:<br>      - echo &quot;Boomi package build completed&quot;</pre><p>The buildspec performs four major operations:</p><pre>Install Python<br>      │<br>      ▼<br>Install Dependencies<br>      │<br>      ▼<br>Validate Metadata<br>      │<br>      ▼<br>Execute Build Script</pre><h3>10. Step 4 — Connect Bitbucket to AWS</h3><p>Because the source code exists in Bitbucket, AWS needs access to the repository.</p><p>Create an <strong>AWS CodeConnections</strong> connection.</p><p>Navigate to:</p><pre>AWS Console<br>    │<br>    ▼<br>Developer Tools<br>    │<br>    ▼<br>Connections<br>    │<br>    ▼<br>Create Connection</pre><p>Select:</p><pre>Provider → Bitbucket</pre><p>Give the connection a name:</p><pre>boomi-bitbucket-connection</pre><p>Authorize the required Bitbucket workspace.</p><p>The connection should eventually show:</p><pre>Status: Available</pre><p>The integration becomes:</p><pre>┌──────────────────────┐<br>│   Bitbucket Cloud    │<br>└──────────┬───────────┘<br>           │<br>           ▼<br>┌──────────────────────┐<br>│ AWS CodeConnections  │<br>└──────────┬───────────┘<br>           │<br>           ▼<br>┌──────────────────────┐<br>│  AWS CodePipeline    │<br>└──────────────────────┘</pre><h3>11. Step 5 — Create the Build CodeBuild Project</h3><p>Navigate to:</p><pre>AWS Console<br>    │<br>    ▼<br>CodeBuild<br>    │<br>    ▼<br>Build Projects<br>    │<br>    ▼<br>Create Build Project</pre><p>Create:</p><pre>boomi-package-build</pre><p>Configure an AWS-managed Linux environment with Python support.</p><p>For the buildspec location, specify:</p><pre>buildspec/build-package.yml</pre><p>Also provide the CodeBuild IAM role permission to access the Secrets Manager secret.</p><p>The flow now becomes:</p><pre>CodePipeline<br>     │<br>     ▼<br>CodeBuild<br>     │<br>     ▼<br>build-package.yml<br>     │<br>     ▼<br>boomi_build_package.py</pre><h3>12. Step 6 — Create the Build CodePipeline</h3><p>Now create the build pipeline.</p><p>Navigate to:</p><pre>AWS Console<br>    │<br>    ▼<br>CodePipeline<br>    │<br>    ▼<br>Create Pipeline</pre><p>Pipeline name:</p><pre>boomi-build-pipeline</pre><h3>Source Stage</h3><p>Configure:</p><pre>Source Provider : Bitbucket<br>Connection      : boomi-bitbucket-connection<br>Repository      : boomi-cicd<br>Branch          : main</pre><h3>Build Stage</h3><p>Configure:</p><pre>Provider : AWS CodeBuild<br>Project  : boomi-package-build</pre><p>The completed Build Pipeline looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZirJy8AH1SYEECouTq0Uw.png" /><figcaption>Fig 3: Execution flow of the build pipeline.</figcaption></figure><h3>13. Step 7 — Trigger the Build</h3><p>Suppose we want to create package version:</p><pre>1.5</pre><p>Update:</p><pre>boomi_build_package.csv</pre><p>For example:</p><pre>componentId,packageVersion,componentType,branchName,notes<br>abc123,1.5,process,main,Customer process release 1.5</pre><p>Commit the change to Bitbucket:</p><pre>git add .<br>git commit -m &quot;Create Boomi package version 1.5&quot;<br>git push</pre><p>The complete execution becomes:</p><pre>Developer Commit<br>       │<br>       ▼<br>Bitbucket<br>       │<br>       ▼<br>CodePipeline<br>       │<br>       ▼<br>CodeBuild<br>       │<br>       ▼<br>Read Build CSV<br>       │<br>       ▼<br>Python Script<br>       │<br>       ▼<br>Boomi API<br>       │<br>       ▼<br>Package Created</pre><h3>14. Step 8 — Verify the Package in Boomi</h3><p>Once the Build Pipeline succeeds, log in to Boomi.</p><p>Navigate to:</p><pre>Services<br>    │<br>    ▼<br>Integration<br>    │<br>    ▼<br>Deploy<br>    │<br>    ▼<br>Packaged Components</pre><p>Verify the:</p><pre>Component Name<br>Component Type<br>Version<br>Branch<br>Created Date<br>Notes</pre><p>The original implementation performs the same validation after completing the package build.</p><h3>15. Step 9 — Obtain the Packaged Component ID</h3><p>The deployment pipeline needs the <strong>Packaged Component ID</strong>.</p><p>In Boomi:</p><pre>Packaged Components<br>        │<br>        ▼<br>Select Required Component<br>        │<br>        ▼<br>Settings<br>        │<br>        ▼<br>Packaged Component Details</pre><p>From there, copy:</p><pre>Packaged Component ID</pre><p>The runbook uses this same process to obtain the package ID required for the release workflow.</p><h3>16. Step 10 — Create Release Metadata</h3><p>Now create:</p><pre>metadata/boomi_release_package.csv</pre><p>Example:</p><pre>packageId,environmentId,notes<br>PACKAGE_ID_001,TEST_ENVIRONMENT_ID,Deploy customer process to TEST</pre><p>For multiple components:</p><pre>packageId,environmentId,notes<br>PACKAGE_ID_001,TEST_ENVIRONMENT_ID,Deploy Customer Process<br>PACKAGE_ID_002,TEST_ENVIRONMENT_ID,Deploy Customer API</pre><p>The important difference between build and release metadata is:</p><pre>Build Metadata<br>      │<br>      ├── Component ID<br>      ├── Package Version<br>      ├── Component Type<br>      ├── Branch<br>      └── Notes<br><br><br>Release Metadata<br>      │<br>      ├── Package ID<br>      ├── Environment ID<br>      └── Notes</pre><h3>17. Step 11 — Create the Release Python Script</h3><p>Create:</p><pre>scripts/boomi_release_package.py</pre><p>The release script performs:</p><pre>Read Release CSV<br>        │<br>        ▼<br>Read Package ID<br>        │<br>        ▼<br>Read Environment ID<br>        │<br>        ▼<br>Authenticate to Boomi<br>        │<br>        ▼<br>Prepare Deployment Request<br>        │<br>        ▼<br>Call AtomSphere REST API<br>        │<br>        ▼<br>Deploy Component</pre><p>A simplified structure could look like:</p><pre>import csv<br>import os<br>import requests<br><br>account_id = os.environ[&quot;BOOMI_ACCOUNT_ID&quot;]<br>username = os.environ[&quot;BOOMI_USERNAME&quot;]<br>password = os.environ[&quot;BOOMI_PASSWORD&quot;]<br>with open(&quot;metadata/boomi_release_package.csv&quot;) as csv_file:<br>    reader = csv.DictReader(csv_file)<br>    for package in reader:<br>        package_id = package[&quot;packageId&quot;]<br>        environment_id = package[&quot;environmentId&quot;]<br>        notes = package[&quot;notes&quot;]<br>        print(f&quot;Deploying package: {package_id}&quot;)<br>        print(f&quot;Target environment: {environment_id}&quot;)<br>        # Prepare Boomi deployment API request<br>        # Call AtomSphere REST API<br>        # Validate deployment response</pre><p>The original release automation also reads deployment metadata from CSV and uses the AtomSphere REST API to deploy the packaged component.</p><h3>18. Step 12 — Create the Release Buildspec</h3><p>Create:</p><pre>buildspec/release-package.yml</pre><p>Example:</p><pre>version: 0.2<br><br>env:<br>  secrets-manager:<br>    BOOMI_ACCOUNT_ID: &quot;boomi/cicd/api-credentials:BOOMI_ACCOUNT_ID&quot;<br>    BOOMI_USERNAME: &quot;boomi/cicd/api-credentials:BOOMI_USERNAME&quot;<br>    BOOMI_PASSWORD: &quot;boomi/cicd/api-credentials:BOOMI_PASSWORD&quot;<br>phases:<br>  install:<br>    runtime-versions:<br>      python: 3.12<br>    commands:<br>      - echo &quot;Installing dependencies&quot;<br>      - pip install requests<br>  pre_build:<br>    commands:<br>      - echo &quot;Validating release metadata&quot;<br>      - test -f metadata/boomi_release_package.csv<br>  build:<br>    commands:<br>      - echo &quot;Starting Boomi package deployment&quot;<br>      - python scripts/boomi_release_package.py<br>  post_build:<br>    commands:<br>      - echo &quot;Boomi deployment execution completed&quot;</pre><h3>19. Step 13 — Create the Release CodeBuild Project</h3><p>Create another CodeBuild project:</p><pre>boomi-package-release</pre><p>Use:</p><pre>buildspec/release-package.yml</pre><p>This gives us two independent projects:</p><pre>┌──────────────────────────┐<br>│  boomi-package-build     │<br>│                          │<br>│ Creates Boomi Package    │<br>└──────────────────────────┘<br><br><br>┌──────────────────────────┐<br>│  boomi-package-release   │<br>│                          │<br>│  Deploys Boomi Package   │<br>└──────────────────────────┘</pre><p>Separating these functions is useful because package creation and environment deployment are different lifecycle activities.</p><h3>20. Step 14 — Create the Release Pipeline</h3><p>Create another CodePipeline:</p><pre>boomi-release-pipeline</pre><p>Configure the source as the same Bitbucket repository.</p><p>The basic pipeline becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uyJqam9DDb_eATJSNxv3w.png" /><figcaption>Fig 4: Execution flow of the release pipeline</figcaption></figure><h3>21. Add Approval Before Production</h3><p>For production deployments, I recommend inserting an approval stage.</p><p>The workflow becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBFlBEgLs_BKrd8GlkMUQw.png" /><figcaption>Fid 5: Production release flow</figcaption></figure><p>This provides an additional governance layer before production.</p><h3>22. Step 15 — Trigger the Release Pipeline</h3><p>Update:</p><pre>boomi_release_package.csv</pre><p>For example:</p><pre>packageId,environmentId,notes<br>PACKAGE-123456,TEST-ENV-001,Deploy package version 1.5 to TEST</pre><p>Commit the changes:</p><pre>git add .<br>git commit -m &quot;Deploy Boomi package 1.5 to TEST&quot;<br>git push</pre><p>The deployment workflow becomes:</p><pre>Release Metadata Updated<br>          │<br>          ▼<br>Bitbucket Commit<br>          │<br>          ▼<br>CodePipeline<br>          │<br>          ▼<br>CodeBuild<br>          │<br>          ▼<br>Release Python Script<br>          │<br>          ▼<br>AtomSphere REST API<br>          │<br>          ▼<br>Boomi Environment</pre><h3>23. Step 16 — Verify Deployment in Boomi</h3><p>Once the Release Pipeline finishes successfully, log in to Boomi.</p><p>Navigate to:</p><pre>Services<br>    │<br>    ▼<br>Integration<br>    │<br>    ▼<br>Deploy<br>    │<br>    ▼<br>Deployments</pre><p>Verify:</p><pre>Component Name<br>Package Version<br>Branch<br>Environment<br>Deployment Date<br>Deployment Notes</pre><p>The original implementation also validates the final deployment from the Boomi <strong>Deployments</strong> screen after the release pipeline completes.</p><h3>24. Complete End-to-End Flow</h3><p>Putting everything together, the complete workflow becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCDlyT3KoqqoqS4feSyJiA.png" /><figcaption>Fig 6: Complete End to End Workflow</figcaption></figure><h3>25. End-to-End Execution in Simple Terms</h3><p>The complete process can be summarized like this.</p><h3>Build</h3><pre>Developer<br>   │<br>   ▼<br>Update Build CSV<br>   │<br>   ▼<br>Commit to Bitbucket<br>   │<br>   ▼<br>CodePipeline<br>   │<br>   ▼<br>CodeBuild<br>   │<br>   ▼<br>Python Script<br>   │<br>   ▼<br>AtomSphere API<br>   │<br>   ▼<br>Packaged Component Created</pre><h3>Release</h3><pre>Get Package ID<br>   │<br>   ▼<br>Update Release CSV<br>   │<br>   ▼<br>Commit to Bitbucket<br>   │<br>   ▼<br>CodePipeline<br>   │<br>   ▼<br>Approval<br>   │<br>   ▼<br>CodeBuild<br>   │<br>   ▼<br>Python Script<br>   │<br>   ▼<br>AtomSphere API<br>   │<br>   ▼<br>Boomi Environment</pre><h3>26. Build Once, Deploy Many</h3><p>One of the most important benefits of separating build and deployment is that we do not need to rebuild a component every time it moves to another environment.</p><p>For example:</p><pre>                 ┌───────────────────┐<br>                 │  Package v2.5     │<br>                 └─────────┬─────────┘<br>                           │<br>                           ▼<br>                 ┌───────────────────┐<br>                 │       TEST        │<br>                 └─────────┬─────────┘<br>                           │<br>                           ▼<br>                 ┌───────────────────┐<br>                 │        UAT        │<br>                 └─────────┬─────────┘<br>                           │<br>                           ▼<br>                 ┌───────────────────┐<br>                 │       PROD        │<br>                 └───────────────────┘</pre><p>The same package can be promoted through multiple environments.</p><p>This is much safer than rebuilding the package for each environment because the component tested in TEST and UAT remains the same artifact eventually released into production.</p><h3>27. Recommended Production Flow</h3><p>For an enterprise implementation, the deployment flow can be expanded as follows:</p><pre>┌─────────────────────────┐<br>│    Developer Changes    │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│    Build Boomi Package  │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│       Deploy TEST       │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│      TEST Validation    │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│        Deploy UAT       │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│       UAT Validation    │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│     Production Approval │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│       Deploy PROD       │<br>└────────────┬────────────┘<br>             │<br>             ▼<br>┌─────────────────────────┐<br>│    Verify Deployment    │<br>└─────────────────────────┘</pre><h3>28. Logging and Monitoring</h3><p>CodeBuild logs should provide enough information to understand what happened during execution.</p><p>Useful information to log includes:</p><pre>Component ID<br>Component Name<br>Package Version<br>Package ID<br>Environment ID<br>HTTP Status Code<br>Deployment Status</pre><p>Sensitive information should never be printed.</p><p>Avoid logging:</p><pre>BOOMI_PASSWORD<br>API Token<br>Authorization Header<br>Secret Values</pre><p>The troubleshooting path then becomes straightforward:</p><pre>CodePipeline<br>     │<br>     ▼<br>CodeBuild<br>     │<br>     ▼<br>CloudWatch Logs<br>     │<br>     ▼<br>Boomi API Response</pre><h3>29. Failure Handling</h3><p>The Python scripts should validate the response from Boomi.</p><p>For example:</p><pre>if response.status_code not in [200, 201, 202]:<br><br>print(<br>        f&quot;Boomi API request failed with status: &quot;<br>        f&quot;{response.status_code}&quot;<br>    )<br>    raise SystemExit(1)</pre><p>This creates proper failure propagation:</p><pre>Boomi API Failure<br>       │<br>       ▼<br>Python Script Fails<br>       │<br>       ▼<br>CodeBuild Fails<br>       │<br>       ▼<br>CodePipeline Fails</pre><p>The pipeline therefore cannot report success when the actual Boomi operation failed.</p><h3>30. Security Model</h3><p>The overall security model can look like this:</p><pre>┌──────────────────────────┐<br>│   AWS Secrets Manager    │<br>│                          │<br>│ Boomi Credentials        │<br>└────────────┬─────────────┘<br>             │<br>             ▼<br>┌──────────────────────────┐<br>│   CodeBuild IAM Role     │<br>└────────────┬─────────────┘<br>             │<br>             ▼<br>┌──────────────────────────┐<br>│      AWS CodeBuild       │<br>└────────────┬─────────────┘<br>             │<br>             ▼<br>┌──────────────────────────┐<br>│ Boomi AtomSphere API     │<br>└──────────────────────────┘</pre><p>The key principles are:</p><ul><li><strong><em>Credentials remain outside source control.</em></strong></li><li><strong><em>IAM follows least privilege.</em></strong></li><li><strong><em>Build and release pipelines remain separate.</em></strong></li><li><strong><em>Production deployment can require approval.</em></strong></li><li><strong><em>Pipeline execution is logged.</em></strong></li><li><strong><em>Deployment metadata is version controlled.</em></strong></li></ul><h3>31. Final Architecture</h3><p>The final production architecture is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6DWz3UzDzAMtE8Rj5Woug.png" /><figcaption>Fig 6: End-to-end Boomi CI/CD architecture using Bitbucket, AWS CodePipeline, CodeBuild, and AtomSphere REST APIs to automate package creation and controlled deployment across DEV, TEST, UAT, and PROD environments.</figcaption></figure><p><strong>Supporting services:</strong></p><pre>AWS Secrets Manager  → Boomi API Credentials<br><br>AWS IAM              → Pipeline and CodeBuild Permissions<br>Amazon CloudWatch    → Logs and Troubleshooting<br>AWS CodeConnections  → Bitbucket Integration<br>Bitbucket Cloud      → Source Code and Metadata</pre><h3>32. Key Benefits of This Architecture</h3><ol><li><strong>Consistent Deployments: </strong>Every component follows the same automated process.</li></ol><p><strong>2. Better Traceability: </strong>Build and release metadata is maintained in Bitbucket, providing version history for deployment-related changes.</p><p><strong>3. Reduced Manual Work: </strong>Package creation and deployment are executed through APIs rather than repetitive UI operations.</p><p><strong>4. Secure Credential Management: </strong>Boomi credentials remain in AWS Secrets Manager instead of scripts or repository files.</p><p><strong>5. Separation of Duties: </strong>The Build Pipeline creates artifacts, while the Release Pipeline deploys them.</p><p><strong>6. Controlled Production Deployment: </strong>Manual approval can be introduced before PROD.</p><p><strong>7. Reusable Automation: </strong>The same Python scripts can process different Boomi components simply by changing metadata.</p><p><strong>8. Build Once, Deploy Many: </strong>A single package can be promoted through TEST, UAT, and PROD without rebuilding it.</p><h3>Conclusion</h3><p>The goal of this implementation is not simply to replace a few manual clicks.</p><p>It is to turn Boomi deployment into a <strong>repeatable, secure, traceable, and controlled CI/CD process</strong>.</p><p>Instead of manually creating and deploying packages from the Boomi UI, the deployment lifecycle becomes:</p><pre>Developer<br>    │<br>    ▼<br>Bitbucket<br>    │<br>    ▼<br>AWS CodePipeline<br>    │<br>    ▼<br>AWS CodeBuild<br>    │<br>    ▼<br>Python Automation<br>    │<br>    ▼<br>Boomi AtomSphere REST API<br>    │<br>    ▼<br>  TEST<br>    │<br>    ▼<br>   UAT<br>    │<br>    ▼<br>   PROD</pre><p>By combining <strong>Bitbucket, AWS CodePipeline, AWS CodeBuild, AWS Secrets Manager, Python, and Boomi AtomSphere REST APIs</strong>, we can integrate Boomi deployment into a modern DevOps workflow without changing the core Boomi application.</p><p>The result is a deployment process that is easier to operate, easier to audit, and easier to scale as the number of Boomi components and environments grows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88f4ec3c015e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating PostgreSQL Database Backup and Restore at TB(Terabyte) Scale Using AWS Lambda, ECS…]]></title>
            <link>https://medium.com/@dskcloudsolutions/automating-postgresql-database-backup-and-restore-at-tb-terabyte-scale-using-aws-lambda-ecs-95ddbdea7a5a?source=rss-8c3aa417c1ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/95ddbdea7a5a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-postgresql-backup]]></category>
            <category><![CDATA[aws-postgresql-restore]]></category>
            <dc:creator><![CDATA[Deepak Singh Kushwah]]></dc:creator>
            <pubDate>Thu, 17 Sep 2026 07:51:27 GMT</pubDate>
            <atom:updated>2026-09-17T07:51:27.761Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating PostgreSQL Database Backup and Restore at TB(Terabyte) Scale Using AWS Lambda, ECS Fargate, S3, and CI/CD</h3><p><em>A production architecture where Lambda orchestrates, Fargate does the heavy lifting, S3 holds the backup, and CI/CD keeps engineers out of the terminal.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWSygDQ90tUWtqsarE3RRw.png" /><figcaption><strong>Figure 1: End-to-End Architecture for Automated PostgreSQL Backup and Restore on AWS</strong></figcaption></figure><p>Moving a PostgreSQL database from one environment to another sounds simple:</p><blockquote><strong><em>Take a backup from Dev → store it → restore it into Prod.</em></strong></blockquote><p>But what happens when the PostgreSQL server contains many databases, you need to migrate only <strong>one specific database</strong>, the database is potentially <strong>terabytes in size</strong>, and the entire process needs to be automated through CI/CD?</p><p>At that point, a simple shell script running on a server is no longer enough.<br>In this article, we’ll design an AWS-based automation solution using:</p><ul><li><strong>PostgreSQL </strong><strong>pg_dump and </strong><strong>pg_restore</strong></li><li><strong>AWS Lambda</strong></li><li><strong>Amazon ECS with AWS Fargate</strong></li><li><strong>Amazon S3</strong></li><li><strong>AWS Secrets Manager</strong></li><li><strong>Amazon ECR</strong></li><li><strong>Amazon CloudWatch</strong></li><li><strong>CI/CD pipelines</strong></li></ul><p>The key architectural principle is simple:</p><p><strong>Lambda orchestrates. Fargate performs the heavy work. S3 stores the backup. CI/CD controls the workflow.</strong></p><h3>1. The Problem</h3><p>Imagine a PostgreSQL instance in the Dev environment containing multiple databases:</p><pre>PostgreSQL DEV Instance<br>│<br>├── customer_db<br>├── payment_db<br>├── reporting_db<br>├── inventory_db<br>├── notification_db<br>└── analytics_db</pre><p>Suppose we need only:</p><pre>payment_db</pre><p>and want to restore it into the Production PostgreSQL environment.</p><p>The database could be:</p><pre>50 GB<br>500 GB<br>1 TB<br>3 TB+</pre><p>We also don’t want engineers manually running commands every time a database refresh is required.</p><p>Our objective is therefore:</p><pre>Select Database<br>      ↓<br>Trigger Pipeline<br>      ↓<br>Backup DEV Database<br>      ↓<br>Store Backup in S3<br>      ↓<br>Restore into PROD<br>      ↓<br>Validate<br>      ↓<br>Report Success/Failure</pre><h3>2. Why Not Perform Everything Inside Lambda?</h3><p>A common first idea is:</p><pre>CI/CD<br>   ↓<br>Lambda<br>   ↓<br>pg_dump<br>   ↓<br>  S3<br>   ↓<br>pg_restore</pre><p>This works conceptually, but Lambda is not the correct compute service for a TB-scale PostgreSQL operation.</p><p>AWS Lambda has a maximum execution duration of <strong>15 minutes</strong>.</p><p>A multi-hundred-GB or TB-scale PostgreSQL dump can take significantly longer.</p><p>Instead, Lambda should act as the <strong>orchestrator</strong>.</p><p>The actual long-running PostgreSQL operation belongs in ECS Fargate.</p><p>Our architecture becomes:</p><pre>CI/CD Pipeline<br>       │<br>       ▼<br>AWS Lambda<br>       │<br>       │ ecs.run_task()<br>       ▼<br>ECS Fargate<br>       │<br>       ├── pg_dump<br>       ├── pg_restore<br>       └── validation<br>       │<br>       ▼<br>Amazon S3</pre><p>This separation is extremely important.</p><h3>3. High-Level Architecture</h3><p>The complete solution can look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lbkBWP4rTQHVadOh9xCZA.png" /><figcaption><strong>Figure 2: End-to-End PostgreSQL Backup and Restore Architecture on AWS</strong></figcaption></figure><p>Supporting services include:</p><pre>AWS Secrets Manager → Database credentials<br>Amazon ECR          → Fargate Docker image<br>CloudWatch Logs     → Execution logs<br>IAM                 → Service permissions<br>KMS                 → Encryption</pre><h3>4. What Exactly Does Lambda Do?</h3><p>This is one of the most important concepts in this architecture.</p><p>Lambda does <strong>not</strong> perform the database backup.</p><p>Lambda tells Fargate:</p><blockquote><strong><em>Start this container and perform a backup of this database using these parameters.</em></strong></blockquote><p>For example, the CI/CD pipeline might invoke Lambda with:</p><pre>{<br>  &quot;action&quot;: &quot;backup&quot;,<br>  &quot;db_name&quot;: &quot;payment_db&quot;,<br>  &quot;source_env&quot;: &quot;dev&quot;,<br>  &quot;target_env&quot;: &quot;prod&quot;,<br>  &quot;s3_bucket&quot;: &quot;company-postgres-backups&quot;,<br>  &quot;s3_prefix&quot;: &quot;database-refresh/payment_db&quot;<br>}</pre><p>Lambda receives this request and converts it into instructions for the ECS task.</p><p>Conceptually:</p><pre>Pipeline says:</pre><pre>ACTION      = backup<br>DB_NAME     = payment_db<br>SOURCE_ENV  = dev</pre><pre>             ↓</pre><pre>Lambda receives request</pre><pre>             ↓</pre><pre>Lambda starts Fargate</pre><pre>             ↓</pre><pre>Fargate receives:</pre><pre>ACTION=backup<br>DB_NAME=payment_db</pre><pre>             ↓</pre><pre>Container executes pg_dump</pre><p>This makes the architecture reusable.</p><p>We don’t need separate Lambda functions or Docker images for every database.</p><h3>5. Lambda Python Code</h3><p>Here is a simplified Lambda implementation:</p><pre>import boto3<br>import os<br>import time<br><br>ecs = boto3.client(&quot;ecs&quot;)<br><br>def lambda_handler(event, context):<br>    action = event[&quot;action&quot;]<br>    db_name = event[&quot;db_name&quot;]<br>    s3_bucket = event[&quot;s3_bucket&quot;]<br>    s3_prefix = event[&quot;s3_prefix&quot;]<br>    job_id = str(int(time.time()))<br>    response = ecs.run_task(<br>        cluster=os.environ[&quot;ECS_CLUSTER&quot;],<br>        launchType=&quot;FARGATE&quot;,<br>        taskDefinition=os.environ[&quot;TASK_DEFINITION&quot;],<br>        networkConfiguration={<br>            &quot;awsvpcConfiguration&quot;: {<br>                &quot;subnets&quot;: os.environ[&quot;SUBNETS&quot;].split(&quot;,&quot;),<br>                &quot;securityGroups&quot;:<br>                    os.environ[&quot;SECURITY_GROUPS&quot;].split(&quot;,&quot;),<br>                &quot;assignPublicIp&quot;: &quot;DISABLED&quot;<br>            }<br>        },<br>        overrides={<br>            &quot;containerOverrides&quot;: [<br>                {<br>                    &quot;name&quot;: os.environ[&quot;CONTAINER_NAME&quot;],<br>                    &quot;environment&quot;: [<br>                        {<br>                            &quot;name&quot;: &quot;ACTION&quot;,<br>                            &quot;value&quot;: action<br>                        },<br>                        {<br>                            &quot;name&quot;: &quot;DB_NAME&quot;,<br>                            &quot;value&quot;: db_name<br>                        },<br>                        {<br>                            &quot;name&quot;: &quot;S3_BUCKET&quot;,<br>                            &quot;value&quot;: s3_bucket<br>                        },<br>                        {<br>                            &quot;name&quot;: &quot;S3_PREFIX&quot;,<br>                            &quot;value&quot;: s3_prefix<br>                        },<br>                        {<br>                            &quot;name&quot;: &quot;JOB_ID&quot;,<br>                            &quot;value&quot;: job_id<br>                        }<br>                    ]<br>                }<br>            ]<br>        }<br>    )<br>    return {<br>        &quot;status&quot;: &quot;started&quot;,<br>        &quot;job_id&quot;: job_id,<br>        &quot;task_arn&quot;: response[&quot;tasks&quot;][0][&quot;taskArn&quot;]<br>    }</pre><p>Notice what Lambda isn’t doing:</p><pre>❌ pg_dump<br>❌ pg_restore<br>❌ downloading TBs of data<br>❌ holding database backup files</pre><p>Instead:</p><pre>✓ validate request<br>✓ generate job ID<br>✓ select ECS task<br>✓ pass runtime parameters<br>✓ start Fargate<br>✓ return task information</pre><p>That is exactly what we want from an orchestration layer.</p><h3>6. How Does Fargate Know What to Do?</h3><p>Our container can have an <strong>entrypoint</strong> script.</p><p>For example:</p><pre>#!/bin/bash<br><br>set -euo pipefail<br>case &quot;$ACTION&quot; in<br>backup)<br>    echo &quot;Starting PostgreSQL backup...&quot;<br>    pg_dump \<br>      -h &quot;$SOURCE_HOST&quot; \<br>      -U &quot;$SOURCE_USER&quot; \<br>      -d &quot;$DB_NAME&quot; \<br>      -Fc \<br>      --no-owner \<br>      --no-acl \<br>    | aws s3 cp - \<br>      &quot;s3://$S3_BUCKET/$S3_PREFIX/${DB_NAME}_${JOB_ID}.dump&quot;<br>    ;;<br>restore)<br>    echo &quot;Starting PostgreSQL restore...&quot;<br>    aws s3 cp \<br>      &quot;s3://$S3_BUCKET/$S3_KEY&quot; - \<br>    | pg_restore \<br>      -h &quot;$TARGET_HOST&quot; \<br>      -U &quot;$TARGET_USER&quot; \<br>      -d &quot;$TARGET_DB&quot; \<br>      --no-owner \<br>      --no-acl<br>    ;;<br>validate)<br>    echo &quot;Validating restored database...&quot;<br>    psql \<br>      -h &quot;$TARGET_HOST&quot; \<br>      -U &quot;$TARGET_USER&quot; \<br>      -d &quot;$TARGET_DB&quot; \<br>      -c &quot;SELECT COUNT(*) FROM information_schema.tables;&quot;<br>    ;;<br>*)<br>    echo &quot;Unsupported ACTION: $ACTION&quot;<br>    exit 1<br>    ;;<br>esac</pre><p>Now the same Docker image can perform multiple operations.</p><pre>ACTION=backup<br>      ↓<br>  pg_dump<br><br><br>ACTION=restore<br>      ↓<br>  pg_restore<br><br><br>ACTION=validate<br>      ↓<br>psql validation</pre><p>This makes the solution much easier to maintain.</p><h3>7. Building the Fargate Container</h3><p>The container only needs the required tooling.</p><p>A simplified Dockerfile could look like:</p><pre>FROM postgres:17<br><br>RUN apt-get update \<br>    &amp;&amp; apt-get install -y awscli \<br>    &amp;&amp; rm -rf /var/lib/apt/lists/*<br>COPY entrypoint.sh /app/entrypoint.sh<br>RUN chmod +x /app/entrypoint.sh<br>ENTRYPOINT [&quot;/app/entrypoint.sh&quot;]</pre><p>The image is built by CI/CD and pushed into Amazon ECR:</p><pre>Git Repository<br>      ↓<br>CI/CD Build<br>      ↓<br>Docker Build<br>      ↓<br>Amazon ECR<br>      ↓<br>ECS Task Definition</pre><p>This gives us version control over the actual migration tooling.</p><h3>8. Why S3?</h3><p>S3 acts as the durable intermediate backup repository.</p><p>For example:</p><pre>s3://company-postgres-backups/<br><br>database-refresh/<br>│<br>├── payment_db/<br>│   ├── payment_db_20260917_001.dump<br>│   ├── payment_db_20260918_001.dump<br>│   └── payment_db_20260919_001.dump<br>│<br>├── customer_db/<br>│<br>└── reporting_db/</pre><p>This gives us:</p><ul><li><strong><em>durable storage</em></strong></li><li><strong><em>encryption</em></strong></li><li><strong><em>versioning options</em></strong></li><li><strong><em>lifecycle policies</em></strong></li><li><strong><em>centralized backup history</em></strong></li><li><strong><em>separation between source and destination databases</em></strong></li></ul><p>A lifecycle policy can automatically delete old migration dumps after, for example, 7 or 30 days.</p><h3>9. Handling TB-Scale Databases</h3><p>This is where architecture decisions become important.</p><p>A Fargate task should generally not download a multi-TB dump onto its local filesystem first.</p><p>Instead of:</p><pre>S3<br> ↓<br>Download 2 TB<br> ↓<br>Fargate disk<br> ↓<br>pg_restore</pre><p>we can stream:</p><pre>PostgreSQL DEV<br>      │<br>      │ pg_dump<br>      ▼<br>   Fargate<br>      │<br>      │ stream<br>      ▼<br>      S3</pre><p>And during restore:</p><pre>S3<br> │<br> │ stream<br> ▼<br>Fargate<br> │<br> │ pg_restore<br> ▼<br>PostgreSQL PROD</pre><p>For example:</p><pre>pg_dump ... |<br>aws s3 cp - s3://bucket/database.dump</pre><p>and:</p><pre>aws s3 cp s3://bucket/database.dump - |<br>pg_restore ...</pre><p>This avoids needing local disk equal to the entire database dump.</p><p>However, there is an important trade-off.</p><p>For very large databases where <strong>parallel dump and parallel restore performance</strong> matters, PostgreSQL’s directory format (-Fd) with multiple jobs (-j) is attractive:</p><pre>pg_dump -Fd -j 16 ...</pre><p>That requires filesystem-style intermediate storage.</p><p>In that design, EFS can be introduced:</p><pre>PostgreSQL DEV<br>      ↓<br>Fargate<br>      ↓<br>     EFS<br>      ↓<br>Parallel backup files<br>      ↓<br>     S3</pre><p>Therefore the storage strategy depends on the performance requirement.</p><h3>10. Never Pass Database Passwords from the Pipeline</h3><p>The pipeline should not contain:</p><pre>DB_PASSWORD=my-secret-password</pre><p>Similarly, Lambda should not send plaintext database credentials as ECS overrides.</p><p>Instead:</p><pre>Secrets Manager<br>                         │<br>            ┌────────────┴────────────┐<br>            │                         │<br>            ▼                         ▼<br>       DEV DB Secret             PROD DB Secret</pre><p>The ECS task retrieves the required credentials using its IAM permissions.</p><p>For example:</p><pre>/dev/postgresql/payment<br>/prod/postgresql/payment</pre><p>The secrets might contain:</p><pre>{<br>  &quot;host&quot;: &quot;dev-postgres.internal&quot;,<br>  &quot;port&quot;: 5432,<br>  &quot;username&quot;: &quot;migration_user&quot;,<br>  &quot;password&quot;: &quot;********&quot;<br>}</pre><p>The Fargate task role gets permission only for the secrets required by the workflow.</p><h3>11. Network Architecture</h3><p>The Fargate task should run inside private subnets.</p><pre>VPC<br>│<br>├── Private Subnet A<br>│      │<br>│      └── Fargate Task<br>│<br>├── Private Subnet B<br>│<br>├── PostgreSQL DEV<br>│<br>└── PostgreSQL PROD</pre><p>The security groups should allow only the required PostgreSQL connectivity.</p><p>Conceptually:</p><pre>Fargate SG<br>     │<br>     │ TCP 5432<br>     ▼<br>PostgreSQL SG</pre><p>For S3 access, an <strong>S3 VPC endpoint</strong> can be used so the traffic doesn’t need to traverse the public internet.</p><h3>12. CI/CD Pipeline Design</h3><p>The CI/CD pipeline becomes the user-facing control plane.</p><p>For example:</p><pre>Stage 1<br>Validate Parameters<br>       ↓<br>Stage 2<br>Deploy/Update Lambda<br>       ↓<br>Stage 3<br>Register ECS Task Definition<br>       ↓<br>Stage 4<br>Invoke Backup<br>       ↓<br>Stage 5<br>Wait for Backup Completion<br>       ↓<br>Stage 6<br>Restore<br>       ↓<br>Stage 7<br>Validate<br>       ↓<br>Stage 8<br>Manual Approval<br>       ↓<br>Stage 9<br>Cutover</pre><p>Runtime pipeline variables might be:</p><pre>ACTION=backup_restore<br>SOURCE_ENV=dev<br>TARGET_ENV=prod<br>DATABASE_NAME=payment_db<br>BACKUP_RETENTION_DAYS=7</pre><p>The engineer triggering the pipeline therefore doesn’t need to SSH into any server.</p><p>They simply select:</p><pre>Database: payment_db<br>Source: DEV<br>Target: PROD</pre><p>and start the pipeline.</p><h3>13. Don’t Restore Directly Over the Production Database</h3><p>This is another important safety measure.</p><p>Instead of:</p><pre>payment_db<br>     ↑<br>restore directly</pre><p>create a temporary database:</p><pre>payment_db_restore_20260917</pre><p>The process becomes:</p><pre>DEV payment_db<br>       ↓<br>     Backup<br>       ↓<br>       S3<br>       ↓<br>     Restore<br>       ↓<br>payment_db_restore_20260917<br>       ↓<br>    Validate<br>       ↓<br> Manual Approval<br>       ↓<br>    Cutover</pre><p>Only after validation should the application be pointed to the restored database or an approved database switch be performed.</p><p>This gives us a rollback path if validation fails.</p><h3>14. Validation Is Part of the Migration</h3><p>A successful pg_restore does not automatically mean the migration was successful.</p><p>Validation should check things such as:</p><pre>✓ Database exists<br>✓ Expected schemas exist<br>✓ Expected tables exist<br>✓ Row counts are reasonable<br>✓ Required extensions exist<br>✓ Sequences are correct<br>✓ Application user permissions work<br>✓ Critical queries execute<br>✓ Application connectivity works</pre><p>For example:</p><pre>SELECT COUNT(*)<br>FROM information_schema.tables<br>WHERE table_schema = &#39;public&#39;;</pre><p>For critical tables:</p><pre>SELECT COUNT(*) FROM transactions;<br>SELECT COUNT(*) FROM customers;<br>SELECT COUNT(*) FROM orders;</pre><p>These checks can themselves be automated by the Fargate validation action.</p><h3>15. Logging and Monitoring</h3><p>Every Fargate task should send logs to CloudWatch.</p><p>A single migration can have a unique Job ID:</p><pre>JOB_ID=PGMIG-20260917-001</pre><p>Logs can then be correlated:</p><pre>PGMIG-20260917-001<br><br>10:01 Backup started<br>10:03 pg_dump connected<br>12:35 Backup completed<br>12:36 S3 upload completed<br>12:37 Restore started<br>15:48 Restore completed<br>15:50 Validation started<br>15:54 Validation successful</pre><p>The pipeline can finally report:</p><pre>Database Migration<br>----------------------------<br><br>Database       : payment_db<br>Source         : DEV<br>Target         : PROD<br>Backup         : SUCCESS<br>Restore        : SUCCESS<br>Validation     : SUCCESS<br>Job ID         : PGMIG-20260917-001</pre><p>CloudWatch alarms/EventBridge notifications can additionally alert the team when an ECS task fails.</p><h3>16. IAM Separation</h3><p>Different components should have different IAM responsibilities.</p><h3>Lambda Role</h3><p>Lambda needs permissions such as:</p><pre>ecs:RunTask<br>iam:PassRole<br>ecs:DescribeTasks</pre><p>It should not require broad database or S3 administrative permissions.</p><h3>ECS Task Role</h3><p>The Fargate task may require:</p><pre>s3:GetObject<br>s3:PutObject<br>s3:ListBucket<br>secretsmanager:GetSecretValue<br>kms:Decrypt<br>kms:Encrypt</pre><p>Apply least privilege wherever possible.</p><h3>17. End-to-End Execution Example</h3><p>Suppose an engineer starts the pipeline with:</p><pre>DATABASE_NAME = payment_db<br>SOURCE_ENV    = dev<br>TARGET_ENV    = prod</pre><h3>Step 1 — Pipeline invokes Lambda</h3><pre>{<br>  &quot;action&quot;: &quot;backup&quot;,<br>  &quot;db_name&quot;: &quot;payment_db&quot;,<br>  &quot;source_env&quot;: &quot;dev&quot;,<br>  &quot;target_env&quot;: &quot;prod&quot;<br>}</pre><h3>Step 2 — Lambda starts Fargate</h3><p>Lambda passes:</p><pre>ACTION=backup<br>DB_NAME=payment_db<br>JOB_ID=PGMIG-001</pre><h3>Step 3 — Fargate reads the Dev secret</h3><pre>Secrets Manager<br>      ↓<br>DEV PostgreSQL credentials</pre><h3>Step 4 — Fargate performs the backup</h3><pre>payment_db<br>     ↓<br>pg_dump<br>     ↓<br>Fargate<br>     ↓<br>S3</pre><p>Result:</p><pre>s3://postgres-backups/payment_db/PGMIG-001.dump</pre><h3>Step 5 — Restore job starts</h3><p>The next task receives:</p><pre>ACTION=restore<br>DB_NAME=payment_db<br>S3_KEY=payment_db/PGMIG-001.dump<br>TARGET_DB=payment_db_restore_PGMIG001</pre><h3>Step 6 — Fargate restores the database</h3><pre>S3<br> ↓<br>Fargate<br> ↓<br>pg_restore<br> ↓<br>PROD PostgreSQL<br> ↓<br>payment_db_restore_PGMIG001</pre><h3>Step 7 — Validation executes</h3><pre>Schema validation<br>Table validation<br>Row-count validation<br>Permission validation<br>Application checks</pre><h3>Step 8 — Approval</h3><p>Only after all checks pass:</p><pre>             ┌───────────────┐<br>             │ Manual Gate   │<br>             │   APPROVE?    │<br>             └───────┬───────┘<br>                     │<br>                     ▼<br>                  Cutover</pre><p>That gives us an automated process without removing the safety control around production.</p><h3>18. An Even Better Evolution: Step Functions</h3><p>As the workflow grows, Lambda alone should not become a giant orchestration program.</p><p>Instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xC3qnTHLtHzBe5L_NoBG4g.png" /><figcaption><strong>Figure 3: Orchestrated PostgreSQL Backup and Restore Workflow Using AWS Step Functions</strong></figcaption></figure><p>This makes workflow state, retries, errors, and long-running execution much easier to manage.</p><p>Lambda remains lightweight while Step Functions becomes the workflow orchestrator.</p><h3>19. Final Architecture</h3><p>The production-ready architecture therefore becomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2mbnN7W7g03rS6MffYOGow.png" /><figcaption><strong>Figure 4: Production-ready PostgreSQL backup and restore architecture using CI/CD, AWS Lambda, Step Functions, ECS Fargate, and S3 for secure, scalable, and automated Dev-to-Prod database refreshes.</strong></figcaption></figure><h3>Conclusion</h3><p>Automating PostgreSQL database refreshes becomes significantly more challenging once databases reach hundreds of gigabytes or terabytes.</p><p>The key is to avoid making a single AWS service responsible for everything.</p><p>Instead, give each service one clear responsibility:</p><blockquote><strong>CI/CD controls the deployment and initiation.</strong></blockquote><blockquote><strong>Lambda accepts and validates runtime parameters.</strong></blockquote><blockquote><strong>ECS Fargate provides long-running compute for </strong><strong>pg_dump and </strong><strong>pg_restore.</strong></blockquote><blockquote><strong>S3 provides durable intermediate backup storage.</strong></blockquote><blockquote><strong>Secrets Manager protects database credentials.</strong></blockquote><blockquote><strong>CloudWatch provides observability.</strong></blockquote><blockquote><strong>Step Functions can coordinate increasingly complex workflows.</strong></blockquote><p>The most important principle is:</p><blockquote><strong><em>Use Lambda to orchestrate the work, not to perform the heavy work.</em></strong></blockquote><p>With that separation, the same framework can support multiple databases, environments, scheduled refreshes, manual migrations, and much larger PostgreSQL workloads without requiring engineers to manually log into servers and execute database commands.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95ddbdea7a5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>