<?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 Ngomba Litombe on Medium]]></title>
        <description><![CDATA[Stories by Ngomba Litombe on Medium]]></description>
        <link>https://medium.com/@litombeg?source=rss-532c3b07c255------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-Cw4gT1rPYC6QTmn.jpg</url>
            <title>Stories by Ngomba Litombe on Medium</title>
            <link>https://medium.com/@litombeg?source=rss-532c3b07c255------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:40:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@litombeg/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[Architecting on AWS — Networking and Compute (Part 2)]]></title>
            <link>https://medium.com/@litombeg/architecting-on-aws-networking-and-compute-part-2-16c5a861da71?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/16c5a861da71</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[computes]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sat, 26 Sep 2026 20:27:09 GMT</pubDate>
            <atom:updated>2026-09-26T20:27:09.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dx5fhd20y-ihoyS3" /><figcaption>Photo by <a href="https://unsplash.com/@jouwdan?utm_source=medium&amp;utm_medium=referral">Jordan Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Networking</strong></p><p>If you come from a tradition networking or datacenter background, you must already be familiar with CIDR notation . if not, quick refresher ;</p><p>10.0.0.0/16 means: the first 16 bits are the network prefix, the remaining 16 bits are host address space. The smaller the prefix number, the larger the network.</p><p>AWS reserves five addresses in every subnet, not the two you know from on-premises networking. In 10.0.1.0/24 these are: .0 network address, .1 VPC router, .2 Amazon-provided DNS (the “+2” address), .3 reserved for future use, and .255 broadcast (AWS does not support broadcast, but the address is still reserved). A /28 therefore gives you eleven usable IPs, which is the smallest subnet AWS permits.</p><p><strong>IP Allocation</strong></p><ul><li>private ranges according to <a href="https://www.rfc-editor.org/info/rfc1918/">https://www.rfc-editor.org/info/rfc1918/</a> 10.0.0.0/8 (16.7 million addressses) , 172.16.0.0/12 and 192.168.0.0/16</li><li>chosing the vpc cidr should be generously in anticpation of network growth. use amazon IPAM</li><li>AWS now charges an hourly rate for every public IPv4 address, whether attached to a running instance or not. At scale this is a real line item, and it is one of the strongest practical arguments for putting workloads behind a shared load balancer or NAT, and for adopting IPv6.</li></ul><p><strong>VPC</strong></p><p>An Amazon VPC is a logically isolated virtual network inside one Region. You control its address range, subnets, route tables, gateways and traffic filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Qa8DbKRKn4w8tcCA3A8byA.png" /><figcaption>2 AZ VPC</figcaption></figure><ul><li><strong>subnet:</strong> a subnet is an ip-range scoped withing an AZ . the only difference between a public and private subnet is that the routing table of the public subnet has a route that points to the internet gateway.</li><li><strong>igw:</strong> A horizontally-scaled, redundant, AWS-managed component attached to the VPC. It does two things: provides a target for internet-bound routes, and performs one-to-one NAT between an instance’s private IP and its public/Elastic IP. This is the case for resources that reside in the public subnet. This is why the NAT gateway resides in the public subnet as representative of the resources in the private subnet.</li><li><strong>Route tables</strong> : one rt can be used by more than one subnet but one subnet can only be associated to one routing table. Every rt contains an unmordifiable local route permitting all subnets in a vpc to be reachable. Routing uses <strong>longest-prefix match</strong>: a route for 10.20.5.0/24 wins over 10.20.0.0/16 , which wins over 0.0.0.0/0.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*GNmzj551TieO5zNRds8djQ.png" /></figure><ul><li><strong>NAT gateway</strong>: Zonal scoped and charged per hour and GB processed. On chatty workloads the data-processing charge dominates, which is the main argument for VPC endpoints (seen later)</li></ul><p>A single NAT gateway shared by both AZs is the most common “cheap” design that turns a single-AZ event into a full outage — every private instance in the healthy AZ loses outbound connectivity too. If budget genuinely forbids two NAT gateways, at least be explicit that you have accepted a single point of failure.</p><ul><li>ENI (Elastic network interface): An ENI is a virtual network card. It carries a primary private IPv4, optional secondary IPs, an optional Elastic IP, a MAC address and security groups. ENIs can be detached and reattached. when we sa<em>y “My EC2 instance has private IP </em><em>10.0.1.10&quot; </em>technically, that IP is assigned to the <strong>EC2 instance’s ENI</strong>, not directly to the EC2 instance itself.</li><li>IP types : private IPs are for the entire lifetime of an instance, public ips are dynamic thus release after termination. Elastic ips on the other hand are statically allocated public IPs.</li></ul><p><strong>VPC Traffic Security</strong></p><p>In a VPC you would encounter two firewalls that exist at different layers; A security group and the NACL . In the table below, we attempt to differentiate them</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*8IAaAHLv_YrrJpy78DgIyw.png" /></figure><p>Best practice is to do your real work in security groups. Use network ACLs sparingly, as a coarse subnet-wide backstop. for example, to deny a known-bad CIDR — because the two-direction bookkeeping makes them error-prone.</p><p>NB : Two tools worth being aware us for debugging VPC connectivity issues are VPC Reachability Analyzer and Network Access Analyzer.</p><p><strong>Compute</strong></p><p>compute in aws is best understand in a spectrum</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JA4L3l43DRPEATd2n2bQug.png" /></figure><p>for aws batch, the unit of deployment is a job. it is used for large scale batch operations. Beanstalk is a service deployed as an application with aws-managed plumbing.</p><p><strong>Reading ec2 instance type names</strong></p><ul><li>m — the family. m = general purpose, c = compute optimised, r / x / z = memory optimised, i / d = storage optimised, p / g / inf / trn = accelerated computing, t = burstable general purpose.</li><li>7 — the generation.</li><li>g — additional capability. g = AWS Graviton (Arm), i = Intel, a = AMD, d = local NVMe, n = enhanced network, e = extra capacity, z = high frequency, flex = Flex instances (lower cost, reduced sustained CPU).</li><li>2xlarge — the size. Sizes double: large , xlarge , 2xlarge , 4xlarge etc</li></ul><p>T-family instances are excellent for genuinely bursty workloads and dangerous for steady ones. A production web server on a t3.medium under sustained load in unlimited mode(opposite to standard mode where the instance throttles if you exhaust credits, in unlimited mode, it continues ) can quietly cost more than an m7g.large that would have performed better. Watch the CPUCreditBalance and CPUSurplusCreditsCharged metrics.</p><p><strong>AMI and user data</strong></p><ul><li>AMI is to an ec2 instance what a docker image is to a container</li><li>user data is a script that runs on first boot (as root). it is used for bootstrapping</li></ul><p><strong>Storage for EC2 instances</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VI1IjGqKYIviT0UkhEcufg.png" /></figure><p>Amazon EBS is the most used storage for ec2 instances. it is a Network-attached block storage, replicated within a single AZ. Persists independently of the instance lifecycle. ebs types include gp2, gp3, io1, st1, and sc1.</p><p><strong>EC2 Pricing</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R36-xL4dSZx9qoXjyLPNoA.png" /></figure><p>The common mistake is committing to 100 % of current usage. You then have no room to right-size or to adopt a newer,</p><p>cheaper generation without wasting the commitment.</p><p>Some cost management tools include ; AWS Cost Explorer , AWS budgets , AWS CUR , AWS trusted advisor , AWS cost optimizer and above all always make cost allocation tags.</p><p><strong>AWS Lambda</strong></p><p>Lambda runs your code in response to events, with no servers to manage, scaling automatically and billing per millisecond of execution multiplied by configured memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaGvLspJucFHXZQO3g7k6A.png" /></figure><p>Lambda functions usage have some limitations worth knowing about ;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SI0JrwX9cFiiFLfW4CzNUw.png" /></figure><p>Practical cold-start reduction: keep the deployment package small, move heavy work and SDK client construction into the init phase (outside the handler) so it is reused, avoid VPC attachment unless you truly need to reach private resources, and prefer interpreted or ahead-of-time-compiled runtimes for the most latency-sensitive functions.</p><p>Attaching a Lambda function to a VPC used to add seconds of cold start. That is no longer true — AWS pre-creates the network interfaces — but the function then loses direct internet access. If it needs to call a public API, you must route it through a NAT gateway (which costs money per GB) or a VPC endpoint. Only put Lambda in a VPC when it must reach private resources such as an RDS instance.</p><p>When not to use Lambda ?</p><ul><li>Work that runs longer than 15 minutes (use Fargate, Batch or Step Functions).</li><li>Sustained, high, predictable throughput — at some volume, containers on Fargate or EC2 with a Savings Plan become cheaper.</li><li>Workloads needing specialised hardware, GPUs, or persistent local state.</li><li>Applications that require a long-lived connection or an OS-level agent.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16c5a861da71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting on AWS — Accounts and Organizations (Part 1)]]></title>
            <link>https://medium.com/@litombeg/architecting-on-aws-accounts-and-organizations-part-1-81baa7d20158?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/81baa7d20158</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-organizations]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sat, 26 Sep 2026 13:51:25 GMT</pubDate>
            <atom:updated>2026-09-26T13:51:25.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*lokOIyef6kquznm6gFZcdQ.png" /></figure><ol><li><strong>AWS Fundamentals</strong></li></ol><p>The aws console exposes alot of services, the aim is not to know all of them but to be able to decompose business requirements into a handful of services for which the constraints are met and tradeoffs highlighted.</p><p><strong>1.1 AWS Service Families</strong></p><p>it is easy to get lost in the aws soup of services . A good mental map is to recognise them within families of capabilities . Also most services that start with “Amazon XYZ” are standalone service and others like “AWS XYZ” are usually capabilities that act on other services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*dBD9Ph1gAacKTARVUY2ryw.png" /></figure><p><strong>1.2 The Tiers of AWS global infrastructure</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*PLpcSENtw1t_od1AHzcebg.png" /></figure><p><strong>Regions</strong></p><ul><li>most services are regionally scoped. a small number are global eg IAM, cloudfront , AWS Organisation , WAF.</li><li>data doesn’t move accross regions unless you move it is the primary lever for data-residency compliance (GDPR)</li><li>prices differ in different regions and some services only exist in certain regions.</li><li>To chose a region, consider the following ; cost , service availability , latency and compliance.</li></ul><p><strong>AZs</strong></p><p>AZs are discrete data centers with independent power supplies. Two AZs in the same region must respect the following two constraints:</p><ul><li>AZs are far enough apart that a single flood, fire or utility failure should not take out two of them.</li><li>AZs are close enough together that synchronous replication between them is practical. This is why Amazon RDS Multi-AZ, EFS and S3 can offer cross-AZ durability without you paying a latency penalty that breaks your application.</li></ul><pre>COMMON PITFALL<br>AZ names are randomised per account. Your us-east-1a and my us-east-1a are almost certainly different<br>physical zones. AWS does this to stop everyone piling into &quot;the first one&quot;<br>. If you need to coordinate placement across<br>accounts (shared VPCs, Direct Connect), use the AZ ID ( use1-az1 ) instead, which is consistent across all accounts.<br>Find it with aws ec2 describe-availability-zones</pre><p><strong>Edge locations</strong></p><p>They answer the question “The region is not close enough to my end users”. This is particularly useful for low latency type applications. aws presents you with the following options:</p><ul><li>Local Zones put compute, storage and database in a large metro far from the parent Region.</li><li>Wavelength Zones sit inside telecom providers’ 5G networks for mobile edge applications.</li><li>Outposts is a physical AWS rack, delivered, installed and operated by AWS, sitting in your own data centre and managed with the same APIs.</li></ul><p><strong>1.3 The shared responsibility model</strong></p><p>Every security breach conversation starts here. Customers are responsible for security in the Cloud ( IAM , roles , SGs, NACL etc) while aws is responsible for security of the cloud ( software (compute, storage,db, networking), hardware, physical security etc )</p><p><strong>1.4 Accessing AWS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPShQJqDaA6OGe4E7UnpAQ.png" /></figure><pre>NOTE<br>aws sts get-caller-identity is the whoami of AWS. It is the first command to run whenever anything<br>permissions-related behaves strangely, because it answers &quot;which principal am I actually using right now?&quot;<br>— a<br>question people get wrong constantly when juggling profiles and roles.</pre><p><strong>2. Account Security</strong></p><p><strong>2.1 Principals and identities</strong></p><p>A principal is anything that can make a request to an AWS API; a person, application or service. Note that a user group is not a service principal but just a mere container.</p><p><strong>root user </strong>: This is the email that is used to create the account. it holds all access and permissions and must thus be treated with absolute caution. some best practices would include; enabling MFA , delete root access keys, use password manager, create an administrative IAM for daily access, use AWS organisations for centralised managements (note management account now becomes more important).</p><p><strong>IAM users and access keys</strong>: An IAM user is a long-lived identity with a name, an optional console password, and up to two access keys. The access key is the problem: it is a static credential that works from anywhere, forever, until someone rotates it. Use IAM roles for workloads, and IAM Identity Center with short-lived credentials for people.</p><p><strong>IAM roles</strong> : A principal assumes a role and receives temporary security credentials (an access key ID, a secret key and a session token) from AWS STS, valid for 15 minutes to 12 hours. Every role has two policy documents:</p><p>The trust policy ( AssumeRolePolicyDocument ) answers who may assume this role. The permissions policy answers what the role can do once assumed.</p><p><strong>Federation and IAM Identity Center</strong></p><ul><li>aws iam identity center : Successor to aws sso. acts as front door to for an organisation’s users (single login accross all aws accounts). it connects to existing identity providers ( microsoft entraID, okta , google etc). with the regular IAM , we are just creating users/group access for one account. you can only enable IAM ID center in one region and it does require the creation of an organisation.</li><li><strong>SAML 2.0 / OIDC</strong> federation directly to IAM is the older pattern and still valid, particularly for machine<br>workloads.</li><li><strong>IAM Roles Anywhere :</strong> extends role-based access to servers outside AWS using X.509 certificates — useful in<br>hybrid estates.</li><li><strong>Amazon Cognito</strong> federates your application’s end users, not your staff. Do not confuse the two: Identity Center is for employees, Cognito is for customers.</li></ul><p>2.2 Security Policies</p><p>sample</p><pre>{<br>&quot;Version&quot;: &quot;2012-10-17&quot;,<br>&quot;Statement&quot;: [<br>{<br>  &quot;Sid&quot;: &quot;AllowReadOnMediaPrefix&quot;,  #human readable label<br>  &quot;Effect&quot;: &quot;Allow&quot;,<br>  &quot;Action&quot;: [&quot;s3:GetObject&quot;, &quot;s3:ListBucket&quot;],<br>  &quot;Resource&quot;: [<br>    &quot;arn:aws:s3:::meridian-media-assets&quot;,<br>    &quot;arn:aws:s3:::meridian-media-assets/public/*&quot;<br>  ],<br>  &quot;Condition&quot;: {<br>    &quot;Bool&quot;: { &quot;aws:SecureTransport&quot;: &quot;true&quot; },<br>    &quot;IpAddress&quot;: { &quot;aws:SourceIp&quot;: [&quot;203.0.113.0/24&quot;] }<br>  }<br> }<br>]<br>}</pre><p><strong>Policy Types</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*xdg_Tt8mT-YDHN1nasKXug.png" /></figure><pre><strong>NOTE</strong><br>&quot;Resource&quot;: &quot;*&quot; combined with &quot;Action&quot;: &quot;iam:PassRole&quot; is effectively an administrator grant. A principal<br>that can pass any role to a service can pass the administrator role to a Lambda function it creates, then invoke it. Always<br>scope iam:PassRole to specific role ARNs.</pre><p>Protecting data with Encryption</p><ul><li>AWS KMS : manages encryption keys and integrates with most other services.</li><li>AWS Secret Manager : handles credential storage with automatic key rotations via lamba. charged per secret as well as api calls</li><li>AWS Systems Manager Parameter Store stores configuration and secrets; SecureString parameters are KMS-encrypted. Standard parameters are free. No built-in rotation.</li></ul><p><strong>2.3 Multi-account Setups</strong></p><p>in AWS , we might need multiple accounts for one of the following reasons ; clean cost attribution, blast radius reduction, quota separation and independent compliance scopes. The modern approach is to have multiple accounts and this is typically done via AWS Organizations.</p><p><strong>AWS Organizations</strong></p><p>AWS Organizations groups accounts into a hierarchy of organizational units (OUs) under a management account, with consolidated billing and centrally applied policies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cIckaW_vzXCfxDNRKplBA.png" /><figcaption>fig : sample AWS Organization Landing Zone</figcaption></figure><p><strong>control policies</strong></p><p><strong>Service control policies (SCPs) </strong>: set the maximum available permissions for accounts in an OU. They filter what IAM can grant; they never grant anything themselves.</p><p><strong>Resource control policies (RCPs) </strong>: do the same for resources — they can, for example, deny any principal outside your organisation from accessing any S3 bucket in the OU, regardless of bucket policy.</p><p>The management account is not affected by SCPs. Run no workloads in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HCse0AjMxtomwYMp3frqw.png" /><figcaption>sample scp denying everything outside specified regions while exempting global services</figcaption></figure><p><strong>AWS Control Tower and Landing Zone</strong></p><p>The control tower builds and manages the AWS multi-account structure for in accordance to best and compliant practices.It provisions the Organizations structure, a log-archive account, an audit account, IAM Identity Center, and a set of controls like :</p><ul><li>Preventive: implemented as SCPs. eg “You cannot disable CloudTrail.”</li><li>Detective: implemented as AWS Config rules. “Tell me if a bucket becomes public.”</li><li>Proactive: implemented as CloudFormation Hooks. “Block the deployment before it creates a non-compliant<br>resource.”</li></ul><p><strong>Account Factory</strong> then vends new accounts against that baseline, so account number 60 is configured exactly like<br>account number 3.</p><p><strong>Support Services Deployed</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1zA2Wyd6PTSibPObmbA0w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81baa7d20158" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing the Foundations: How Organizations Handle Database Schema Migrations]]></title>
            <link>https://medium.com/@litombeg/changing-the-foundations-how-organizations-handle-database-schema-migrations-9ff576a33b62?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ff576a33b62</guid>
            <category><![CDATA[crm-data-migration]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-migration]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 18:51:51 GMT</pubDate>
            <atom:updated>2026-08-01T18:51:51.758Z</atom:updated>
            <content:encoded><![CDATA[<p>Evolving a live database without breaking the applications that depend on it is tricky task yet unavoidable. Every application eventually outgrows the shape of its data. A new feature needs a column, a relationship changes, a table is split for performance. In a system with no users this is trivial but in a live production database serving live traffic, changing the schema means altering the foundations of a building while people are still inside it. How organizations handle this safely, repeatably, and without downtime is one of the quieter marks of engineering maturity.</p><p>The first principle is that schema changes are code. Rather than hand-editing production databases, teams write migrations as small, versioned scripts checked into source control alongside the application. Tools such as Flyway and Liquibase have become the standard for this. Flyway is SQL-first and convention-driven, favouring low-ceremony versioned scripts that integrate cleanly with CI/CD. Liquibase offers richer governance , standardized rollbacks, preconditions and gated deployments, tagging, and drift detection across environments which suits larger or polyglot estates. Either way, the golden rule is the same, <strong>never modify an applied migration</strong>. always add a new one, so every environment converges through the identical, auditable sequence of changes.</p><p>The harder problem is avoiding downtime, and the widely adopted answer is the expand–contract pattern. Instead of one disruptive, locking change, the migration is split into backward-compatible stages as follows :</p><p><strong>Expand stage</strong> : add the new column or table without removing anything, so old and new code both keep working. Then migrate.</p><p><strong>migrate stage</strong> : dual-write to both shapes and backfill historical data while the application is switched to read the new path.</p><p><strong>contract stage</strong> : once nothing depends on the old structure, drop it.</p><p>Decoupling the database change from the application deployment this way keeps the service available throughout, and pairing it with online DDL (data definition language ; subset of SQL , statements that define schema changes like CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX, ADD COLUMN) tools avoids the table locks that a naive ALTER would impose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nfHD5SgfdtqPP1NFjbZ2w.png" /></figure><p>Around this sits the organizational discipline that makes it routine rather than risky. Migrations run automatically through the CI/CD pipeline, are reviewed like any other code, are tested against a production-like environment, and are gated before they touch each successive environment. Treated this way, evolving the schema becomes a controlled, reversible, everyday act and the database stops being the fragile part of the release that everyone fears touching.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ff576a33b62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Databricks Concepts]]></title>
            <link>https://medium.com/@litombeg/databricks-concepts-706ae6ed60b5?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/706ae6ed60b5</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 14:08:29 GMT</pubDate>
            <atom:updated>2026-07-23T14:08:29.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rtrqcgqFDXSXpoM7" /><figcaption>Photo by <a href="https://unsplash.com/@dengxiangs?utm_source=medium&amp;utm_medium=referral">Deng Xiang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Overview</strong></p><p>A quick tour of the building blocks of Databricks on a cloud (AWS/Azure/GCP), and how they fit together: accounts, workspaces, compute, Unity Catalog, storage, networking.</p><p><strong>Control and Data Plane</strong></p><p>Databricks splits into a control plane (managed by Databricks : the web app, APIs, job scheduler, and the Unity Catalog metastore) and a compute/data plane (runs in your cloud account or in databricks’ own aws account. These are the machines that process data, and the storage that holds it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*0ESFIf4RP01wqP5Ih0xxWw.png" /></figure><p><strong>Account and Administration</strong></p><ul><li><strong>Account : </strong>the top-level tenant. Managed from the<strong> </strong>account console<strong> </strong>(accounts.&lt;cloud&gt;.databricks.com). It owns billing, workspaces, the metastore(s), and account-level identities.</li><li><strong>Account admins : </strong>manage workspaces, identity, and metastores across the org.</li><li><strong>Identities : </strong>users, groups, and service principals (SPs) live at the account level so they can be used in Unity Catalog grants. SPs are non-human identities (CI/CD, apps) that authenticate via OAuth (M2M).</li><li><strong>Identity federation : </strong>assign account identities into workspaces; group membership drives access (e.g. a *_admins group → workspace ADMIN).</li></ul><p><strong>Workspaces</strong></p><p>A workspace is a collaborative environment: notebooks, jobs, dashboards, compute, and a UI scoped to a team/project. Each workspace is assigned to exactly one metastore (per region) and backed by cloud storage. You can run many workspaces per account (per team, env, or region). A workspace can access multiple catalogs depending on the access and grants setting.</p><p><strong>Compute</strong></p><p>Where code actually runs. Two main kinds:</p><p><strong>Clusters</strong> (all-purpose / job)Apache Spark compute you size and configure Notebooks, ETL, ML, jobs</p><p><strong>SQL warehouses </strong>Managed, auto-scaling SQL compute (incl. <em>serverless</em>)BI/SQL queries, dashboards</p><p>Billing is by <strong>DBU</strong> (Databricks Unit) per compute-hour, <strong>plus</strong> the underlying cloud VM cost. No compute running → no DBU charge.</p><h4>Unity Catalog: the governance &amp; object model</h4><p>Unity Catalog (UC) is the central governance layer. Its objects form a three-level namespace catalog.schema.object, all rooted in a regional metastore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*peKfcGZIrfa_zOyoRk3Oaw.png" /></figure><ul><li><strong>Metastore: </strong>Top of the UC hierarchy; one per cloud region, shared by that region’s workspaces. Holds the catalogs, permissions, and audit/lineage.</li><li><strong>Catalog: </strong>First namespace level; a logical grouping (e.g. per project or environment).</li><li><strong>Schema</strong> (database) : groups tables, volumes, functions.</li><li><strong>Grants : </strong>privileges (USE_CATALOG, USE_SCHEMA, SELECT, MODIFY, CREATE_TABLE, …) granted to identities on any UC object; privileges inherit down the hierarchy.</li></ul><h4>Storage: how UC reaches the cloud</h4><ul><li><strong>Cloud bucket : </strong>The actual object storage (S3/ADLS/GCS) where data files live.</li><li><strong>Storage</strong> <strong>credential</strong> : A UC object wrapping a cloud IAM role UC is allowed to assume.</li><li><strong>External location: </strong>binds a storage credential to a specific bucket path; grantable.</li><li><strong>Managed storage</strong> — a default location (at metastore / catalog / schema level) where UC manages the files for managed objects.</li></ul><p>When an engine reads/writes, UC hands it short-lived vended credentials for the location. The engine never holds long-lived keys.</p><h4>Tables &amp; Volumes (managed vs external)</h4><p>Both come in managed and external flavors, the difference is <em>who owns the storage lifecycle</em>:</p><ul><li><strong>Tables</strong> hold structured/tabular data (backed by Delta/Iceberg).UC owns the files in managed storage. dropping here mean you completely remove data.</li><li><strong>Volumes</strong> govern files (CSV, JSON, images, models…) under a stable path /Volumes/&lt;catalog&gt;/&lt;schema&gt;/&lt;volume&gt;/…, with UC grants + audit — the file-world analogue of tables.</li></ul><h4>Networking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2XSrRTAgwJ512KSqbkyztQ.png" /></figure><ul><li><strong>Customer-managed VPC : </strong>run the compute plane in your own VPC/subnets for control over networking and egress.</li><li><strong>Secure Cluster Connectivity (SCC / “No Public IP”)</strong> : default on new workspaces: nodes have <strong>no public IP</strong> and open an <strong>outbound</strong> tunnel to the SCC relay; the control plane never connects inbound. Security groups therefore only need self-ingress + egress.</li><li><strong>PrivateLink : </strong>optional; keeps front-end (user→workspace) and back-end (compute→control plane) traffic on the cloud’s private network instead of the public internet.</li><li><strong>VPC endpoints : </strong>private paths from the VPC to cloud services (S3 gateway endpoint; interface endpoints for STS, Secrets Manager, Kinesis, …).</li></ul><h4>What are volumes?</h4><p>In Unity Catalog everything lives under catalog.schema.&lt;object&gt;. Tables hold tabular data; volumes hold non-tabular data — i.e. files (CSV, JSON, Parquet dumps, images, logs, model weights, PDFs…). A volume is a UC-governed handle to a <em>directory</em> of files in cloud storage, accessed through a stable path:</p><pre>/Volumes/&lt;catalog&gt;/&lt;schema&gt;/&lt;volume&gt;/some/file.csv</pre><p>The point is governance: instead of code juggling raw s3://… URIs and AWS keys, you get UC grants (who can READ/WRITE), audit logging, and lineage over those files , same permission model as tables.</p><p>Two kinds:</p><ul><li><strong>MANAGED volume : </strong>UC owns the storage location and lifecycle (drop the volume → files go too).</li><li><strong>EXTERNAL volume : </strong>points at a <em>specific, pre-existing</em> cloud path you registered via an external location. You own the bucket; UC just governs access to it. you can have an external system uploading data to your normal s3 and have</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=706ae6ed60b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automation with Argo (Events and workflows)]]></title>
            <link>https://medium.com/@litombeg/automation-with-argo-events-and-workflows-5af17fc5f349?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/5af17fc5f349</guid>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[argo-events]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 06:17:31 GMT</pubDate>
            <atom:updated>2026-07-19T06:17:31.222Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Argo Events</strong></p><p>Argo Events is an event-driven automation framework in the Argo ecosystem for Kubernetes. It listens for events from many different sources and, when a specified event occurs, triggers an action such as starting an Argo Workflow, creating a Kubernetes resource, calling a webhook, or sending a message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYeCJlE2HdQBm7KKVhE4Ug.png" /><figcaption>Architecture of argo Events</figcaption></figure><p>The image depicts the architecture of Argo Events, showing three main components: Event Source, Event Bus, and Sensor, each with a controller and deployment. The Event Source receives various events (like SNS, SQS, GCP PubSub, S3, Webhooks, etc.), which are managed by the Event Source Controller and passed on to the Event Source Deployment. This connects to the Event Bus with NATS Streaming through the Event Bus Controller. Finally, the Sensor Controller manages the Sensor Deployment, which triggers workflows in Kubernetes and functions in AWS Lambda, illustrated by respective icons. The “sensor” here can be seen as the signal generator for a broader system.</p><p>The typical flow is as follows :</p><p><strong>Event Source</strong> → <strong>Event Bus</strong> → <strong>Sensor</strong> → Trigger Action</p><p><strong>Component</strong><br><a href="https://argoproj.github.io/argo-events/concepts/event_source/">Event Source</a>: This is where events are generated. Event sources in Argo Events can be anything from a simple webhook or a message from a message queue, to a scheduled event. Understanding event sources is key to knowing how your system will interact with various external and internal stimuli. An example of an event source is provided below:</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: EventSource<br>metadata:<br>  name: webhook-example<br>spec:<br>  eventBusName: abc<br>  service:<br>    ports:<br>      - port: 12000<br>        targetPort: 12000<br>  webhook:<br>    example-endpoint:<br>      endpoint: /example<br>      method: POST </pre><p><a href="https://argoproj.github.io/argo-events/concepts/sensor/">Sensor</a>: Sensors are the event listeners in Argo Events. They wait for specific events from the event sources and, upon detecting these events, trigger predefined actions. Understanding sensors involves knowing how to respond to different types of events. A sensor would be specified with the following spec:</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Sensor<br>metadata:<br>  name: webhook-sensor<br>spec:<br>  eventBusName: abc<br>  dependencies:<br>    - name: example-dep<br>      eventSourceName: webhook-example<br>      eventName: example-endpoint<br>  triggers:<br>    - template:<br>        name: k8s-trigger<br>        k8s:<br>          group: batch<br>          version: v1<br>          resource: jobs<br>          operation: create<br>          source:<br>            resource:<br>              apiVersion: batch/v1<br>              kind: Job<br>              metadata:<br>                generateName: webhook-job-<br>              spec:<br>                template:<br>                  spec:<br>                    containers:<br>                      - name: hello<br>                        image: busybox<br>                        command: [&quot;echo&quot;, &quot;Hello from Argo Sensor!&quot;]<br>                    restartPolicy: Never </pre><p><a href="https://argoproj.github.io/argo-events/concepts/eventbus/">EventBus</a>: The EventBus acts as a backbone for event distribution within Argo Events. It’s responsible for managing the delivery of events from sources to sensors. Understanding the EventBus is crucial for managing the flow of events within your system.</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: EventBus<br>metadata:<br>  name: abc<br>spec:<br>  nats:<br>    native:<br>      replicas: 1 </pre><p>Argo Events cannot function without an EventBus implementation. The EventBus is an abstraction, but underneath it there is always a messaging system that transports events. In the example above the nats broker is deployed automatically so the user doesn’t have to care about it. Other supported options are :</p><ul><li>Native NATS (automatically deployed)</li><li>JetStream (recommended for production)</li><li>Existing NATS cluster</li><li>Kafka (where supported by your deployment/version)</li></ul><p><a href="https://argoproj.github.io/argo-events/concepts/trigger/">Trigger</a>: Triggers in Argo Events are the mechanisms that respond to events detected by sensors. They can perform a wide range of actions, from starting a workflow to updating a resource. Understanding triggers is essential for automating responses to events. Triggers are defined within a sensor specification, so the following excerpt focuses on the trigger itself:</p><pre>trigger:<br>  template:<br>    name: argo-workflow-trigger<br>    argoWorkflow:<br>      source:<br>        resource:<br>          apiVersion: argoproj.io/v1alpha1<br>          kind: Workflow<br>          metadata:<br>            generateName: hello-world-<br>          spec:<br>            entrypoint: whalesay<br>            templates:<br>            - name: whalesay<br>              container:<br>                image: docker/whalesay:latest<br>                command: [cowsay]<br>                args: [&quot;Hello from Argo Events!&quot;] </pre><p><strong>Argo Workflows</strong></p><p>A workflow is a series of tasks, processes, or steps that are executed in a specific sequence to achieve a particular goal or outcome. Workflows are prevalent in various domains, including business, software development, and project management. In the context of Argo and other DevOps tools, a workflow specifically refers to a sequence of automated steps involved in the deployment, testing, and promotion of software applications.</p><p>In Argo, the term Workflow is a Kubernetes Custom Resource that represents a sequence of tasks or steps that are defined and orchestrated to achieve a specific goal. It is a higher-level abstraction that allows users to describe complex processes, dependencies, and conditions in a structured and declarative manner. A Workflow also maintains the state of a workflow.</p><p>A Workflow spec has two core parts:</p><ul><li>Entrypoint: Specifies the name of the template that serves as the entrypoint for the workflow. It defines the starting point of the workflow execution.</li><li>Templates: A template represents a step or task in the workflow that should be executed. There are six types of templates .</li></ul><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Workflow<br>metadata:<br>  generateName: hello-world-<br>spec:<br>  entrypoint: whalesay<br>  templates:<br>- name: whalesay<br>  container:<br>    image: docker/whalesay<br>    command: [cowsay]<br>    args: [&quot;hello world&quot;] </pre><h3>Template Types</h3><p>Templates can be containers, scripts, DAGs (Directed-Acyclic Graphs), or other types depending on the workflow structure and is divided into two groups: <strong>template definitions</strong> (which define work to be done) and <strong>template invocators</strong> (which invoke/call other templates and provide execution control).</p><p><strong>Container</strong></p><p>A Container is the most common template type and represents a step in the workflow that runs a container. It is suitable for executing containerized applications or scripts.</p><p><strong>Resource</strong></p><p>A Resource represents a template for creating, modifying, or deleting Kubernetes resources. It is useful for performing operations on Kubernetes objects in the cluster Workflows is currently running.</p><p><strong>Script</strong></p><p>A Script is similar to the container template but allows specifying the script inline without referencing an external container image. It can be used for simple scripts or one-liners.</p><p><strong>Suspend</strong></p><p>A Suspend is a template that suspends execution, either for a duration or until it is resumed manually. It can be resumed using the CLI, the API endpoint, or the UI.</p><p><strong>template invocators</strong></p><p><strong>DAG (Directed-Acyclic Graph)</strong></p><p>A DAG allows defining our tasks as a graph of dependencies. It is beneficial for workflows with complex dependencies and conditional execution.</p><pre>- name: diamond<br>  dag:<br>    tasks:<br>    - name: A<br>      template: echo<br>    - name: B<br>      dependencies: [A]<br>      template: echo<br>    - name: C<br>      dependencies: [A]<br>      template: echo<br>    - name: D<br>      dependencies: [B, C]<br>      template: echo</pre><p><strong>Steps</strong></p><p>Steps are defining multiple steps within a template as several steps need to be executed sequentially or in parallel.</p><pre>- name: hello-hello-hello<br>  steps:<br>  - - name: step1<br>      template: prepare-data<br>  - - name: step2a<br>      template: run-data-first-half<br>    - name: step2b<br>      template: run-data-second-half</pre><p><strong>Outputs</strong></p><p>In Argo Workflows, the outputs section within a step template allows you to define and capture outputs that can be accessed by subsequent steps or referenced in the workflow definition. Outputs are useful when you want to pass data, values, or artifacts from one step to another. Like in terraform. Here’s an overview of how outputs work in Argo Workflows. The Output comprises two key concepts:</p><ul><li>Defining Outputs: You define outputs within a step template using the outputs section. Each output has a name and a path within the container where the data or artifact is produced.</li><li>Accessing Outputs: You can reference the outputs of a step using templating expressions in subsequent steps or the workflow definition.</li></ul><p><strong>Workflow Template</strong></p><p>In Argo Workflows, a WorkflowTemplate is a resource that defines a reusable and shareable workflow template, allowing users to encapsulate workflow logic, parameters, and metadata. This abstraction promotes modularity and reusability, enabling the creation of complex workflows from pre-defined templates.</p><p><strong>Argo workflow Arhictecture</strong></p><p>All of Argo Workflows’ components are independent of other Argo projects and are usually deployed into their own Kubernetes namespace in a cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9J64Oiq7u0RQHlaM0Fqrg.png" /></figure><p><strong>Argo Server</strong></p><p>The Argo Server is a central component that manages the overall workflow resources, state, and interactions. It exposes a REST API for workflow submission, monitoring, and management. The server maintains the state of workflows and their execution and interacts with the Kubernetes API server to create and manage resources.</p><p><strong>Workflow Controller</strong></p><p>The Argo Workflows Controller is a critical component within the Argo Workflows system. It is responsible for managing the lifecycle of workflows, interacting with the Kubernetes API server, and ensuring the execution of workflows according to their specifications. The Argo Workflows Controller continuously watches the Kubernetes API server for changes related to Argo Workflows Custom Resources (CRs). The primary CR involved is the Workflow, which defines the workflow structure and steps. Upon detecting the creation or modification of a Workflow CR, the controller initiates the corresponding workflow execution. The controller is responsible for managing the complete lifecycle of a workflow, including its creation, execution, monitoring, and completion. It also resolves dependencies between steps within a workflow. It ensures that steps are executed in the correct order, based on dependencies specified in the workflow definition.</p><p><strong>Argo UI</strong></p><p>The Argo UI is a web-based user interface for visually monitoring and managing workflows. It allows users to view workflow status, logs, and artifacts, as well as submit new workflows.</p><p>Both the Workflow Controller and Argo Server run in the <strong>argo</strong> namespace. We can opt for one of the cluster or namespaced installations, however, the generated Workflows and the Pods will be run in the respective namespace.</p><p><strong>Flow definition</strong></p><p>A user defines a workflow using YAML or JSON files, specifying the sequence of steps, dependencies, inputs, outputs, parameters, and any other relevant configurations. Then the workflow definition file is submitted to the Kubernetes cluster where Argo Workflows is deployed. This submission can be done via the Argo CLI, Argo UI, or programmatically through Kubernetes API clients.</p><p>The Workflow Controller component of Argo Workflows continuously monitors the Kubernetes cluster for new workflow submissions or updates to existing workflows. When a new workflow is submitted, the Workflow Controller parses the workflow definition to validate its syntax and semantics. If there are any errors or inconsistencies, the Workflow Controller reports them to the user for correction.</p><p>Once the workflow definition is validated, the Workflow Controller creates the necessary Kubernetes resources to represent the workflow, such as Workflow CRDs (Custom Resource Definitions) and associated Pods, Services, ConfigMaps, and Secrets.</p><p>Finally, Workflow Controller begins executing the steps defined in the workflow. Each step may involve running containers, executing scripts, or performing other actions specified by the user. Argo Workflows ensures that steps are executed in the correct order based on dependencies defined in the workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5af17fc5f349" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ArgoCD in EKS]]></title>
            <link>https://medium.com/@litombeg/argocd-in-eks-4f79a0e68b0f?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f79a0e68b0f</guid>
            <category><![CDATA[helm-argocd]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes-argocd]]></category>
            <category><![CDATA[aws-eks]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sat, 20 Jun 2026 11:00:09 GMT</pubDate>
            <atom:updated>2026-07-13T22:06:29.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeKETFD-Z4UZUTF2Milkhw.png" /></figure><p><strong>General Idea</strong></p><p>ArgoCD is a GitOps continuous delivery tool for Kubernetes. The core idea that git is the single source of truth (SOT). You declare the desired state of your cluster (manifests, Helm charts, Kustomize) in a Git repo, and ArgoCD continuously syncs the cluster to match that repo. If something drifts, ArgoCD detects it and corrects it. Even though argoCD comes with controllers and CRDs, it is not tagged as an operator because it has other components and does more than just provisioning for its CRDs.</p><p><strong>Setup Working Cluster</strong></p><p>Prepare a working kubernetes cluster on which argoCD would be deployed. For a quick local setup , you can use k3d or minikube. In this example , we would make use of eks and terraform.</p><p>As prerequisite make sure you have access to an aws account with VPC already configured.Apply the following terraform script to launch eks (mind dependencies).</p><pre>data &quot;terraform_remote_state&quot; &quot;vpc&quot; {<br>  backend = &quot;local&quot;<br><br>  config = {<br>    path = var.vpc_remote_state_path<br>  }<br>}<br><br>locals {<br>  tags = merge(<br>    {<br>      Project     = var.project<br>      Environment = var.environment<br>      ManagedBy   = &quot;terraform&quot;<br>      Stack       = &quot;02-eks&quot;<br>    },<br>    var.tags<br>  )<br><br>  vpc_id          = data.terraform_remote_state.vpc.outputs.vpc_id<br>  private_subnets = data.terraform_remote_state.vpc.outputs.private_subnets<br>}<br><br>module &quot;eks&quot; {<br>  source  = &quot;terraform-aws-modules/eks/aws&quot;<br>  version = &quot;~&gt; 21.0&quot;<br><br>  name               = var.cluster_name<br>  kubernetes_version = var.cluster_version<br>  region             = var.region<br><br>  # Networking: nodes and control plane ENIs live in the private subnets.<br>  vpc_id     = local.vpc_id<br>  subnet_ids = local.private_subnets<br><br>  # API endpoint: private always on; public optionally on but should be CIDR-restricted.<br>  endpoint_private_access      = true<br>  endpoint_public_access       = var.endpoint_public_access<br>  endpoint_public_access_cidrs = var.endpoint_public_access_cidrs<br><br>  # Control plane logging to CloudWatch.<br>  enabled_log_types                      = var.enabled_log_types<br>  create_cloudwatch_log_group            = true<br>  cloudwatch_log_group_retention_in_days = var.cloudwatch_log_group_retention_in_days<br><br>  # Secrets envelope encryption with a dedicated KMS key (created by the module).<br>  encryption_config = {<br>    resources = [&quot;secrets&quot;]<br>  }<br><br>  # Pod-level IAM is provided exclusively via EKS Pod Identity (see the<br>  # eks-pod-identity-agent addon below), so the IRSA OIDC provider is disabled.<br>  enable_irsa = false<br><br>  # Modern access management via EKS access entries; grant the Terraform caller admin.<br>  authentication_mode                      = &quot;API&quot;<br>  enable_cluster_creator_admin_permissions = true<br><br>  # Core add-ons. CNI and pod-identity-agent install before nodes join.<br>  addons = {<br>    coredns    = {}<br>    kube-proxy = {}<br>    eks-pod-identity-agent = {<br>      before_compute = true<br>    }<br>    vpc-cni = {<br>      before_compute = true<br>      # Prefix delegation greatly increases pod density per node.<br>      configuration_values = jsonencode({<br>        env = {<br>          ENABLE_PREFIX_DELEGATION = &quot;true&quot;<br>          WARM_PREFIX_TARGET       = &quot;1&quot;<br>        }<br>      })<br>    }<br>  }<br><br>  # System managed node group: bootstraps cluster controllers and (later) Karpenter.<br>  eks_managed_node_groups = {<br>    system = {<br>      ami_type       = &quot;AL2023_x86_64_STANDARD&quot;<br>      instance_types = var.node_instance_types<br>      capacity_type  = var.node_capacity_type<br><br>      min_size     = var.node_min_size<br>      max_size     = var.node_max_size<br>      desired_size = var.node_desired_size<br><br>      # disk_size is ignored with the module&#39;s default custom launch template,<br>      # so the root volume is configured via block_device_mappings instead.<br>      block_device_mappings = {<br>        xvda = {<br>          device_name = &quot;/dev/xvda&quot;<br>          ebs = {<br>            volume_size           = var.node_disk_size<br>            volume_type           = &quot;gp3&quot;<br>            encrypted             = true<br>            delete_on_termination = true<br>          }<br>        }<br>      }<br><br>      labels = {<br>        &quot;role&quot; = &quot;system&quot;<br>      }<br>    }<br>  }<br><br>  tags = local.tags<br>}</pre><p>Now that we have working EKS cluster. let’s install argoCD. Worth mentioning that aws provides two ways to accomplish this. you can use the aws argo capability for this of you can apply it to your cluster as an addon ( basically using the community version). Addons in aws are tested OSSs.</p><pre>data &quot;terraform_remote_state&quot; &quot;eks&quot; {<br>  backend = &quot;local&quot;<br><br>  config = {<br>    path = var.eks_remote_state_path<br>  }<br>}<br><br>data &quot;aws_caller_identity&quot; &quot;current&quot; {}<br><br>locals {<br>  tags = merge(<br>    {<br>      Project     = var.project<br>      Environment = var.environment<br>      ManagedBy   = &quot;terraform&quot;<br>      Stack       = &quot;05-argocd&quot;<br>    },<br>    var.tags<br>  )<br><br>  cluster_name     = data.terraform_remote_state.eks.outputs.cluster_name<br>  cluster_endpoint = data.terraform_remote_state.eks.outputs.cluster_endpoint<br>  cluster_ca       = data.terraform_remote_state.eks.outputs.cluster_certificate_authority_data<br><br><br>  # ALB Ingress for argocd-server. No domain: HTTP listener only, with<br>  # argocd-server running in insecure mode (TLS terminated/absent at the ALB).<br>  server_ingress = {<br>    enabled          = var.ingress_enabled<br>    controller       = &quot;generic&quot;<br>    ingressClassName = &quot;alb&quot;<br>    annotations = {<br>      &quot;alb.ingress.kubernetes.io/scheme&quot;           = &quot;internet-facing&quot;<br>      &quot;alb.ingress.kubernetes.io/target-type&quot;      = &quot;ip&quot;<br>      &quot;alb.ingress.kubernetes.io/listen-ports&quot;     = &quot;[{\&quot;HTTP\&quot;:80}]&quot;<br>      &quot;alb.ingress.kubernetes.io/backend-protocol&quot; = &quot;HTTP&quot;<br>      &quot;alb.ingress.kubernetes.io/healthcheck-path&quot; = &quot;/healthz&quot;<br>    }<br>    path     = &quot;/&quot;<br>    pathType = &quot;Prefix&quot;<br>    tls      = false<br>  }<br><br>  argocd_values = yamlencode({<br>    # Empty domain so the ALB Ingress has no host rule and serves the ArgoCD UI<br>    # directly on the load balancer&#39;s DNS name (no domain yet).<br>    global = {<br>      domain = &quot;&quot;<br>    }<br><br>    &quot;redis-ha&quot; = {<br>      enabled          = var.redis_ha_enabled<br>      hardAntiAffinity = var.redis_ha_hard_anti_affinity<br>      # HAProxy has its own anti-affinity, separate from the redis servers&#39;.<br>      haproxy = {<br>        hardAntiAffinity = var.redis_ha_hard_anti_affinity<br>      }<br>    }<br><br>    controller = {<br>      replicas = var.controller_replicas<br>    }<br><br>    server = {<br>      replicas = var.server_replicas<br>      ingress  = local.server_ingress<br>      serviceAccount = {<br>        create = true<br>        name   = &quot;argocd-server&quot;<br>      }<br>    }<br><br>    repoServer = {<br>      replicas = var.repo_server_replicas<br>      serviceAccount = {<br>        create = true<br>        name   = var.repo_server_service_account<br>      }<br>    }<br><br>    applicationSet = {<br>      replicas = var.applicationset_replicas<br>      serviceAccount = {<br>        create = true<br>        name   = var.applicationset_service_account<br>      }<br>    }<br><br>    # Run argocd-server with TLS disabled; the ALB is the TLS/edge boundary<br>    # (HTTP-only for now until a domain + ACM certificate are added).<br>    configs = {<br>      params = {<br>        &quot;server.insecure&quot; = true<br>      }<br>    }<br>  })<br>}<br><br><br>################################################################################<br># ArgoCD (Helm, HA)<br>################################################################################<br><br>resource &quot;helm_release&quot; &quot;argocd&quot; {<br>  name             = &quot;argocd&quot;<br>  repository       = &quot;https://argoproj.github.io/argo-helm&quot;<br>  chart            = &quot;argo-cd&quot;<br>  version          = var.chart_version<br>  namespace        = var.namespace<br>  create_namespace = true<br><br>  # HA ArgoCD has a large pod set; give the initial rollout headroom.<br>  timeout = var.helm_timeout<br><br>  values = [local.argocd_values]<br>}</pre><p>Now that we have argoCD installed, we want to create the connection to our github repo. so that it call pulled desired state from there. To achieve this we would apply the “Application” CRD that argoCD controller would respond to. For argocd to be able to have access to this repo, it requires githbub credentials. In production case, we would use an external secret operator to link this secret and some external secret store. for our case we are using a normal secret and variables to fill in the credentials. the label “argocd.argoproj.io/secret-type” = “repository” is used to tell argocd that this is a repo secret.</p><pre>data &quot;terraform_remote_state&quot; &quot;eks&quot; {<br>  backend = &quot;local&quot;<br><br>  config = {<br>    path = var.eks_remote_state_path<br>  }<br>}<br><br>data &quot;terraform_remote_state&quot; &quot;argocd&quot; {<br>  backend = &quot;local&quot;<br><br>  config = {<br>    path = var.argocd_remote_state_path<br>  }<br>}<br><br>locals {<br>  cluster_name     = data.terraform_remote_state.eks.outputs.cluster_name<br>  cluster_endpoint = data.terraform_remote_state.eks.outputs.cluster_endpoint<br>  cluster_ca       = data.terraform_remote_state.eks.outputs.cluster_certificate_authority_data<br><br>  argocd_namespace = data.terraform_remote_state.argocd.outputs.namespace<br>}<br><br>################################################################################<br># Register the GitHub repository with ArgoCD<br>#<br># HTTPS authentication uses a GitHub Personal Access Token supplied through the<br># github_token variable (inject it at apply time, e.g. TF_VAR_github_token).<br>################################################################################<br><br>resource &quot;kubernetes_secret&quot; &quot;repo&quot; {<br>  metadata {<br>    name      = &quot;repo-${var.app_name}&quot;<br>    namespace = local.argocd_namespace<br><br>    labels = {<br>      &quot;argocd.argoproj.io/secret-type&quot; = &quot;repository&quot;<br>    }<br>  }<br><br>  data = {<br>    type     = &quot;git&quot;<br>    url      = var.repo_url<br>    username = var.github_username<br>    password = var.github_token<br>  }<br>}<br><br>################################################################################<br># ArgoCD Application that deploys the sample app (the GitOps test)<br>################################################################################<br><br>resource &quot;kubernetes_manifest&quot; &quot;application&quot; {<br>  manifest = {<br>    apiVersion = &quot;argoproj.io/v1alpha1&quot;<br>    kind       = &quot;Application&quot;<br><br>    metadata = {<br>      name      = var.app_name<br>      namespace = local.argocd_namespace<br>      finalizers = [<br>        &quot;resources-finalizer.argocd.argoproj.io&quot;,<br>      ]<br>    }<br><br>    spec = {<br>      project = var.project<br><br>      source = {<br>        repoURL        = var.repo_url<br>        targetRevision = var.target_revision<br>        path           = var.app_path<br>      }<br><br>      destination = {<br>        server    = &quot;https://kubernetes.default.svc&quot;<br>        namespace = var.app_namespace<br>      }<br><br>      syncPolicy = {<br>        automated = {<br>          prune    = true<br>          selfHeal = true<br>        }<br>        syncOptions = [<br>          &quot;CreateNamespace=true&quot;,<br>        ]<br>      }<br>    }<br>  }<br><br>  depends_on = [kubernetes_secret.repo]<br>}</pre><p>Now our nginx sample app that was placed in the repo is now deployed in the cluster. A littel word about finalizers:</p><p>A finalizer is a key placed on an object’s metadata that tells Kubernetes: <em>“don’t fully delete this object yet — a controller needs to do cleanup work first.”</em></p><p>resources-finalizer.argocd.argoproj.io tells the ArgoCD application-controller to perform a cascading delete: when this Application resource is deleted, ArgoCD will first delete all the Kubernetes resources it deployed (the workloads defined in app_path of the Git repo — Deployments, Services, etc.) before the Application object itself is removed.</p><p>Without this finalizer, deleting the Application would only remove the ArgoCD Application record. The actual deployed workloads (the sample app&#39;s Deployment/Service in the app_namespace) would be orphaned — left running in the cluster with nothing managing them.</p><p><strong>ArgoCD Components</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRmXrFP6sSm8YANI59vY1Q.png" /></figure><p><strong>repo server</strong></p><p>The component that talks to Git. It clones the repository, then “renders” the manifests (runs helm template, kustomize build, plain YAML, etc.) to produce the final Kubernetes manifests. It&#39;s stateless and CPU/memory heavy, so it&#39;s commonly scaled out. This is the component that needs the secret to access the git repo.</p><p><strong>application controller</strong></p><p>This is the brain. It continuously compares desired state (rendered by repo-server) against live state in the cluster (the Kubernetes API). It reports health/sync status and performs the actual sync (applying manifests). This is the reconciliation loop.</p><p><strong>Server API</strong></p><p>The API server backing the Web UI, CLI (argocd), and gRPC/REST API. It handles auth, RBAC, and serves the dashboard. It does not do the syncing itself just the front door.This is the one exposed via the ALB Ingress.</p><p><strong>applicationset controller</strong></p><p>A generator/factory for Applications. Instead of hand-writing one Application per app/cluster/environment, an ApplicationSet uses <em>generators</em> (Git directory, Git file, list, cluster, matrix, etc.) to template out many Application resources automatically. Great for multi-tenant / multi-environment / &quot;app of apps at scale&quot; patterns.</p><p><strong>redis/redis-ha</strong></p><p>A cache, not a database. ArgoCD caches rendered manifests and cluster state in Redis to avoid re-cloning/re-rendering constantly. redis-ha runs a highly-available Redis (with Sentinel) instead of a single pod when enabled for an HA install. antiaffinity is used to further enhance HA.</p><p><strong>Dex</strong></p><p>An identity broker for SSO/OIDC (Google, GitHub, SAML, etc.). Not included in the stack for this example.</p><p><strong>CRDs</strong></p><p>Some CRDs provided by argoCD include :</p><p>Application</p><p>The fundamental unit. “Take manifests from <em>this repo/path/revision</em> and deploy them to <em>this cluster/namespace</em>.” Defines source + destination + sync policy.</p><p>ApplicationSet</p><p>A template that generates many Applications programmatically via generators.</p><p>AppProject</p><p>A logical grouping / guardrail for Applications ; restricts which repos, clusters, and namespaces a set of apps may use (RBAC and security boundary).</p><p><strong>Action Flow</strong></p><ol><li>You commit an Application (or ApplicationSet) describing what to deploy.</li><li>repo-server clones the repo and renders the manifests.</li><li>application-controller diffs rendered vs. live state and syncs the cluster.</li><li>redis caches the rendered/live state.</li><li>You watch and operate it all via the server (UI/CLI/API).</li><li>applicationset-controller mass-produces Applications when you use an ApplicationSet.</li></ol><p><strong>Terminology</strong></p><ul><li>Sync: the act of applying Git state to the cluster.</li><li>Drift / OutOfSync: live cluster state no longer matches Git.</li><li>Self-heal: auto-revert manual changes back to Git state.</li><li>Health status: ArgoCD’s assessment of whether resources (Deployments, etc.) are actually healthy. the heath status can either be healthy or degraded. An app can be in sync but degraded meaning some resource is in a failed state.</li><li>App of Apps: a pattern where one root Application deploys other Applications (a precursor / alternative to ApplicationSet).</li></ul><p><strong>Deploying helm charts with argoCD</strong></p><p>The most important concept to understand when you<br>manage a Helm chart with Argo CD is it does not run helm install<br>or helm upgrade.Argo CD runs helm template &lt;chart&gt; /-values //.<br>and generates the final, plain Kubernetes manifests that are<br>then the source of truth for the Application Controll . You can use Argo CD to deploy both charts stored in your own repositories, as well as charts that are publicly available.</p><p><strong>overiding chart values and precedence</strong></p><p>in the application crd manifest spec section, we can overide helm values with the following precedence order ; helm chart’s own values.yaml, spec.helm.valuesfiles, spec.helm.valuesobject and spec.helm.parameters .</p><pre>spec:<br>  source:<br>    repoURL: https://kubernetes.github.io/dashboard/<br>    chart: kubernetes-dashboard<br>    targetRevision: 7.13.0<br>    helm:<br>      valueFiles:<br>      - values.yaml<br>      - custom-values.yaml<br>      valuesObject:<br>      kong:<br>      enabled: true<br>      parameters:<br>      - name: &#39;nginx.enabled&#39;<br>      value: &#39;false&#39;</pre><p><strong>Some interesting ArgoCD concepts</strong></p><p><strong>Auto Syncing</strong></p><p>By default, Argo CD only reports OutOfSync. It does not automatically update the Kubernetes resources.Automated Sync is the policy that allows ArgoCD to automatically apply the changes<br>without manual approval.</p><p><strong>Pruning</strong></p><p>By default, Argo CD does not delete resources if it cannot find their manifests in the source. In other words, if you delete a manifest, by default Argo CD will not delete that resource in the cluster.Pruning allows Argo CD to actually clean up orphaned resources from the cluster if their<br>manifests cannot be found</p><p><strong>Self-Healing</strong></p><p>Automated sync policies only trigger when the Git repository changes, not if someone changes something in the cluster. Self-healing is the policy that closes this final gap. When you enable self-healing, Argo CD<br>will immediately revert changes to the cluster resources that lead to resources being in a different state than that specified in the Git repository.</p><p><strong>Private Repo connections</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YEdA-qIY6LC7361u53UhjQ.png" /></figure><p><strong>Projects</strong></p><p>A Project is a logical grouping object that exists only inside Argo CD. This is<br>not a cluster-wide resource like Namespaces. provides Organization &amp; Multi-Tenancy with RBACs and security guardrails. it provides a simple and effective way to group related applications (team, business unit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*HWKkvlIxoszPGN_9QxqJfw.png" /></figure><p><strong>propagation polices</strong></p><p>How linked objects are deleted depends on the propagation policy. foreground means garbage collects clears dependents first then owner, background is the reverse and orphan just means delete owner and leave all dependents in tact.</p><p><strong>Sync Phases &amp; Hooks</strong></p><p>Since we can not do “helm install/upgrade” in argocd , you would imagine that argocd would not apply helm hooks to the cluster. it does however provide us with equivalent operation in pre/post sync phases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hf_ok2pcw6HkArnVsbBNdg.png" /></figure><p><strong>Sync waves</strong> : it defines the execution order of Kubernetes resources within Sync Phases. it is added as an annotation to the kubernetes resource definition. the smaller the weight , the ealier the resource is deployed.</p><pre>annotations:<br>  argocd.argoproj.io/sync-waves: &quot;-1&quot;</pre><p><strong>ARGO Rollouts</strong></p><p>what are argo rollouts and why we need them ?</p><p><strong>Argo Rollouts</strong> is a Kubernetes controller that extends the standard Kubernetes Deployment resource to support <strong>advanced deployment strategies</strong> such as:</p><ul><li>Canary deployments</li><li>Blue-Green deployments</li><li>Progressive delivery</li><li>Automated rollback based on metrics</li></ul><p>It is part of the Argo project, alongside Argo CD, but it is a separate component.</p><p><strong>vanilla k8 deployments have some production limitations:</strong></p><p>Once a RollingUpdate begins, it proceeds to completion as quickly as it can create new pods. There is no concept of pausing the rollout to observe the new version’s behavior. If you deploy a version with a bug, the RollingUpdate will happily continue replacing all of your stable pods with broken ones, rapidly escalating a small problem into a full-blown outage.</p><p>Readiness probe only test application ability to receive and provide traffic not correctness</p><p>No real traffic control : The RollingUpdate strategy ties instance scaling directly to traﬃc shifting. As soon as a new pod becomes “Ready”, it’s added to the Service’s load balancing pool and begins receiving a portion of live user traﬃc.</p><p>rollbacks are simply rollingupdates backwards. When you trigger a rollback on a Deployment, Kubernetes doesn’t instantly switch back to the old version. Instead, it simply starts another RollingUpdate in reverse, replacing the bad pods with the last known-good version.</p><p><strong>The rollout CRD</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HB7mHQ51aQbEuQb0WdRbZQ.png" /></figure><p>It expands on the Recreate and RollingUpdate strategies by adding support to Canary and BlueGreen strategies. The Canary strategy is very flexible, and can be customized to fit most projects’ needs.</p><p><strong>Rollout Strategies</strong></p><p>Blue/Green Deployments</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAZrATlTCZOINhys1E-gtQ.png" /></figure><p>canary deployments</p><p>imagin you have 10 pods (9 v1 and 1 v2), A Kubernetes Service load-balances equally across all endpoints. that would approx 10% of requests go to v2 of the app. This is called <strong>replica weighted canary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_CJUYurTsBCNNAnm4QfjjA.png" /></figure><p><strong>Advanced Traffic management</strong></p><p>traffic steering solely based on pod count is limited in that :</p><ul><li>precision problem : How do we achieve a 10% traﬃc split if our ReplicaSet has only two Pods?</li><li>resource wastage : To achieve fine-grained steps (1%, 2%, 5%), you are forced to over-provision your infra.</li><li>no header-based routing : It’s not possible to redirect traﬃc predictably with the use of custom headers.</li></ul><p>Argo rollouts provide us the possibility to have <strong>traffic weighted canary deployments . </strong>p</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFVapoWYhcLtbCJ0lCWXIQ.png" /></figure><p>The key idea is that <strong>Argo Rollouts itself does not route network traffic</strong>. Instead, it <strong>coordinates with a traffic router</strong> (such as Istio, NGINX Ingress, or Traefik) to tell it what percentage of traffic should go to each version.Instead of relying on the number of pods, Argo Rollouts instructs the traffic router to split requests by percentage. eg define the following in the argo template yaml to manage canary pods deployment evolution.</p><pre>strategy:<br>  canary:<br>    steps:<br>      - setWeight: 10<br>      - pause: {}<br>      - setWeight: 30<br>      - pause: {}<br>      - setWeight: 60<br>      - setWeight: 100</pre><p><strong>Header Based Routing</strong></p><p>Header-based routing is a technique where a proxy or load balancer decides which backend service should receive a request based on the HTTP headers instead of (or in addition to) the URL or host.</p><p>This is commonly used with Argo Rollouts because it lets <strong>only selected users</strong> test a new version of an application while everyone else continues using the stable version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qSm1v5fSsqzH0oe7pFqdA.png" /></figure><p><strong>Automated Analysis and promotion</strong></p><p>Prometheus metrics are configured and collected via specifying the appropriate anotations on the concerned resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGNM8JcpXZJdJmdyM_0ZOA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f79a0e68b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open Telemetry]]></title>
            <link>https://medium.com/@litombeg/open-telemetry-bddc17d554d0?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/bddc17d554d0</guid>
            <category><![CDATA[opentelemetry]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sun, 31 May 2026 20:14:16 GMT</pubDate>
            <atom:updated>2026-05-31T20:14:16.316Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zb1rUht1gKERhI_Z88l-w.png" /></figure><p>OpenTelemetry (often abbreviated as <strong>OTel</strong>) is an open-source observability framework made up of a collection of tools, APIs, and SDKs. It is used to instrument, generate, collect, and export telemetry data (metrics, events, logs, traces) to help you analyze your software’s performance and behavior.</p><p>Currently a by the Cloud Native Computing Foundation (CNCF) graduate project , it is the industry standard for making systems observable.The easiest way to understand OpenTelemetry is to look at the specific problem it solves: vendor lock-in.</p><p>Before OTel, if you wanted to monitor your application using a tool like Datadog, New Relic or Splunk, you had to write your code using their specific, proprietary agents and SDKs. If you ever wanted to switch to a different monitoring tool, you had to rewrite a massive amount of code to rip out the old vendor’s SDK and replace it with the new one.</p><p>OpenTelemetry provides a single, universally accepted standard. You write your instrumentation code once using OpenTelemetry, and you can then point that data to any backend tool you want without changing your code.</p><p><strong>Core Components</strong></p><p>To actually use OpenTelemetry in your applications, you rely on a few distinct pieces of the framework working together:</p><ul><li><strong>APIs:</strong> These are the universal “interfaces” you use to instrument your code. They don’t actually generate the data. They just define how the data should be structured.</li><li><strong>SDKs:</strong> These are language-specific libraries (available for Java, Python, Go, Node.js, etc.) that do the heavy lifting of actually gathering the data defined by the APIs.</li><li><strong>The OpenTelemetry Collector:</strong> This is the most powerful piece of the puzzle. It is a standalone service (often deployed as a sidecar or a central gateway) that receives the telemetry data from your apps, processes it (filters, batches, or scrubs sensitive data), and then exports it to your backend analysis tools (like Prometheus, Datadog, AWS X-Ray, etc.).</li></ul><p><strong>Why use OpenTelemetry</strong></p><ol><li><strong>Vendor Neutrality:</strong> You own your data. You can switch observability platforms by simply changing a configuration file in the OTel Collector, rather than rewriting application code.</li><li><strong>Unified Data:</strong> Because traces, metrics, and logs are all generated by the same framework, it is much easier to correlate an abnormal metric spike directly to a specific log line or trace.</li><li><strong>Future-Proof:</strong> As the second most active CNCF project (behind only Kubernetes), it is supported by almost every major cloud provider and monitoring tool on the market.</li></ol><p><strong>Sample Use Case</strong></p><p>Imagine you have an e-commerce application. Users are complaining that clicking the “Checkout” button sometimes takes too long.</p><p>You want to use OpenTelemetry to track exactly how long the process_checkout function takes, capture the specific Order ID being processed, and record the steps inside that function. Instead of sending this data to a paid tool right away, we will just export it directly to the console to see how it works.</p><p>To run this, you would first install the basic OpenTelemetry libraries (pip install opentelemetry-api opentelemetry-sdk).</p><pre>import time<br>from opentelemetry import trace<br>from opentelemetry.sdk.trace import TracerProvider<br>from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor<br><br># 1. Setup: Tell OpenTelemetry how to process and where to send the data.<br># In a real app, you would send this to the OTel Collector. Here, we print to the console.<br>provider = TracerProvider()<br>processor = SimpleSpanProcessor(ConsoleSpanExporter())<br>provider.add_span_processor(processor)<br>trace.set_tracer_provider(provider)<br><br># 2. Get a Tracer: This is what you use to actually instrument your code.<br>tracer = trace.get_tracer(__name__)<br><br>def process_checkout(order_id):<br>    # 3. Create a Span: A span represents a single unit of work (the checkout process).<br>    with tracer.start_as_current_span(&quot;checkout_transaction&quot;) as span:<br>        <br>        # 4. Add Attributes: Attach business context so you can search for this exact trace later.<br>        span.set_attribute(&quot;order.id&quot;, order_id)<br>        span.set_attribute(&quot;payment.method&quot;, &quot;credit_card&quot;)<br>        <br>        print(f&quot;Processing order {order_id}...&quot;)<br>        <br>        # Simulate a database call or contacting a payment gateway<br>        time.sleep(1) <br>        <br>        # 5. Add Events: Log specific milestones within the span.<br>        span.add_event(&quot;Payment authorized by gateway&quot;)<br>        <br>        print(&quot;Order complete!&quot;)<br><br># Run the simulated checkout<br>process_checkout(&quot;ORD-98765&quot;)</pre><p>When the code executes, the OpenTelemetry SDK silently tracks the start time, the end time, and all the custom data you injected. Because we used the ConsoleSpanExporter, it generates a standard JSON object in your terminal that looks something like this:</p><pre>{<br>    &quot;name&quot;: &quot;checkout_transaction&quot;,<br>    &quot;context&quot;: {<br>        &quot;trace_id&quot;: &quot;0x5b8aa5a2d2c872e8416... (A unique ID for this entire request)&quot;,<br>        &quot;span_id&quot;: &quot;0x12345abcdef...&quot;<br>    },<br>    &quot;start_time&quot;: &quot;2026-05-31T18:06:18.000000Z&quot;,<br>    &quot;end_time&quot;: &quot;2026-05-31T18:06:19.000000Z&quot;,<br>    &quot;attributes&quot;: {<br>        &quot;order.id&quot;: &quot;ORD-98765&quot;,<br>        &quot;payment.method&quot;: &quot;credit_card&quot;<br>    },<br>    &quot;events&quot;: [<br>        {<br>            &quot;name&quot;: &quot;Payment authorized by gateway&quot;,<br>            &quot;timestamp&quot;: &quot;2026-05-31T18:06:19.000000Z&quot;<br>        }<br>    ]<br>}</pre><p>This is powerful because if you change your setup to send this data to a tool like Datadog, Jaeger, or New Relic (simply by swapping out the ConsoleSpanExporter for an OTLPExporter), this raw JSON is automatically converted into a visual timeline chart. You will immediately see that the checkout took exactly 1.0 seconds, search for it using the specific ORD-98765 tag, and instantly know that the payment authorization was successful.</p><p><strong>OpenTelemetry with Kubernetes Operator</strong></p><p>Instead of having developers import OpenTelemetry SDKs into their source code, the Kubernetes Operator intercepts your pods as they are spinning up and automatically injects the necessary tracing libraries into them at runtime.</p><p><strong>Operator installation</strong></p><p>First, you install the OpenTelemetry Operator into your Kubernetes cluster (typically using Helm or a standard YAML manifest). This operator runs in the background and watches for specific instructions (cluster-scoped).</p><p><strong>Instrumentation Rules</strong></p><p>You create a K8s crd of kindInstrumentation. This file tells the cluster how to instrument your apps and wher to send the gathered data (like to your OTel Collector).</p><pre>apiVersion: opentelemetry.io/v1alpha1<br>kind: Instrumentation<br>metadata:<br>  name: my-instrumentation<br>  namespace: my-app-namespace<br>spec:<br>  exporter:<br>    # Tell the auto-instrumentation where to send the traces<br>    endpoint: &quot;http://my-otel-collector-service:4318&quot; <br>  sampler:<br>    type: always_on</pre><p><strong>Annotate Application</strong></p><p>This is where the magic happens. You take your existing, completely unmodified application deployment and simply add a single annotation to the Pod template. The operator supports Java, Python, Node.js, Go, .NET, and more.</p><p>If you have a standard Python web application, you just add instrumentation.opentelemetry.io/inject-python: &quot;true&quot; to your metadata:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: standard-python-app<br>spec:<br>  replicas: 1<br>  template:<br>    metadata:<br>      annotations:<br>        # This single line triggers the auto-instrumentation<br>        instrumentation.opentelemetry.io/inject-python: &quot;true&quot; <br>    spec:<br>      containers:<br>      - name: application-container<br>        image: your-company/python-app:latest<br>        ports:<br>        - containerPort: 8080</pre><p>When you deploy that YAML file to Kubernetes, the OpenTelemetry Operator sees the annotation and intercepts the pod creation using an Admission Webhook.</p><p>It automatically injects an initContainer into your pod. This init-container copies the OpenTelemetry Python agents into a shared volume. The operator then automatically modifies your pod&#39;s environment variables (like PYTHONPATH) so that when your actual application container starts, it is seamlessly wrapped by OpenTelemetry.</p><p><strong>OTel Collector</strong></p><p>If OpenTelemetry SDKs are the tools that generate the data inside your application, the Collector is the postal sorting facility that figures out what to do with that data.</p><p>While you can technically send telemetry data straight from your application to a backend tool (like Datadog or Prometheus), placing the OTel Collector in the middle is the industry standard best practice.</p><p><strong>Otel Collector Deployment Flavors</strong></p><p>In a cloud-native environment like Kubernetes, the Collector is typically deployed in one of two ways (and often both):</p><ol><li><strong>As an Agent (Sidecar / DaemonSet):</strong> The Collector runs directly alongside your application on the same machine. Your app sends data to localhost, and this local Collector does light processing before forwarding it on.</li><li><strong>As a Gateway:</strong> A dedicated, scalable cluster of Collectors sits at the edge of your network. All the local agents forward their data to this central gateway, which handles heavy processing, API key management, and routing to external vendors.</li></ol><p><strong>Some Metrics Collected</strong></p><p>Assuming your app uses standard, supported frameworks, the operator automatically generates metrics governed by <strong>OpenTelemetry Semantic Conventions</strong>. This is a strict naming standard enforced by OTel so that your data looks uniform regardless of what language generated it.</p><p>HTTP / Web Metrics</p><p>Whenever your app receives a web request or makes an API call to another service, the operator automatically tracks:</p><ul><li>Request Duration (http.server.request.duration): How long it took your app to process an incoming request.</li><li>Active Requests (http.server.active_requests): The number of concurrent requests currently in flight.</li><li>Client Duration (http.client.request.duration): How long your app waited for an external API (like a payment gateway) to respond.</li><li>Payload Sizes: The byte size of the request and response bodies.</li></ul><p>DB metrics and messaging</p><p>If your app connects to a database (like Postgres, MySQL, or MongoDB) or a message queue (like Kafka or RabbitMQ) using a standard client library, the operator hooks into that client to pull:</p><ul><li>Connection Pools: How many database connections are currently idle, active, or maxed out.</li><li>Operation Duration: How long a specific database query or queue publish took to execute.</li><li>Business Context: The metrics are tagged with the database system (postgresql), the operation type (SELECT, INSERT), and sometimes the sanitized query statement itself.</li></ul><p>Runtime Metrics</p><p>These are the internal health metrics of the specific language engine your app is running on. This is where the output varies wildly depending on your stack:</p><ul><li>Java: JVM garbage collection pauses (jvm.gc.pause), heap memory usage (jvm.memory.used), and active threads.</li><li>Node.js: Event loop lag, V8 engine memory heap statistics, and active handles.</li><li>Go/Python: Goroutine counts, memory allocation, and active thread counts.</li></ul><p>Because auto-instrumentation relies on a hardcoded list of recognized libraries, it can sometimes lead to silent failures.</p><p>If you deploy a pod using an unsupported framework (for example, a bleeding-edge or obscure async web framework), the Kubernetes Operator will successfully inject the OTel container, and the pod will start normally. However, because the agent doesn’t recognize the framework, it won’t know how to intercept the traffic. You will get baseline CPU/Memory/Runtime metrics, but you will see zero HTTP or database metrics in your dashboard.</p><p>If you aren’t seeing the metrics you expect, always check the official OpenTelemetry registry to ensure the specific version of the library your app uses is officially supported by the auto-instrumentation agent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bddc17d554d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Factory for Terraform AFT]]></title>
            <link>https://medium.com/@litombeg/account-factory-for-terraform-aft-aaee9e075d39?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaee9e075d39</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aft]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Sun, 31 May 2026 17:47:19 GMT</pubDate>
            <atom:updated>2026-05-31T17:47:19.566Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XDg7czdzosKecaf" /><figcaption>Photo by <a href="https://unsplash.com/@homaappliances?utm_source=medium&amp;utm_medium=referral">Homa Appliances</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>AFT is an AWS solution that extends the account provisioning capabilities of AWS Control Tower by allowing you to create, customize, and manage AWS accounts using Terraform.</p><p><strong>Some reasons for Use</strong></p><p>AFT helps organizations automate the lifecycle of AWS accounts at scale. Particularly relevant for managed services applications.</p><ul><li>Automated AWS Account Creation</li><li>Account Customization</li><li>Multi-Account Governance</li><li>IaC : Facilitates git reviews and validation</li><li>GitOps Workflow : Developers submit changes through Git.</li></ul><p>From a high level AFT typically includes:</p><ul><li>Terraform modules</li><li>Git repositories</li><li>AWS CodePipeline / CodeBuild (build-test-deploy/build)</li><li>AWS Lambda</li><li>AWS Step Functions : Fully managed visual workflow service that allows you to coordinate multiple AWS services into serverless workflows. You can think of it as a highly advanced, automated flowchart for your backend applications and microservices. Step Functions uses a concept called a state<strong> </strong>machine to define your workflow.</li><li>AWS Control Tower</li></ul><p><strong>Sample Scenario</strong></p><p>Suppose a company needs a new AWS account for a project:</p><ul><li>A developer creates a Terraform configuration specifying; Account name , Organizational Unit (OU) , account owner and required customization.</li><li>The code is committed to Git.</li><li>AFT automatically creates the AWS account, Places it in the correct OU , applies security baselines , deploys networking and IAM configurations. The account becomes ready for use without manual AWS Console work.</li></ul><p><strong>How to Use AFT</strong></p><p>Setting up AFT is a multi-step process that requires foundational AWS knowledge and some familiarity with Terraform. You can broadly follow the following steps:</p><p><strong>1. Prepare the Prerequisites</strong></p><ul><li>You must have an active AWS Control Tower Landing Zone deployed in your Management Account.</li><li>You need to create a dedicated Organizational Unit (OU) for AFT within your AWS Organization.</li><li>You must provision a dedicated AFT Management Account through Control Tower. This account will host the pipelines, CodeBuild projects, and Step Functions that AFT uses to orchestrate account creation.</li></ul><p><strong>2. Deploy the AFT Framework</strong> From your local machine or a deployment pipeline, you need to apply the official AFT Terraform module (aws-ia/terraform-aws-control_tower_account_factory) <a href="https://registry.terraform.io/modules/aws-ia/control_tower_account_factory/aws/latest?tab=inputs">https://registry.terraform.io/modules/aws-ia/control_tower_account_factory/aws/latest?tab=inputs</a> . You will need to provide it with inputs like your management account ID, log archive account ID, AFT management account ID, audit_account_id and home region.</p><p><strong>3. Set Up Your Configuration Repositories</strong> AFT relies on four distinct code repositories to manage your environment. When you deploy AFT, you will link these repos to the pipeline:</p><ul><li><strong>Account Requests Repo:</strong> This is where you declare new accounts (e.g providing the account name, root email, and target OU).</li><li><strong>Global Customizations Repo:</strong> Contains the Terraform code that should be applied to every single account AFT builds (e.g standard IAM roles or security tools).</li><li><strong>Account Customizations Repo:</strong> Contains Terraform code applied only to specific accounts (e.g provisioning a specific database only in the “Data-Science” account).</li><li><strong>Provisioning Customizations Repo:</strong> Allows you to modify the AFT Step Functions workflow itself.</li></ul><p><strong>4. Request a New Account</strong> Once everything is set up, vending a new account is incredibly simple:</p><ol><li>Open your <strong>Account Requests Repo</strong>.</li><li>Create a new Terraform file calling the aft-account-request module. Fill in the details (Account Email, Name, SSO User, and Target OU).</li><li>Commit and push the code to your main branch.</li><li>AFT takes over. It will create the account in Control Tower, apply the global configurations, apply the account-specific configurations, and finally notify you when the account is ready for use.</li></ol><p><strong>Detail Implementation Description</strong></p><p><strong>step 1</strong></p><p>Before deploying the Terraform module, you must prepare the landing zone manually or via the AWS Console.</p><ul><li>Deploy an active AWS Control Tower environment in your Management Account.</li><li>Navigate to AWS Organizations and create a new Organizational Unit (OU) dedicated to AFT resources (e.g AFT-Management-OU).</li><li>Open the Control Tower Account Factory and provision a new account named AFT-Management directly into that new OU.</li><li>Document four specific AWS Account IDs for your configuration: the Control Tower Management Account, the Log Archive Account, the Audit Account, and your newly minted AFT Management Account.</li></ul><p><strong>step 2 : Source Control Repo</strong></p><p>AFT relies on a GitOps workflow to know when and how to build accounts. You must create four distinct Git repositories in your chosen Version Control System (GitHub, Bitbucket, GitLab, or AWS CodeCommit) as discussed previously.</p><p><strong>step 3 : Define AFT Deployment Code</strong></p><p>On your local machine or within your infrastructure pipeline, create a directory for your AFT deployment. Create a main.tf file using the official AFT module. You must run this using Administrator credentials authenticated to your Control Tower Management Account.</p><pre>module &quot;aft&quot; {<br>  source  = &quot;aws-ia/control_tower_account_factory/aws&quot;<br>  version = &quot;1.20.1&quot;<br><br>  # Account Identifiers<br>  ct_management_account_id  = &quot;111111111111&quot;<br>  log_archive_account_id    = &quot;222222222222&quot;<br>  audit_account_id          = &quot;333333333333&quot;<br>  aft_management_account_id = &quot;444444444444&quot;<br><br>  # Regional Settings<br>  ct_home_region              = &quot;us-east-1&quot;<br>  tf_backend_secondary_region = &quot;us-west-2&quot;<br><br>  # VCS Setup (Using GitHub as an example)<br>  vcs_provider                                  = &quot;github&quot;<br>  account_request_repo_name                     = &quot;YourOrg/aft-account-request&quot;<br>  global_customizations_repo_name               = &quot;YourOrg/aft-global-customizations&quot;<br>  account_customizations_repo_name              = &quot;YourOrg/aft-account-customizations&quot;<br>  account_provisioning_customizations_repo_name = &quot;YourOrg/aft-account-provisioning-customizations&quot;<br>}</pre><p><strong>step 4 : Deploy Framework</strong></p><p>Ensure your CLI session credentials are valid for at least an hour. This deployment creates extensive infrastructure across your accounts, including CodePipelines, Step Functions, DynamoDB tables, and IAM roles, which can take up to 30 minutes to complete.</p><ol><li>Run terraform init to initialize the working directory and pull the AWS provider.</li><li>Run terraform plan to verify your variables and catch any authentication issues.</li><li>Run terraform apply to deploy the AFT architecture into your environment.</li></ol><p><strong>step 5: Vending First Account</strong></p><p>Once the deployment finishes, AFT actively monitors your Git repositories. To build your first automated AWS account, add a Terraform configuration to your empty aft-account-request repository.</p><pre>module &quot;new_dev_account&quot; {<br>  source = &quot;github.com/aws-ia/terraform-aws-control_tower_account_factory//modules/aft-account-request&quot;<br><br>  control_tower_parameters = {<br>    AccountEmail              = &quot;dev-team@yourcompany.com&quot;<br>    AccountName               = &quot;Development-01&quot;<br>    ManagedOrganizationalUnit = &quot;Workloads&quot;<br>    SSOUserEmail              = &quot;admin@yourcompany.com&quot;<br>    SSOUserFirstName          = &quot;Cloud&quot;<br>    SSOUserLastName           = &quot;Admin&quot;<br>  }<br><br>  account_tags = {<br>    Environment = &quot;Dev&quot;<br>    CostCenter  = &quot;12345&quot;<br>  }<br><br>  change_management_parameters = {<br>    change_requested_by = &quot;DevOps Team&quot;<br>    change_reason       = &quot;Initial dev account setup&quot;<br>  }<br><br>  custom_fields = {<br>    custom_field_1 = &quot;custom-value&quot;<br>  }<br><br>  account_customizations_name = &quot;standard-developer-baseline&quot;<br>}</pre><p>Commit and push this file to the main branch of your account request repository. AFT will automatically detect the commit, trigger AWS CodePipeline in the AFT Management account, provision the new account via Control Tower, and apply any customizations you have defined.</p><p>Et Voila . Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaee9e075d39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Temporal for Work load Management]]></title>
            <link>https://medium.com/@litombeg/temporal-for-work-load-management-407a4833c1d6?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/407a4833c1d6</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[apache-temporal]]></category>
            <category><![CDATA[temporal]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Wed, 27 May 2026 14:10:26 GMT</pubDate>
            <atom:updated>2026-05-27T14:10:26.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*UVXp0iUZR9CNdeKNAaWkfg.png" /></figure><p><strong>What is Temporal ?</strong></p><p>Temporal is an open-source platform for building reliable applications. Temporal delivers crash-proof execution by guaranteeing that applications resume exactly where they left off after crashes, network failures, or infrastructure outages, whether that happens seconds, days, or even years later. Personally I consider as a tool for adding invincible breakpoints in your code that only show up when there is trouble lol. Temporal code is of sorts what a jupyter notebook is to a straight python script.</p><p>It is comparative to Apache Airflow which is more inclined to batch/data-pipeline oriented.</p><p><strong>Definition of Key Words</strong></p><ul><li>Temporal Server: The backend service that stores workflow state, schedules tasks, tracks history, retries work, and coordinates workers.</li><li>Workflow: Durable orchestration code that describes the business process, such as “charge card, send email, wait 3 days, then follow up.”</li><li>Activity: Code that performs real-world side effects, such as calling APIs, writing to a database, sending emails, or reading files.</li><li>Worker: A running process that polls Temporal for tasks and executes registered workflows and activities.</li><li>Task Queue: A named queue that connects tasks from Temporal to workers that are listening for them.</li><li>Client: Application code that talks to Temporal Server to start, signal, query, cancel, or inspect workflows.</li><li>Namespace: A logical grouping inside Temporal, like a project or environment boundary.</li><li>Workflow Task: A task given to a worker to advance workflow logic and decide what should happen next.</li><li>Activity Task: A task given to a worker to run a specific activity function.</li><li>Signal: A message sent into a running workflow to change or update it, like “payment received” or “cancel requested.”</li><li>Query: A read-only request to ask a running workflow for its current state.</li><li>Retry Policy: Rules that tell Temporal how to retry failed activities or workflows.</li><li>Timeout: A limit on how long a workflow, activity, or task is allowed to take.</li><li>Replay: Temporal re-running workflow code against stored history to rebuild workflow state after a crash or restart.</li><li>Payload: The serialized input or output data passed to workflows and activities.</li><li>Heartbeat: A progress signal from a long-running activity that tells Temporal it is still alive.</li></ul><p><strong>How to Use Temporal ?</strong></p><p>install temporal CLI and start server on macOS</p><pre>brew install temporal<br>temporal server start-dev --ui-port 8233</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*a73aRNivV7ANeLv2FY6yug.png" /></figure><p><strong>Create an activity</strong></p><p>An Activity is a normal function or method that executes a single, well-defined action (either short or long running), which often involve interacting with the outside world, such as sending emails, making network requests, writing to a database, or calling an API. Things which are prone to failure. If an Activity fails, Temporal automatically retries it based on your configuration. sample activity code :</p><pre>from temporalio import activity<br><br>@activity.defn<br>async def greet(name: str) -&gt; str:<br>    return f&quot;Hello {name}&quot;</pre><p><strong>Create workflows</strong></p><p>Workflows orchestrate Activities and contain the application logic. Temporal Workflows are resilient. They can run and keep running for years, even if the underlying infrastructure fails. If the application itself crashes, Temporal will automatically recreate its pre-failure state so it can continue right where it left off.</p><pre>from datetime import timedelta<br><br>from temporalio import workflow<br><br>with workflow.unsafe.imports_passed_through():<br>    from activities import say_hello<br><br><br>@workflow.defn<br>class GreetingWorkflow:<br>    @workflow.run<br>    async def run(self, name: str) -&gt; str:<br>        return await workflow.execute_activity(<br>            say_hello,<br>            name,<br>            start_to_close_timeout=timedelta(seconds=10),<br>        )</pre><p><strong>Create Worker</strong></p><p>A worker is the running program that actually executes your Temporal code.</p><p>In worker.py code below connects to the local Temporal server, registers the workflow and activity, then waits for work:</p><pre>import asyncio<br><br>from temporalio.client import Client<br>from temporalio.worker import Worker<br><br>from activities import say_hello<br>from workflows import GreetingWorkflow<br><br>TASK_QUEUE = &quot;hello-temporal-task-queue&quot;<br><br><br>async def main() -&gt; None:<br>    client = await Client.connect(&quot;localhost:7233&quot;)<br><br>    worker = Worker(<br>        client,<br>        task_queue=TASK_QUEUE,<br>        workflows=[GreetingWorkflow],<br>        activities=[say_hello],<br>    ) // that this says is “This worker is capable of running GreetingWorkflow and say_hello.” <br>// but nothing happens till starter.py is ran. <br><br>    print(f&quot;Worker started. Listening on task queue: {TASK_QUEUE}&quot;)<br>    await worker.run()<br><br><br>if __name__ == &quot;__main__&quot;:<br>    asyncio.run(main())</pre><p>run python3 worker.py . you would see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*WbzPFokmOAGCHzrnnk2Lsg.png" /></figure><p>Think of it like this:</p><pre>- starter.py says: &quot;Temporal, please start this workflow.&quot;<br>- Temporal Server stores the workflow request.<br>- worker.py says: &quot;I am listening on this task queue. Give me work.&quot;<br>- Temporal gives tasks to the worker.<br>- The worker runs GreetingWorkflow.<br>- When the workflow calls say_hello, the worker also runs that activity.</pre><p>Important: Temporal Server does not run your Python code by itself. Your worker process must be running for workflows and activities to execute.</p><p>Workers are a crucial part of your Temporal application as they’re what actually execute the tasks defined in your Workflows and Activities. For more information on Workers, see <a href="https://docs.temporal.io/evaluate/understanding-temporal#workers">Understanding Temporal</a> and a <a href="https://docs.temporal.io/workers">deep dive into Workers</a>.</p><p><strong>Executing workflows</strong></p><p><strong>create file starter.py</strong></p><pre>import asyncio<br>from uuid import uuid4<br><br>from temporalio.client import Client<br><br>from workflows import GreetingWorkflow<br>from worker import TASK_QUEUE<br><br><br>async def main() -&gt; None:<br>    client = await Client.connect(&quot;localhost:7233&quot;)<br>    workflow_id = f&quot;hello-temporal-{uuid4()}&quot;<br><br>    result = await client.execute_workflow(<br>        GreetingWorkflow.run,<br>        &quot;John&quot;,<br>        id=workflow_id,<br>        task_queue=TASK_QUEUE,<br>    )<br><br>    print(f&quot;Workflow ID: {workflow_id}&quot;)<br>    print(f&quot;Workflow result: {result}&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    asyncio.run(main())</pre><p>En bref, it tells temporal</p><pre>Start GreetingWorkflow.run<br>Pass in &quot;John&quot; as input<br>Use this workflow ID<br>Send tasks to hello-temporal-task-queue<br>Wait until the workflow finishes<br>Return the result</pre><p>python starter.py (worker.py also running)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*yZFUR7U4vhW5bdjMgUEgyw.png" /></figure><p>WebUI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LAXGiA4Xj3H7nzVauiyfdw.png" /></figure><p><strong>Summary of Pieces</strong></p><ul><li>activities.py: Contains real work functions, like API calls, database writes, emails, or in this case say_hello.</li><li>workflows.py: Defines the durable workflow logic that decides which activities run and in what order.</li><li>worker.py: Runs continuously, listens on the task queue, and executes workflow/activity tasks from Temporal.</li><li>starter.py: Starts a new workflow execution by sending a request to the Temporal Server.</li><li>Temporal Server: Stores workflow state, schedules tasks, retries failures, and coordinates workers.</li><li>Task Queue: The named queue connecting workflow requests to the workers that can execute them.</li><li>Temporal Web UI: Lets you inspect workflow executions, inputs, results, history, and failures.</li></ul><p><strong>Multi-worker Setup</strong></p><p>In a multi-worker setup, a worker is only capable of running the workflows/activities that its code registered, and only receives tasks from the task queues it listens to.</p><p>So assignment mainly depends on task queue, than on what that worker registered.</p><p>Example:</p><pre>Worker(<br>    client,<br>    task_queue=&quot;payments&quot;,<br>    workflows=[PaymentWorkflow],<br>    activities=[charge_card, refund_payment],<br>)</pre><p>That worker says:</p><blockquote>“I listen to the payments queue, and I know how to run PaymentWorkflow, charge_card, and refund_payment.”</blockquote><p>If you start 5 workers with this same code on the same payments queue, Temporal load-balances tasks across them.</p><p>If another worker listens on a different queue:</p><pre>Worker(<br>    client,<br>    task_queue=&quot;emails&quot;,<br>    activities=[send_email],<br>)</pre><p>Then it will only receive tasks sent to the emails queue.</p><p>Important to note that when a workflow schedules an activity, it can choose which task queue that activity goes to. If you don’t specify one, the activity usually uses the same task queue as the workflow worker.</p><p>So:</p><pre>Workflow on &quot;payments&quot; queue<br>-&gt; activity without custom task queue<br>-&gt; goes to &quot;payments&quot; queue</pre><p>But you can route an activity elsewhere:</p><pre>Workflow on &quot;payments&quot; queue<br>-&gt; send_email activity with task_queue=&quot;emails&quot;<br>-&gt; email worker picks it up</pre><p>In short:</p><ul><li>Workers do not magically run every activity.</li><li>A worker can only run activities registered in its code.</li><li>A worker only receives tasks from the task queue it listens to.</li><li>Multiple workers on the same queue compete/load-balance tasks.</li><li>Different queues are how you separate worker responsibilities.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=407a4833c1d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Organization and Accounts]]></title>
            <link>https://medium.com/@litombeg/aws-organization-and-accounts-8aaecefa43f6?source=rss-532c3b07c255------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aaecefa43f6</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-organizations]]></category>
            <dc:creator><![CDATA[Ngomba Litombe]]></dc:creator>
            <pubDate>Tue, 26 May 2026 09:05:46 GMT</pubDate>
            <atom:updated>2026-05-26T09:05:46.434Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*w2Xnr64ZJo3wyErcCElEQg.png" /></figure><p>Amazon Organizations and accounts are the foundation of how companies structure, secure, and govern cloud environments in AWS. There are general patterns but usage is quite subjective to company usecase.</p><p><strong>AWS Account</strong></p><p>An AWS account is the basic isolation boundary in AWS. This what you get when you create an account normally . Think of it as a separate billing container , an isolated environment for resources. Each account has its own users/roles/permissions, separate billing(unless consolidated) , independent resources and credentials.</p><p>Typically, companies do not run everything in one account. Instead, they create multiple accounts for prod , dev , testing , security , different business units etc. This improves security isolation, blast-radius reduction, compliance and cost tracking</p><p><strong>AWS Organizations</strong></p><p>This is a service that lets us centrally manage multiple AWS accounts. It provides centralized policy management, governance , LCM for aws accounts, security controls and consolidated billing.</p><p><strong>Core Concepts</strong></p><p><strong>Management/Master Account</strong></p><p>This is the top-level account that creates the organization. It pays the consolidated bills and creates/adds member accounts. Best practice is to use this account only for administrative purposes and not for deploying workloads.</p><p><strong>Member Accounts</strong></p><p>Accounts that belong to the organization created by the management account. This is where you should run your workloads. You can also add an already existing account to the organization.</p><p><strong>Organization Units (OUs)</strong></p><p>OUs are account groupings. This facilitates policy enforcement on a group level instead of going account by account.</p><p>Example:</p><pre>Root<br>├── Security OU<br>│   ├── audit-account<br>│   └── log-archive-account<br>├── Infrastructure OU<br>│   ├── networking-account<br>│   └── shared-services-account<br>├── Workloads OU<br>│   ├── production-account<br>│   ├── staging-account<br>│   └── development-account</pre><p><strong>Service Control Policies SCPs</strong></p><p>SCPs define the <strong>maximum allowed permissions</strong> for accounts. SCPs do NOT grant permissions but they only limit permissions.</p><p>Example:<br> Block all regions except Paris and Frankfurt:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Deny&quot;,<br>      &quot;NotAction&quot;: [<br>        &quot;iam:*&quot;,<br>        &quot;route53:*&quot;,<br>        &quot;cloudfront:*&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;*&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringNotEquals&quot;: {<br>          &quot;aws:RequestedRegion&quot;: [<br>            &quot;eu-west-3&quot;,<br>            &quot;eu-central-1&quot;<br>          ]<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p><strong>AWS Control Tower</strong></p><p>AWS <strong>control tower</strong> is a service that is used for setting up your landing zone (as seen below). Note that after creating your organization and entities with control tower, you can still view and manage them with aws organization. Control Tower uses AWS Organizations underneath to manage multiple AWS accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbQlvr8CxqHcmVA6FSeUxg.png" /><figcaption>aws landing zone setup with control tower</figcaption></figure><p>A typical enterprise landing zone can look like</p><pre>AWS Organization<br>│<br>├── Security OU<br>│   ├── Log Archive Account<br>│   └── Security Tooling Account<br>│<br>├── Infrastructure OU<br>│   └── Shared Services Account<br>│<br>├── Sandbox OU<br>│   └── Dev/Test Accounts<br>│<br>└── Production OU<br>    └── Production Accounts</pre><p><strong>Identity and Access Across Accounts</strong></p><p>In multi-account AWS, users typically authenticate once and assume roles into accounts. common patterns are to use IAM identity center service (sso) and cross account IAM roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mVDe7stjxMBU_Wr33YDXNg.png" /></figure><p><strong>Setting up AWS Organization</strong></p><p>When you sign in to your organization’s management account, you can create accounts in your organization, invite existing accounts to join your organization, create and apply policies, and enable supported AWS services to work across the accounts in your organization.</p><p><a href="https://us-east-1.console.aws.amazon.com/organizations/v2/home/accounts">Create accounts or invite existing accounts</a></p><p>Created accounts automatically become members of your organization. Invited accounts become members when they accept the invitation by replying to an email or by calling the <a href="https://docs.aws.amazon.com/console/organizations/API_AcceptHandshake">AcceptHandshake API</a>. Member accounts are administered and managed by the organization. To easily access member accounts after creation, it is recommended you enable <a href="https://eu-north-1.console.aws.amazon.com/singlesignon/home">AWS IAM Identity Center (AWS Single Sign-On)</a>.</p><p><a href="https://us-east-1.console.aws.amazon.com/organizations/v2/home/accounts">Organize your organization’s member accounts into OUs</a></p><p>Simplify management of your organization by grouping accounts into <a href="https://docs.aws.amazon.com/console/organizations/manage-ous">organizational units (OUs)</a> and applying custom policies. This allows you to manage multiple accounts as a single unit and provide common permissions to groups of accounts within your organization. You can add nested OUs within each OU for more granular permissions, such as separating your production accounts from development accounts within each OU.</p><p><a href="https://us-east-1.console.aws.amazon.com/organizations/v2/home/policies">Create policies</a></p><p>Policies enable you to apply controls to the accounts in your organization. There are <a href="https://docs.aws.amazon.com/console/organizations/policies">several supported policy types</a> you can use to manage your organization. For example, <a href="https://docs.aws.amazon.com/console/organizations/service-control-policies">service control policies (SCPs)</a> specify the actions that are available the users and roles in affected accounts. You can attach a policy to the entire organization, to OUs, or directly to an individual account.</p><p><a href="https://us-east-1.console.aws.amazon.com/organizations/v2/home/services">Enable AWS services that support AWS Organizations</a></p><p>AWS has services that help you use AWS Organizations to secure, audit, and control the accounts in your environment. View the <a href="https://docs.aws.amazon.com/console/organizations/supported-services">list of supported services</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aaecefa43f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>