<?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 Nicholina Owusu on Medium]]></title>
        <description><![CDATA[Stories by Nicholina Owusu on Medium]]></description>
        <link>https://medium.com/@nolsen603?source=rss-6138fac126cf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0WOU8AT3qG0PQnHC</url>
            <title>Stories by Nicholina Owusu on Medium</title>
            <link>https://medium.com/@nolsen603?source=rss-6138fac126cf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:03:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nolsen603/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[The Hidden Genetic Legacy: How Africa’s Ancient Protection Became a Modern Health Challenge]]></title>
            <link>https://medium.com/@nolsen603/the-hidden-genetic-legacy-how-africas-ancient-protection-became-a-modern-health-challenge-ef96167a9184?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef96167a9184</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 16:33:59 GMT</pubDate>
            <atom:updated>2025-07-13T16:33:59.781Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Understanding APOL1-associated nephropathy; one of the most common genetic conditions affecting African populations</em></p><p>In the forests and savannas of West Africa, including what is now Ghana, a deadly disease once swept through communities like wildfire. African sleeping sickness, caused by parasites transmitted through tsetse fly bites, claimed countless lives across the region. But over thousands of years, something remarkable happened: the human body adapted, developing genetic changes that could fight off these deadly parasites.</p><p>This adaptation saved millions of lives across West Africa. But like many stories of survival, it came with an unexpected cost that we’re only now beginning to understand.</p><p>These same genetic changes that protected against sleeping sickness now contribute to one of the most common inherited kidney diseases in Africa, particularly affecting populations in Ghana and across West Africa. It’s called APOL1-associated nephropathy, and while it affects millions of people across the continent and diaspora, most Africans have never heard of it.</p><h3>What Is APOL1-Associated Nephropathy?</h3><p>APOL1-associated nephropathy is a kidney disease caused by variations in a gene called APOL1. To understand this condition, imagine your genes as instruction manuals for your body. The APOL1 gene contains instructions for making a protein that originally served as a defense mechanism against parasites.</p><p>However, certain variations of this gene; while protective against parasites, can also damage the kidneys over time. Research shows that in Ghana and other West African countries, significant portions of the population carry these gene variations, making this one of the most common genetic conditions across the region.</p><p>The condition doesn’t always cause problems, but when it does, it can lead to serious kidney disease that progresses rapidly. Unlike many kidney diseases that develop slowly over decades, APOL1-associated nephropathy can advance from normal kidney function to complete kidney failure within months or years; a particular concern for healthcare systems across Africa that may lack the resources for dialysis or kidney transplants.</p><h3>The Evolutionary Story: A Double-Edged Sword</h3><p>To understand why these gene variations exist, we need to travel back in time to ancient West Africa. For thousands of years, sleeping sickness was a major killer across the region, from the forests of Ghana to the savannas of Mali and Burkina Faso. The disease, transmitted by tsetse flies, would cause victims to fall into a coma-like state before dying.</p><p>The human body responded to this threat by developing changes in the APOL1 gene. These changes created a protein that could attack and destroy the parasites that cause sleeping sickness. People who inherited one copy of these gene variations had a significant survival advantage; they were much less likely to die from this devastating disease that plagued West African communities.</p><p>But evolution often involves trade-offs. Those who inherited two copies of these protective gene variations faced a different problem: their kidneys became vulnerable to damage from the very protein that protected them from parasites.</p><p>This is why APOL1-associated nephropathy is so common in West Africa and among people of West African descent. The gene variations that cause kidney disease today were actually lifesavers in the past. They spread throughout populations in Ghana, Nigeria, Senegal and other West African countries because they provided protection against a deadly disease that was more immediately threatening than kidney problems that might develop later in life.</p><h3>Where Are These Gene Variations Found?</h3><p>The distribution of APOL1 gene variations across Africa tells a fascinating story of human survival and migration, with West Africa serving as a crucial epicenter. The highest rates are found in regions where sleeping sickness was historically most common; particularly in Ghana, Nigeria, Senegal and other West African countries.</p><p>In Ghana, studies suggest that a significant portion of the population carries at least one copy of these gene variations. Some communities show rates as high as 30–40% for single-copy carriers, while approximately 10–15% carry two copies, putting them at higher risk for kidney disease.</p><p>These variations are also found throughout West Africa:</p><ul><li>Nigeria: High frequencies, especially in the southern regions</li><li>Senegal: Significant carrier rates in various ethnic groups</li><li>Mali and Burkina Faso: Elevated frequencies in certain populations</li><li>Other West African countries with varying prevalence</li></ul><p>The pattern of distribution serves as a genetic map of both ancient human migration within West Africa and historical exposure to sleeping sickness. Later, through the transatlantic slave trade and voluntary migration, these gene variations spread to the Americas and other continents, which is why they’re found in African American and Afro-Caribbean populations today.</p><h3>How Does It Affect the Body?</h3><p>APOL1-associated nephropathy doesn’t cause just one type of kidney problem. Instead, it makes people more susceptible to several different kidney diseases:</p><p><strong>Scarring of the kidney filters</strong>: The tiny filtering units in the kidneys can become scarred and stop working properly. This is like having a water filter that gradually becomes clogged and less effective.</p><p><strong>High blood pressure kidney damage</strong>: When combined with high blood pressure, the gene variations can accelerate kidney damage. The kidneys become less able to regulate blood pressure, creating a vicious cycle.</p><p><strong>Kidney inflammation</strong>: The immune system may attack the kidneys, causing inflammation that damages these vital organs.</p><p>What makes this condition particularly concerning for African healthcare systems is its aggressive nature. While many kidney diseases develop slowly over decades, allowing time for treatment and adaptation, APOL1-associated nephropathy can progress rapidly. Some people go from normal kidney function to needing dialysis or a kidney transplant within a few years.</p><p>In Ghana and other West African countries, where access to dialysis and kidney transplantation is limited, this rapid progression presents a significant challenge. The cost of kidney replacement therapy is often beyond the reach of most families, making prevention and early detection crucial.</p><h3>The Unpredictable Nature of Genetic Risk</h3><p>One of the most puzzling aspects of APOL1-associated nephropathy is its unpredictability. Having two copies of the gene variations doesn’t guarantee that someone will develop kidney disease; it just significantly increases the risk.</p><p>Consider two people from the same Ghanaian family who inherit the same gene variations from their parents. One might develop severe kidney disease in their twenties, while the other lives a full life with healthy kidneys. Scientists believe this happens because other factors influence whether the gene variations cause problems:</p><ul><li>Other genes that modify the effects</li><li>Environmental factors like infections or medications</li><li>Lifestyle factors such as diet and exercise</li><li>Random biological processes</li></ul><p>This unpredictability makes the condition challenging for both patients and doctors. It’s impossible to predict who will develop kidney disease and who will remain healthy.</p><h3>Current Treatment Challenges</h3><p>Unfortunately, there are no specific treatments targeting APOL1-associated nephropathy. Doctors treat it the same way they treat other forms of chronic kidney disease:</p><ul><li>Controlling blood pressure with medications</li><li>Reducing protein loss in the urine</li><li>Managing other health conditions like diabetes</li><li>Lifestyle changes including diet and exercise modifications</li></ul><p>While these treatments can help slow the progression of kidney disease, they don’t address the underlying genetic cause. This means that people with APOL1-associated nephropathy often face a more aggressive disease course than those with other forms of kidney disease.</p><p>In Ghana and other West African countries, access to these treatments can be limited by cost and availability. Many patients may not receive optimal care due to healthcare infrastructure challenges, making the condition even more problematic in these settings.</p><h3>Research and Hope for the Future</h3><p>Scientists around the world are working to understand exactly how APOL1 gene variations cause kidney damage. This research is leading to potential new treatments that could target the specific processes involved.</p><p>Some promising research areas include:</p><p><strong>Understanding the cellular mechanisms</strong>: Scientists are studying how the APOL1 protein damages kidney cells, which could lead to targeted therapies.</p><p><strong>Identifying protective factors</strong>: Researchers are looking for other genes or environmental factors that protect some people from developing kidney disease despite having the gene variations.</p><p><strong>Developing new medications</strong>: Pharmaceutical companies are working on drugs that could specifically target the pathways affected by APOL1 variations.</p><p><strong>Improving early detection</strong>: Better screening methods could help identify people at risk before kidney damage becomes severe.</p><h3>The Broader Impact on Health</h3><p>The discovery of APOL1-associated nephropathy has important implications for healthcare across Africa, particularly in countries like Ghana where the genetic variations are common. It helps explain why kidney disease rates are higher in certain African populations; something that was previously attributed solely to factors like high blood pressure, diabetes and limited healthcare access.</p><p>This genetic component doesn’t diminish the importance of addressing social determinants of health like access to healthcare, clean water, nutritious food and safe living conditions. Instead, it adds another layer to our understanding of health challenges in Africa and emphasizes the need for healthcare approaches that consider both genetic and environmental factors.</p><p>For Ghana and other West African countries, this knowledge could inform public health strategies, screening programs and healthcare resource allocation. Understanding that a significant portion of the population carries these genetic variations could help healthcare systems prepare for and prevent kidney disease more effectively.</p><h3>Testing and Genetic Counseling</h3><p>Genetic testing for APOL1 variations is available in some research settings, but it’s not widely accessible in Ghana or most other West African countries. The decision to pursue testing, where available, depends on several factors:</p><ul><li>Family history of kidney disease</li><li>Personal risk factors</li><li>Access to genetic counseling services</li><li>Ability to act on the results</li></ul><p>In Ghana’s healthcare system, genetic counseling services are limited, making it important for healthcare providers to understand this condition and its implications. For those who might have access to testing, counseling is important to help understand what the results mean and how to use this information to make informed health decisions.</p><h3>Living with Genetic Risk</h3><p>For people in Ghana and other West African countries who may carry APOL1 gene variations, knowledge about this condition can be both empowering and concerning. While there’s no way to change genetics, there are steps that may help reduce the risk of kidney disease:</p><ul><li>Regular monitoring of kidney function through local healthcare facilities</li><li>Maintaining healthy blood pressure</li><li>Staying properly hydrated, especially important in West Africa’s climate</li><li>Avoiding medications that can damage kidneys when possible</li><li>Managing other health conditions like diabetes and hypertension effectively</li><li>Seeking prompt treatment for infections that might stress the kidneys</li></ul><p>It’s important to remember that having the gene variations doesn’t mean kidney disease is inevitable. Many people with these variations live healthy lives without ever developing kidney problems. However, in resource-limited settings like many parts of Ghana, prevention becomes even more crucial given the challenges of treating advanced kidney disease.</p><h3>Conclusion</h3><p>APOL1-associated nephropathy represents one of the most significant genetic health challenges facing West African populations, with particular implications for countries like Ghana. It’s a condition born from thousands of years of adaptation to infectious disease in the region, now manifesting as kidney disease in modern populations.</p><p>Understanding this condition requires healthcare systems in Ghana and across West Africa to think about health in new ways; considering not just immediate risk factors but also deep genetic history and evolutionary adaptations. As research continues, the region moves closer to treatments that could help millions of people.</p><p><em>This article is for educational purposes only and should not replace professional medical advice. Anyone with concerns about kidney disease should consult with a healthcare provider for proper evaluation and care.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef96167a9184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Genetic Blind Spot: My Journey Into Health Tech and the Discovery That Changed Everything]]></title>
            <link>https://medium.com/@nolsen603/the-genetic-blind-spot-my-journey-into-health-tech-and-the-discovery-that-changed-everything-0fd97a625f8c?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fd97a625f8c</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Fri, 04 Jul 2025 15:48:58 GMT</pubDate>
            <atom:updated>2025-07-04T15:48:58.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxJ9xnB47MTu9Y0N808c4Q.png" /></figure><p>It started with a simple curiosity about wearable devices and ended with a complete shift in how I view modern medicine. What began as casual reading about health technology has evolved into a deep dive into genetics, revealing a fundamental flaw in how we approach precision medicine today.</p><h3>The Accidental Geneticist</h3><p>My fascination with health tech began innocently enough. I was reading about smart watches and fitness trackers when I stumbled across an article about genetic testing. One article led to another, and before I knew it, I was two months deep into research papers about DNA sequencing, gene therapy and personalized medicine.</p><p>The more I learned, the more I realized that genetics isn’t just about understanding disease. It’s about understanding the very blueprint of human health. Every medication response, every disease susceptibility, every therapeutic outcome has some genetic component underlying it.</p><h3>Understanding the Genetic Landscape</h3><p>Another revelation for me was how many diseases have a <strong>genetic predisposition</strong>. Through my research, I discovered that genetic conditions fall into two main categories, each with profound implications for how we approach treatment and prevention.</p><p><strong>Germline conditions</strong> are the genetic variations we inherit from our parents. These are present in every cell of our body from birth and represent our inherited predispositions. Some protect us from certain diseases, while others increase our risk. Think of conditions like sickle cell disease or BRCA mutations linked to breast cancer. These are the genetic cards we’re dealt at conception.</p><p><strong>Somatic conditions</strong> develop during our lifetime when specific cells acquire new genetic mutations. Cancer is the most prominent example. Unlike germline conditions, these mutations aren’t inherited but arise through various factors including age, environmental exposure and random cellular errors. Understanding this distinction is crucial because it determines both treatment approaches and family implications.</p><p>Knowing this, I began to imagine a future where an individual’s genetic profile could inform their entire health journey; what to eat, what medication works best for them, what diseases they’re most at risk for and how to prevent them. This is not science fiction. It’s already happening in parts of the world. But not everywhere.</p><h3>The Complexity of Genetic Influence</h3><p>What struck me most was learning how genetic influence on disease exists on a spectrum. This revelation changed how I think about health conditions entirely.</p><p><strong>Monogenic conditions</strong> result from mutations in a single gene. While individually rare, there are thousands of these conditions, including cystic fibrosis, Huntington’s disease, and many metabolic disorders. The relationship between gene and disease is relatively straightforward: identify the mutation, understand the condition.</p><p><strong>Polygenic conditions</strong> involve multiple genes working together, often in combination with environmental factors. Most common diseases fall into this category: heart disease, diabetes, depression and many cancers. These conditions require sophisticated analysis to understand how dozens or even hundreds of genetic variants contribute to overall risk.</p><h3>The Promise of Precision Medicine</h3><p>The convergence of genetics and technology has created unprecedented opportunities for personalized healthcare. We now have the ability to:</p><ul><li>Predict disease risk before symptoms appear</li><li>Tailor treatments to individual genetic profiles</li><li>Identify which medications will work best for specific patients</li><li>Develop targeted therapies for rare genetic conditions</li></ul><p>I’ve read remarkable stories of patients whose lives were transformed by treatments designed for their specific genetic makeup. Children with rare genetic diseases receiving life-saving gene therapies. Cancer patients responding to drugs that target their tumor’s unique genetic signature. People avoiding adverse drug reactions because their genetic profile predicted poor medication response.</p><p>This is the future of medicine, and it’s already happening.</p><h3>The Discovery That Changed Everything</h3><p>But then I encountered a statistic that stopped me cold: Africa represents less than 2% of global genomic data.</p><p>Let me put this in perspective. Africa is the birthplace of modern humans. Our species evolved there, and African populations harbor the greatest genetic diversity of any continent. There’s more genetic variation among African populations than exists in all other continental populations combined.</p><p>Yet this vast genetic diversity remains largely unexplored in modern genomic research.</p><h3>The Genetic Paradox</h3><p>This underrepresentation creates a profound paradox in precision medicine. We’re developing genetic tests, risk algorithms and personalized treatments based on a tiny fraction of human genetic diversity. It’s like trying to understand human language by studying only one dialect.</p><p>The consequences are far-reaching:</p><p><strong>Genetic risk scores</strong> developed in European populations often perform poorly when applied to African populations. A test that accurately predicts heart disease risk in one population may be useless in another.</p><p><strong>Drug responses</strong> can vary significantly based on genetic background. Medications that work well for one population may be ineffective or even harmful for another.</p><p><strong>Disease mechanisms</strong> that are common in African populations remain understudied. Protective genetic variants that could inform new treatments are left undiscovered.</p><p><strong>Diagnostic accuracy</strong> suffers when genetic databases lack diversity. Rare variants that are actually common in certain populations may be misclassified as disease-causing.</p><h3>The Global Impact</h3><p>This isn’t just an African problem. As precision medicine becomes mainstream, genetic inequity risks creating a two-tiered healthcare system where the benefits of genetic medicine are primarily available to those of European descent.</p><p>Consider a doctor in any major city treating patients from diverse backgrounds. The genetic tools at their disposal were developed using data that may not represent their patient population. They’re essentially practicing precision medicine with imprecise tools.</p><h3>The Path Forward</h3><p>The good news is that this challenge is increasingly recognized. Initiatives like the Human Heredity and Health in Africa (H3Africa) program are building genomic research capacity across the continent. These efforts focus on ensuring that African researchers lead studies in their own populations and that communities benefit from the research.</p><p>Technology is enabling solutions that weren’t possible before. Sequencing costs have plummeted, making genetic analysis more accessible. Cloud computing platforms allow researchers to share data and resources across borders. Machine learning algorithms help identify patterns in complex genetic datasets.</p><p>But progress requires more than technology. It demands:</p><p><strong>Sustained investment</strong> in genomic research infrastructure across underrepresented populations.</p><p><strong>Ethical frameworks</strong> that ensure communities benefit from genetic research.</p><p><strong>Collaborative partnerships</strong> that prioritize equity and capacity building. <strong>Policy changes</strong> that incentivize inclusive research practices.</p><h3>A Personal Reflection</h3><p>My journey into health tech and genetics has been more than an intellectual exercise. It’s been a revelation about the interconnectedness of human health and the responsibility we have to ensure scientific advances benefit everyone.</p><p>The genetic diversity of African populations isn’t just important for Africans. It’s crucial for understanding human health globally. Every genetic variant we discover, every disease mechanism we uncover, every therapeutic target we identify adds to our collective knowledge and improves health outcomes for all of humanity.</p><h3>The Bigger Picture</h3><p>We stand at a remarkable moment in medical history. The tools to understand and manipulate human genetics are more powerful than ever. We can edit genes, predict diseases and design personalized treatments. But these capabilities mean nothing if they don’t work for everyone.</p><p>The future of precision medicine depends not just on our technological capabilities, but on our commitment to genetic equity. We must ensure that the genetic revolution in medicine includes all of humanity, not just a privileged subset.</p><p>As I continue exploring the intersection of health and technology, I’m convinced that addressing genomic inequity is one of the most important challenges we face. The genetic code may be universal, but its interpretation must be globally informed.</p><p>Only then can we truly unlock the promise of genetics to improve human health for all. The blueprint of human health is written in our DNA, but we’ve only been reading a fraction of the text. It’s time to read the whole story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fd97a625f8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure AWS File Upload Solution with Python and Terraform]]></title>
            <link>https://medium.com/@nolsen603/building-a-secure-aws-file-upload-solution-with-python-and-terraform-158f7ef40fe2?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/158f7ef40fe2</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 20:22:40 GMT</pubDate>
            <atom:updated>2025-04-14T20:22:40.188Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A step-by-step journey to creating a robust, secure and scalable file upload system for sensitive data</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRsAfwHUzpsbZCWXC9k_WA.png" /></figure><h3>Introduction</h3><p>In today’s data-driven world, securely transferring sensitive files to the cloud remains a significant challenge for organizations. Whether you’re handling financial documents, healthcare records or proprietary information, ensuring that data remains protected throughout its lifecycle is non-negotiable.</p><p>I built a secure upload system combining AWS S3, KMS encryption, fine-grained access control and a robust Python script. In this article, I’ll walk you through building this solution step by step.</p><h3>The Security Challenge</h3><p>Let’s start with a common scenario: An organization needs to store sensitive documents in the cloud, accessible only to specific users, with proper encryption and audit trails. Where do you begin?</p><p>The basic requirements typically include:</p><ul><li>End-to-end encryption</li><li>Fine-grained access control</li><li>Comprehensive logging and monitoring</li><li>Simple yet secure user experience</li><li>Reliable handling of large files</li></ul><p>While AWS provides all the necessary building blocks, connecting them properly requires careful planning. Let’s dive into the architecture.</p><h3>The Architecture</h3><p>The secure upload solution consists of several key components:</p><ol><li><strong>S3 Buckets</strong>: A main bucket for encrypted storage and a separate access logging bucket</li><li><strong>KMS Key</strong>: For server-side encryption of all stored objects</li><li><strong>IAM Roles &amp; Policies</strong>: Implementing the principle of least privilege</li><li><strong>CloudWatch Monitoring</strong>: Real-time alerts for suspicious activities</li><li><strong>Python Upload Client</strong>: A user-friendly tool for secure file transfers</li></ol><h3>Setting Up the Foundation with Terraform</h3><p>Infrastructure-as-Code is essential for repeatable, secure deployments. Here’s how I define my S3 bucket with proper security controls:</p><pre>resource &quot;aws_s3_bucket&quot; &quot;upload_bucket&quot; {<br>  bucket = var.bucket_name<br>}</pre><pre>resource &quot;aws_s3_bucket_public_access_block&quot; &quot;upload_bucket&quot; {<br>  bucket = aws_s3_bucket.upload_bucket.id</pre><pre>  block_public_acls       = true<br>  block_public_policy     = true<br>  ignore_public_acls      = true<br>  restrict_public_buckets = true<br>}</pre><pre>resource &quot;aws_s3_bucket_server_side_encryption_configuration&quot; &quot;upload_bucket&quot; {<br>  bucket = aws_s3_bucket.upload_bucket.bucket</pre><pre>  rule {<br>    apply_server_side_encryption_by_default {<br>      kms_master_key_id = var.kms_key_arn<br>      sse_algorithm     = &quot;aws:kms&quot;<br>    }<br>  }<br>}</pre><p>This setup ensures that the bucket blocks all public access and encrypts all objects using the KMS key.</p><h3>The Heart of the System: The Python Uploader</h3><p>While the infrastructure is important, the user experience often determines whether a security solution will be adopted or bypassed. The Python uploader makes the secure path the easy path.</p><p>Let’s look at what makes this uploader special:</p><h3>1. Multipart Uploads for Reliability</h3><p>Large file uploads often fail due to network issues. The uploader breaks files into manageable chunks:</p><pre>def multipart_upload(s3_client, file_path, bucket_name, kms_key_arn, url_expiry_hours):<br>    file_name = os.path.basename(file_path)</pre><pre>    response = s3_client.create_multipart_upload(<br>        Bucket=bucket_name,<br>        Key=file_name,<br>        ServerSideEncryption=&#39;aws:kms&#39;,<br>        SSEKMSKeyId=kms_key_arn<br>    )<br>    upload_id = response[&#39;UploadId&#39;]<br>    <br>    part_size = 8 * 1024 * 1024<br>    file_size = os.path.getsize(file_path)<br>    part_count = math.ceil(file_size / part_size)<br>    parts = []</pre><pre>    # Upload parts logic...</pre><p>This approach makes the solution resilient even for large files or unstable connections.</p><h3>2. Transfer Acceleration for Performance</h3><p>Nobody wants to wait forever for uploads to complete. I enabled S3 Transfer Acceleration for faster transfers:</p><pre>s3_config = Config(<br>    s3={&#39;use_accelerate_endpoint&#39;: True},<br>    signature_version=&#39;s3v4&#39;<br>)</pre><pre>s3_client = session.client(&#39;s3&#39;, config=s3_config)</pre><p>This simple addition dramatically improves upload speeds, especially for users in locations distant from the AWS region.</p><h3>3. Presigned URLs for Secure Sharing</h3><p>Once a file is uploaded, users often need to share it securely. An automatically generate presigned URLs with configurable expiration:</p><pre>def generate_presigned_url(https://medium.com/s3_client,%20bucket_name,%20object_key,%20expiry_hours):<br>    url = s3_client.generate_presigned_url(https://medium.com/%3Cbr%3E%20%20%20%20%20%20%20%20&#39;get_object&#39;,%3Cbr%3E%20%20%20%20%20%20%20%20Params={&#39;Bucket&#39;:%20bucket_name,%20&#39;Key&#39;:%20object_key},%3Cbr%3E%20%20%20%20%20%20%20%20ExpiresIn=expiry_hours%20*%203600%3Cbr%3E)<br>    expiry_time = (datetime.now() + timedelta(hours=expiry_hours)).strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)<br>    print(f&quot;\nPresigned URL (expires at {expiry_time}):&quot;)<br>    print(url)<br>    return url</pre><p>This eliminates the need for users to access the AWS console or create IAM users just to share files.</p><h3>Role-Based Access Control</h3><p>Security isn’t one-size-fits-all. This solution implements role-based access control using IAM policies:</p><pre>locals {<br>  policy_statements = {<br>    admin = [<br>      {<br>        sid     = &quot;FullBucketAccess&quot;<br>        effect  = &quot;Allow&quot;<br>        actions = [&quot;s3:*&quot;, &quot;kms:*&quot;]<br>        resources = [<br>          &quot;arn:aws:s3:::${var.bucket_name}&quot;,<br>          &quot;arn:aws:s3:::${var.bucket_name}/*&quot;,<br>          var.kms_key_arn<br>        ]<br>      }<br>    ],<br>    editor = [<br>      {<br>        sid    = &quot;AllowS3Upload&quot;<br>        effect = &quot;Allow&quot;<br>        actions = [<br>          &quot;s3:PutObject&quot;,<br>          &quot;s3:GetObject&quot;,<br>          &quot;s3:DeleteObject&quot;,<br>          &quot;s3:ListBucket&quot;<br>          # More granular permissions...<br>        ]<br>        resources = [<br>          &quot;arn:aws:s3:::${var.bucket_name}&quot;,<br>          &quot;arn:aws:s3:::${var.bucket_name}/*&quot;<br>        ]<br>      }<br>    ]<br>  }<br>}</pre><p>Users can now be assigned specific roles, ensuring they have exactly the permissions they need — no more, no less.</p><h3>Real-World Security: Monitoring and Alerting</h3><p>Security isn’t complete without monitoring. This solution creates CloudWatch alarms for suspicious activities:</p><pre>resource &quot;aws_cloudwatch_log_metric_filter&quot; &quot;unauthorized_access&quot; {<br>  name           = &quot;${var.bucket_name}-UnauthorizedAccessAttempts&quot;<br>  pattern = &quot;{ ($.errorCode = \&quot;AccessDenied\&quot; || $.errorCode = \&quot;UnauthorizedOperation\&quot;) }&quot;<br>  log_group_name = aws_cloudwatch_log_group.s3_access_logs.name</pre><pre>  metric_transformation {<br>    name      = &quot;UnauthorizedAccessAttempts&quot;<br>    namespace = var.alarm_namespace<br>    value     = &quot;1&quot;<br>  }<br>}</pre><pre>resource &quot;aws_cloudwatch_metric_alarm&quot; &quot;unauthorized_access_alarm&quot; {<br>  alarm_name          = &quot;s3-${var.bucket_name}-unauthorized-access&quot;<br>  comparison_operator = &quot;GreaterThanOrEqualToThreshold&quot;<br>  evaluation_periods  = &quot;1&quot;<br>  metric_name         = &quot;UnauthorizedAccessAttempts&quot;<br>  namespace           = var.alarm_namespace<br>  period              = var.alarm_evaluation_period<br>  statistic           = &quot;Sum&quot;<br>  threshold           = var.unauthorized_access_threshold<br>  alarm_description   = &quot;This alarm triggers when multiple unauthorized access attempts are detected&quot;<br>  alarm_actions       = [var.sns_topic_arn]<br>}</pre><p>This setup alerts security teams to potential intrusion attempts, enabling rapid response.</p><h3>Putting It All Together</h3><p>The deployment process ties everything together:</p><ol><li>Create the infrastructure with Terraform</li><li>Generate secure credentials for different roles</li><li>Deploy the Python uploader script</li><li>Users run a simple command to upload files securely</li></ol><pre>./run_upload.sh important-document.pdf</pre><p>Behind the scenes, this command authenticates the user, encrypts the file, uploads it securely and returns a time-limited access URL.</p><h3>What Went Wrong (and How I Fixed It)</h3><p>This project was a mix of smooth sailing and frustrating dead ends. Here are some real issues I encountered and what I learned:</p><h3>1. jq: command not found</h3><p>Right after deploying, I tried to run the uploader script with:</p><pre>./run_upload.sh ./file-to-upload.zip</pre><p>And immediately hit:</p><pre>./run_upload.sh: line 21: jq: command not found</pre><p><strong>Root Cause:</strong><br> I used jq to extract access keys from Terraform’s JSON output. Turns out, jq wasn&#39;t installed on my system.</p><p><strong>Fix:</strong><br> Installed jq with:</p><pre>sudo apt install jq</pre><p><strong>Lesson Learned:</strong><br> Never assume your environment has everything. Always list and check for external dependencies in your README or setup script.</p><h3>2. Missing Environment Variables: ACCESS_KEY, SECRET_KEY</h3><p>At one point, the uploader kept failing with:</p><pre>Error: Missing environment variables: ACCESS_KEY, SECRET_KEY</pre><p>This was confusing because the script was supposed to export those automatically using Terraform outputs. But the real issue was that the Terraform output didn’t include the access key because terraform apply hadn’t been fully run.</p><p><strong>Fix:</strong><br> I re-ran:</p><pre>./deploy.sh</pre><p>and made sure to confirm the terraform apply step. After that, the credentials were available.</p><p><strong>Lesson Learned:</strong><br> Read the logs, especially the ones you wrote yourself. And confirm your terraform output shows values before depending on them.</p><h3>3. Authentication Failures in Python Script</h3><p>When testing with expired credentials (yes, it happens), the Python uploader printed:</p><pre>Authentication failed: The security token included in the request is invalid.</pre><p><strong>Fix:</strong><br> I regenerated the IAM user credentials by destroying and reapplying the user-related resources in Terraform.</p><p><strong>Lesson Learned:</strong><br> IAM user credentials (especially access keys) can expire, rotate, or get invalidated. Automate that part carefully and consider using temporary credentials (STS) for better practice.</p><h3>4. S3 Bucket Permissions: Access Denied</h3><p>I tried to upload a file and got:</p><pre>ClientError: An error occurred (AccessDenied) when calling the PutObject operation</pre><p><strong>Root Cause:</strong><br> I had forgotten to attach the KMS permissions to the IAM role used for uploading.</p><p><strong>Fix:</strong><br> Updated the KMS key policy to explicitly allow kms:Encrypt and kms:GenerateDataKey for the uploader role.</p><p><strong>Lesson Learned:</strong><br> Always verify KMS key policy permissions — especially when you’re layering IAM roles + encryption.</p><h3>Lessons Learned</h3><p>Building this solution taught me several valuable lessons:</p><p><strong>1. Security and usability aren’t mutually exclusive.</strong> By hiding complexity behind a simple interface, we can make secure practices the path of least resistance.</p><p><strong>2. Layered security works.</strong> No single control is perfect, but combining encryption, access control, monitoring and secure transfer protocols creates a robust system.</p><p><strong>3. Automation is essential for security.</strong> Manual processes inevitably lead to mistakes and inconsistencies. Automating deployment and operation ensures consistent security controls.</p><h3>Conclusion</h3><p>Building a secure file upload solution doesn’t have to be overwhelming. By combining AWS services with a well-designed Python script, you can create a system that’s both highly secure and user-friendly.</p><p>The full code for this solution is available on GitHub.</p><p>Remember, the goal isn’t just to implement security controls — it’s to make security so seamless that users never feel tempted to find workarounds.</p><p><strong><em>Note:</em></strong><em> This article presents a simplified version of the solution. Always consult with security professionals when implementing systems for sensitive data.</em></p><p><strong><em>Github Repository Link: </em></strong><a href="https://github.com/Nicholina1/s3_multipart_upload.git"><em>https://github.com/Nicholina1/s3_multipart_upload.git</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=158f7ef40fe2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Multipart Uploads to AWS S3 with KMS Encryption (Python Walkthrough)]]></title>
            <link>https://medium.com/@nolsen603/secure-multipart-uploads-to-aws-s3-with-kms-encryption-python-walkthrough-8a5d83903133?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a5d83903133</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 18:28:10 GMT</pubDate>
            <atom:updated>2025-04-13T18:28:10.179Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever tried uploading a massive file to AWS S3 and thought <em>“I hope this doesn’t break halfway…”</em>? Or maybe you’ve been asked to ensure data at rest is encrypted <em>with a customer-managed key,</em> and suddenly the simple put_object call doesn’t cut it anymore.</p><p>Welcome to the club. In this article, I’ll walk you through a Python script that securely uploads large files to S3 — using <strong>multipart uploads</strong> and <strong>AWS KMS encryption</strong>, all while giving you rich debug info and fail-safe handling.</p><h3>Why Multipart Uploads Matter</h3><p>Before we touch the code, let’s cover why multipart uploads exist.</p><p>When you upload a large file (think 100MB, 1GB, or more), it’s risky to send the whole thing in one shot. A flaky connection, a server hiccup, or any number of issues could waste your entire upload effort.</p><p><strong>Multipart uploads</strong> allow you to:</p><ul><li>Split your file into chunks</li><li>Upload parts independently (and in parallel, if you want)</li><li>Retry individual parts</li><li>Complete or abort the upload cleanly</li></ul><p>And if you encrypt it with <strong>AWS KMS</strong>, your data stays safe with managed key policies and auditability.</p><h3>The Stack</h3><p>This script uses:</p><ul><li>Python 3</li><li>boto3 (AWS SDK for Python)</li><li>Environment variables for configuration</li><li>A few sanity checks and graceful exits</li></ul><h3>Step-by-Step Walkthrough</h3><h3>1. Debug Your AWS Credentials</h3><pre>def debug_print_credentials():</pre><p>This helper function checks the current AWS credentials your script is using — useful for avoiding <em>“The security token included in the request is invalid.”</em> pain.</p><p>It even masks the access key so you can show logs without leaking secrets.</p><h3>2. Validate Configuration</h3><pre>def validate_config():</pre><p>Your script should never fail halfway because of a missing env var.</p><p>This step ensures the essentials are set:</p><ul><li>S3_BUCKET_NAME</li><li>AWS_KMS_KEY_ARN</li><li>ADMIN_ACCESS_KEY</li><li>ADMIN_SECRET_KEY</li></ul><h3>3. Authenticate with AWS</h3><pre>def create_s3_client(config):</pre><p>We create a session with the provided credentials and check that they’re valid using sts.get_caller_identity(). If the creds are wrong, you’ll get immediate feedback and exit cleanly.</p><h3>4. Multipart Upload with KMS</h3><pre>def multipart_upload(file_path, bucket_name, kms_key_arn):</pre><p>This is the heart of the operation:</p><ul><li><strong>Initiate</strong> the multipart upload with server-side encryption (aws:kms) and a KMS key.</li><li><strong>Loop through the file</strong> in 8MB chunks.</li><li><strong>Upload each part</strong>, collecting the ETags for the final commit.</li><li><strong>Complete</strong> the upload and show the full s3:// path.</li></ul><p>And yes, if anything breaks mid-way, the script <strong>aborts the upload</strong> so you don’t leave zombie uploads behind.</p><h3>How to Run It</h3><ol><li>Export your environment variables:</li></ol><pre>export S3_BUCKET_NAME=my-secure-bucket<br>export AWS_KMS_KEY_ARN=arn:aws:kms:...<br>export ADMIN_ACCESS_KEY=AKIA...<br>export ADMIN_SECRET_KEY=abcd1234...</pre><ol><li>Run the script:</li></ol><pre>./run_upload.sh ./path/to/large_file.zip</pre><blockquote><em>Make sure the file exists and you have access to the specified bucket.</em></blockquote><h3>Pro Tips</h3><ul><li>You can change the part_size (currently 8MB) based on your file size and S3 limits.</li><li>Use aws configure list to cross-check active profiles vs. hardcoded credentials.</li><li>Consider parallelizing part uploads using threads or asyncio for speed.</li></ul><h3>Final Thoughts</h3><p>This script is a great foundation for any secure data pipeline involving S3. With built-in credential validation, encryption, and fault-tolerant upload logic, it’s robust enough for production and simple enough to customize.</p><p>Whether you’re a DevOps engineer, a cloud enthusiast or just a curious developer, I hope this walkthrough helps demystify secure S3 uploads and makes your life just a bit easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a5d83903133" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Bugs, 1 Docker Setup and a Developer on the Brink: Lessons from a Full-Stack Facepalm]]></title>
            <link>https://medium.com/@nolsen603/3-bugs-1-docker-setup-and-a-developer-on-the-brink-lessons-from-a-full-stack-facepalm-a80784ee25c1?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/a80784ee25c1</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Wed, 09 Apr 2025 15:24:43 GMT</pubDate>
            <atom:updated>2025-04-09T15:24:43.479Z</atom:updated>
            <content:encoded><![CDATA[<p>What I learned from wrestling with iron-session, Docker networking and a rogue $faker in Laravel</p><p>You know that moment when your app breaks in three places at once and you just sit there questioning your life choices? Yeah, that was me last night. What started as a “quick test” of my full-stack app turned into hours of debugging across Next.js, Laravel and Docker. But hey — every bug is a lesson in disguise, right?</p><p>Here’s a breakdown of the three errors that nearly broke me — and how I fixed them.</p><h3>Error #1: withIronSession is not a function</h3><p><strong>The Clue:</strong></p><pre>vbnet</pre><pre>TypeError: (0 , a.withIronSession) is not a function</pre><p><strong>Where:</strong><br> In my Next.js frontend, specifically inside the /api/login and /api/user routes.</p><p><strong>The Mistake:</strong><br> I was importing withIronSession like I always did in old projects:</p><pre>js</pre><pre>import { withIronSession } from &quot;next-iron-session&quot;;</pre><p>Except… I wasn’t even using next-iron-session. I had installed the newer <a href="https://www.npmjs.com/package/iron-session">iron-session</a> package instead, which has a <strong>different</strong> API. Rookie move.</p><p><strong>The Fix:</strong><br> Update the import and usage to match iron-session:</p><pre>js</pre><pre>import { withIronSessionApiRoute } from &quot;iron-session/next&quot;;</pre><pre>// Then use it like this:<br>export default withIronSessionApiRoute(handler, sessionOptions);</pre><p>Lesson: Always double-check the library docs, especially when switching to a newer package that <em>looks</em> like the old one but isn’t.</p><h3>Error #2: ECONNREFUSED — Docker’s Secret Gotcha</h3><p><strong>The Clue:</strong></p><pre>css</pre><pre>Error [AggregateError]: code: &#39;ECONNREFUSED&#39;</pre><p><strong>Where:</strong><br> Frontend was trying to make an API call to <a href="http://localhost:8000/api/login.">http://localhost:8000/api/login.</a></p><p><strong>The Mistake:</strong><br> When you’re running both frontend and backend in Docker Compose, <strong>localhost doesn’t mean what you think it means</strong>. Inside the Docker container, localhost refers to the container itself—not your backend container.</p><p><strong>The Fix:</strong><br> Update the API base URL to use the <strong>Docker service name</strong> defined in docker-compose.yaml.</p><p>So if your backend service is called backend, change:</p><pre>js</pre><pre>axios.post(&#39;http://localhost:8000/api/login&#39;)</pre><p>to:</p><pre>js</pre><pre>axios.post(&#39;http://clm_backend:8000/api/login&#39;)</pre><p>Lesson: In Docker Compose, containers talk to each other using service names, not localhost. Internal networking ≠ your machine&#39;s networking.</p><h3>Error #3: “Undefined variable $faker” in Laravel Seeder</h3><p><strong>The Clue:</strong></p><pre>nginx</pre><pre>Undefined variable $faker</pre><p><strong>Where:</strong><br> In my UserTableSeeder.php file.</p><p><strong>The Mistake:</strong><br> I forgot to initialize the Faker instance before using it to generate dummy data. Laravel doesn’t magically inject $faker unless you ask it nicely.</p><p><strong>The Fix:</strong><br> Initialize it manually inside the run method:</p><pre>php</pre><pre>public function run()<br>{<br>    $faker = \Faker\Factory::create();</pre><pre>    DB::table(&#39;users&#39;)-&gt;insert([<br>        &#39;username&#39; =&gt; &quot;admin&quot;,<br>        &#39;first_name&#39; =&gt; &quot;Default&quot;,<br>        &#39;last_name&#39; =&gt; &quot;User&quot;,<br>        &#39;email&#39; =&gt; &quot;admin@clms.com&quot;,<br>        &#39;phone&#39; =&gt; $faker-&gt;numerify(&#39;##########&#39;),<br>        &#39;password&#39; =&gt; bcrypt(&quot;admin&quot;)<br>    ]);<br>}</pre><p>Lesson: Don’t assume Laravel will do everything for you. Sometimes, you still need to roll up your sleeves and instantiate things.</p><h3>Final Thoughts</h3><p>Debugging these issues reminded me of two big truths in development:</p><ol><li><strong>Technology changes fast.</strong> Libraries evolve, and yesterday’s syntax might not work today. Always check the docs.</li><li><strong>Environment matters.</strong> Whether you’re coding locally or inside Docker, context changes everything. Especially when networking is involved.</li></ol><p>It’s easy to feel defeated when things break. But with every error, you build resilience — and a growing mental library of “oh yeah, I’ve seen this before.”</p><p>Until the next bug.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a80784ee25c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging CI/CD: Lessons from a Series of Failed GitHub Actions]]></title>
            <link>https://medium.com/@nolsen603/debugging-ci-cd-lessons-from-a-series-of-failed-github-actions-056b7ed50509?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/056b7ed50509</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 12:46:20 GMT</pubDate>
            <atom:updated>2025-04-04T12:46:20.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Km5oNn-k4w5BR-HYZ2p4w.png" /></figure><p>If there’s one thing that DevOps and cloud engineering have taught me, it’s that <strong>failure is part of the process</strong>. Recently, I found myself wrestling with my <strong>GitHub Actions CI/CD pipeline</strong> while setting up <strong>Docker Build and Push workflows</strong>. It was a classic scenario — commit, push and watch the pipeline fail repeatedly. 😅</p><h3>The Challenge: Fixing My CI/CD Pipeline</h3><p>I had been working on a project that required building and pushing a Docker image to a container registry using GitHub Actions. It seemed simple enough — until the workflow started failing.</p><p>Each red ❌ in my GitHub Actions tab was a reminder that something wasn’t quite right. I made multiple attempts:<br> ✔ Tweaked the <strong>Dockerfile</strong><br> ✔ Adjusted <strong>workflow YAML configurations</strong><br> ✔ Checked <strong>permissions and environment variables</strong></p><p>But nothing seemed to work.</p><h3>Breaking Down the Errors</h3><p>The first step in debugging was to closely examine the error logs. Here are a few common issues I encountered:</p><p>1️⃣ <strong>Incorrect Dockerfile Syntax:</strong><br> A minor typo in the Dockerfile can break the entire build process. I had to carefully go through each line to ensure proper formatting.</p><p>2️⃣ <strong>Authentication Issues:</strong><br> When pushing images to a registry, proper authentication is required. I double-checked my <strong>GitHub secrets</strong> and ensured my credentials were correctly set up.</p><p>3️⃣ <strong>Caching Problems:</strong><br> Caching in Docker builds can sometimes cause unexpected issues. Adding the --no-cache flag helped me troubleshoot the problem.</p><h3>The Moment of Success! 🎉</h3><p>After multiple failed attempts, I finally got a <strong>green checkmark ✅</strong> on my workflow! Seeing that success notification felt incredibly rewarding. The solution? A combination of:</p><ul><li>Fixing syntax errors</li><li>Properly managing GitHub secrets</li><li>Optimizing my Docker build process</li></ul><h3>Key Takeaways</h3><p>🔹 <strong>CI/CD failures are normal</strong> — Treat them as learning opportunities.<br> 🔹 <strong>Error logs are your best friend</strong> — Read them carefully to pinpoint issues.<br> 🔹 <strong>Persistence is key</strong> — Keep iterating until you find what works.</p><h3>Final Thoughts</h3><p>Debugging CI/CD pipelines isn’t just about fixing errors — it’s about understanding how automation works and how to optimize processes efficiently. This experience deepened my knowledge of <strong>GitHub Actions, Docker, and CI/CD best practices</strong>.</p><p>If you’re struggling with your pipeline, don’t give up! Keep testing, learning, and refining. 🚀</p><p>#DevOps #CICD #GitHubActions #Docker #CloudEngineering #Debugging</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=056b7ed50509" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero to AWS Translation Service: My Cloud Journey as a Tech Newcomer]]></title>
            <link>https://medium.com/@nolsen603/from-zero-to-aws-translation-service-my-cloud-journey-as-a-tech-newcomer-fb851f2a374e?source=rss-6138fac126cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb851f2a374e</guid>
            <dc:creator><![CDATA[Nicholina Owusu]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 22:59:55 GMT</pubDate>
            <atom:updated>2025-02-26T22:59:55.660Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Building a Serverless Translation Service with AWS and Terraform.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tlnZxEEFvkojdioD-9Xlg.png" /><figcaption>Project Architecture overview</figcaption></figure><p>As someone who recently transitioned into tech, I challenged myself with a real-world project that would push my understanding of cloud services. I was tasked with building an automated language translation service using AWS services, infrastructure as code (IaC) and Python. While the journey was filled with unexpected challenges, each obstacle taught me valuable lessons about cloud architecture and development.</p><h3>The Project Overview</h3><p>My goal was to create a serverless translation service that could:</p><ol><li>Accept JSON input with multiple sentences in one language</li><li>Use AWS Translate to convert them to another language</li><li>Store both the original and translated text in separate S3 buckets</li><li>Make the whole service accessible via API Gateway</li></ol><p>The architecture looks something like this:</p><ul><li>User submits a POST request with text to be translated</li><li>API Gateway receives the request and forwards it to Lambda</li><li>Lambda function processes the request and calls AWS Translate</li><li>Original text is stored in one S3 bucket, translated text in another</li><li>Result is returned to the user</li></ul><h3>Diving Into Infrastructure as Code with Terraform</h3><p>Having heard about the benefits of infrastructure as code, I decided to use Terraform to define all my AWS resources. This approach seemed daunting at first, but I quickly appreciated how it allowed me to version, reuse and systematically manage my infrastructure.</p><p>My Terraform configuration included resources for:</p><ul><li>Lambda function with Python 3.11 runtime</li><li>Custom Lambda layer for dependencies</li><li>Two S3 buckets for storing request and response data</li><li>IAM roles and policies for secure service access</li><li>API Gateway with necessary integrations</li></ul><p>The most satisfying part was seeing all these components spring to life with a simple terraform apply command.</p><h3>The Python Challenge: My First Encounter with Boto3</h3><p>Writing the Lambda function was where I faced my first significant challenge. Although I had some Python experience, this was my first time using Boto3 (the AWS SDK for Python). The learning curve was steep, especially when it came to understanding AWS service clients, resource models and error handling patterns.</p><p>My initial code looked simple enough:</p><pre>def translate_language(src_locale, target_locale, input_text):<br>    translate = boto3.client(&#39;translate&#39;)<br>    response = translate.translate_text(<br>        Text=input_text,<br>        SourceLanguageCode=src_locale,<br>        TargetLanguageCode=target_locale<br>    )<br>    return response[&#39;TranslatedText&#39;]</pre><p>But I quickly realized real-world applications need retry logic, proper exception handling and configuration that considers regional deployments:</p><pre>config = Config(<br>    retries={<br>        &#39;max_attempts&#39;: 10,<br>        &#39;mode&#39;: &#39;standard&#39;<br>    }<br>)<br>translate = boto3.client(&#39;translate&#39;, region_name=&#39;eu-north-1&#39;, use_ssl=True, config=config)</pre><p>The biggest “aha” moment came when I discovered the proper way to structure AWS Lambda functions with separation of concerns. Breaking my code into separate files (lambda_function.py and translation_app.py) made it more maintainable and easier to debug.</p><h3>The Missing Code Mystery</h3><p>One day, after making what I thought were minor changes, my Lambda function stopped working entirely. The logs showed that Python couldn’t find some of my code. After hours of debugging, I realized what had happened: my deployment package wasn’t including all the necessary files!</p><p>The issue was in my Terraform configuration:</p><pre>data &quot;archive_file&quot; &quot;lambdafiles&quot; {<br>  type        = &quot;zip&quot;<br>  output_path = &quot;function.zip&quot;</pre><pre>  source {<br>    content  = file(&quot;${path.module}/../scripts/lambda_function.py&quot;)<br>    filename = &quot;lambda_function.py&quot;<br>  }</pre><pre>  # I had forgotten to include this!<br>  source {<br>    content  = file(&quot;${path.module}/../scripts/translation_app.py&quot;)<br>    filename = &quot;translation_app.py&quot;<br>  }<br>}</pre><p>I had updated my project structure but forgotten to update the Terraform code that packages the Lambda function. This taught me an important lesson about the complete deployment pipeline and how infrastructure code needs to evolve alongside application code.</p><h3>Wrestling with API Gateway</h3><p>By far, the most challenging part of the project was configuring API Gateway correctly. Setting up the resources, methods and integrations required a deeper understanding of how RESTful APIs work in AWS than I initially anticipated.</p><p>My first confusion was around the permissions model:</p><pre>resource &quot;aws_lambda_permission&quot; &quot;api_gateway&quot; {<br>  statement_id  = &quot;AllowAPIGatewayInvoke&quot;<br>  action        = &quot;lambda:InvokeFunction&quot;<br>  function_name = aws_lambda_function.translate_Function.function_name<br>  principal     = &quot;apigateway.amazonaws.com&quot;<br>  source_arn    = &quot;${aws_api_gateway_rest_api.translate_api.execution_arn}/*/*&quot;<br>}</pre><p>I didn’t understand why my API calls were being rejected until I realized Lambda has its own permission system that needs to explicitly allow API Gateway to invoke it.</p><p>Another stumbling block was understanding the deployment model for API Gateway. Creating the API definition wasn’t enough — I needed to deploy it to a stage:</p><pre>resource &quot;aws_api_gateway_deployment&quot; &quot;translate_deployment&quot; {<br>  rest_api_id = aws_api_gateway_rest_api.translate_api.id<br>  <br>  triggers = {<br>    redeployment = sha1(jsonencode([<br>      aws_api_gateway_resource.my_resource.id,<br>      aws_api_gateway_method.post_method.id,<br>      aws_api_gateway_integration.lambda_integration.id<br>    ]))<br>  }</pre><pre>  depends_on = [<br>    aws_api_gateway_integration.lambda_integration<br>  ]</pre><pre>  lifecycle {<br>    create_before_destroy = true<br>  }<br>}</pre><pre>resource &quot;aws_api_gateway_stage&quot; &quot;translate_stage&quot; {<br>  deployment_id = aws_api_gateway_deployment.translate_deployment.id<br>  rest_api_id   = aws_api_gateway_rest_api.translate_api.id<br>  stage_name    = &quot;translate_prod&quot;<br>}</pre><p>The triggers and depends_on configurations were particularly confusing until I understood how Terraform manages resource dependencies and change detection.</p><h3>Lessons Learned</h3><p>Looking back at this project, I’m amazed at how much I’ve learned in such a short time:</p><ol><li><strong>Start small, then expand</strong>: I began with just the Lambda function and S3 buckets, adding API Gateway once the core functionality worked.</li><li><strong>Read the docs (all of them)</strong>: AWS documentation, Terraform documentation, Boto3 documentation — I skimmed at first but ended up reading them thoroughly after encountering issues.</li><li><strong>Use logs extensively</strong>: Adding detailed logging saved me countless hours of debugging, especially for Lambda functions where I couldn’t step through code.</li><li><strong>Break down the problem</strong>: Each AWS service has its own quirks and learning curve. Tackling them one at a time made the overall project manageable.</li><li><strong>Infrastructure as code is worth it</strong>: Despite the initial learning curve, having my entire infrastructure defined in code made it easy to experiment, iterate and understand my architecture.</li></ol><h3>The Joy of Problem-Solving</h3><p>As someone new to tech, I’ve found that the most rewarding aspect isn’t getting everything right the first time — it’s the process of encountering problems, researching solutions and finally seeing your creation work as intended.</p><p>There’s something uniquely satisfying about submitting a request to your API and seeing translated text come back, knowing that behind the scenes, your code is orchestrating multiple AWS services to work together seamlessly.</p><p>Yes, there were moments of frustration when I couldn’t figure out why API Gateway wasn’t passing requests to Lambda, or why my S3 uploads were failing. But each of these challenges became an opportunity to deepen my understanding.</p><h3>What’s Next?</h3><p>This project has given me confidence to take on more complex cloud architectures. I’m already thinking about enhancements:</p><ul><li>Adding authentication to the API</li><li>Creating a simple web interface</li></ul><p>If you’re also new to tech and feeling intimidated by cloud services, my advice is to jump in with a concrete project that interests you. The AWS free tier provides plenty of room to experiment and the satisfaction of building something real is worth every debugging session.</p><p>The cloud can be complex, but with patience and persistence, even newcomers like me can build impressive, scalable solutions. Happy coding!</p><p><strong>Full Code Repository:</strong></p><p><a href="https://github.com/Nicholina1/aws-translate-project">https://github.com/Nicholina1/aws-translate-project</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb851f2a374e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>