<?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 Mykola Kobzar on Medium]]></title>
        <description><![CDATA[Stories by Mykola Kobzar on Medium]]></description>
        <link>https://medium.com/@mykola.kobzar?source=rss-2a68416f138c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tGQv4w3yWEmu3N6OnZUdFw.gif</url>
            <title>Stories by Mykola Kobzar on Medium</title>
            <link>https://medium.com/@mykola.kobzar?source=rss-2a68416f138c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 04:07:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mykola.kobzar/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[AI Comes to Life]]></title>
            <link>https://medium.com/@mykola.kobzar/ai-comes-to-life-58a3e879679d?source=rss-2a68416f138c------2</link>
            <guid isPermaLink="false">https://medium.com/p/58a3e879679d</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Mykola Kobzar]]></dc:creator>
            <pubDate>Wed, 27 May 2026 11:26:32 GMT</pubDate>
            <atom:updated>2026-06-01T19:28:13.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXms81r8u81E6rZIUWEcEA.png" /></figure><p>Hello everyone, People keep asking me how I actually use AI. What tools, what flow, when I started, so I figured I’d just put it all in one place.</p><p><strong>Quick disclaimer</strong>: this is purely about my personal use. Nothing here reflects what we do at work.</p><h3>The early days (2022–2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1txKjLoA_-PJ-asUiZihKA.png" /></figure><p>The story starts on <strong>June 21, 2022</strong> that’s when I got my first assistant: GitHub Copilot, around $10/month. I still have it, and writing this is a good reminder to go cancel the yearly subscription.</p><p>Then came ChatGPT. I started using it heavily on <strong>December 2, 2022</strong>. At first it was basically a Grammarly replacement, I’d been editing my texts through Grammarly, and ChatGPT just did it better. That’s when the prompt engineering era kicked in for me. Pretty quickly I was inside ChatGPT for everything , small PoCs, automation scripts, anything I could throw at it. For everyone back then it felt like something genuinely breakthrough , you were just probing the limits, trying to figure out how far you could push your productivity.</p><p>Claude came next. I can’t find the original signup date because I’ve rotated the email under that subscription a few times. (Side note, and I really recommend this: use a separate alias for every service. I’ve been doing this for 6+ years with Proton Mail + SimpleLogin.) The earliest charge I can dig up is August 22, 2024, but that’s already a different account , Anthropic doesn’t let you change the email on an existing account, which is super convenient &gt;&gt;&gt; <strong>Not</strong>.</p><p>Then on <strong>November 28, 2023</strong>, AI showed up inside a product I’d been using forever &gt;&gt;&gt; JetBrains. Honestly, I was a bit disappointed. I’d expected them to absolutely nail it given how deep their IDE integration goes, and what I got felt like a bolt-on. I still used it, but it never became my main thing.</p><h3>The autonomy shift (2024)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_MNIlkGJyRrqB9B-ixsDA.png" /></figure><p>Cursor was where I really felt the gear change. The first $20 charge hit on <strong>August 23, 2024</strong>. With Copilot and ChatGPT you were still mostly <em>driving, </em>Cursor was the first time I felt the agent actually <em>doing</em>. I could throw much more complex things at it: multi-file refactors, real automation work not just snippets. I was still reviewing everything carefully, but the leverage was real for the first time.</p><h3>Claude Code era (2025)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-WLxhRDEt4hEFof6Rn1tA.png" /></figure><p>And then His Majesty Claude Code showed up. I don’t remember if it was May 22 or May 26, <strong>2025</strong>, when I first tried it. From the first minute I was sitting there thinking, <em>okay, so what do we do now?</em></p><p>What pulled me off Cursor was simple: with Cursor I was still steering inside an editor. Claude Code felt like delegating to someone who actually finished the task. Hooks, subagent loops, MCP servers (local and remote), skills… everything that layered on top just compounded. You could deliver a task end-to-end. Were there problems? Yes. Did you need to redo things, verify outputs, set tight guardrails for where it could run? Absolutely. But the ceiling was clearly higher than anything before it.</p><p>On <strong>August 26, 2025</strong>, I added Codex to the mix as an alternative. I like Codex in principle, but one real complaint: the OpenAI model felt slow. So I started running both in parallel, different tools for different jobs.</p><p>Toward the end of 2025 I added a review layer on top. Out of all the PR-review tools, <strong>CodeRabbit</strong> won for me. Very flexible custom prompts you set the exact frame you want it to operate in and it does self-improvement, which closes the loop nicely.</p><p>There was also a chapter with Gemini CLI and the Gemini agent. It didn’t click. Hard to point to one specific thing the agent felt less reliable at multi-step tasks, the tool integration was rougher than Claude Code, and the iteration speed wasn’t there. The Gemini model itself Pro and Deep Research I liked a lot back then. For Deep Research specifically, my pick on the market right now is still ChatGPT Pro’s Deep Research.</p><p>I also have Perplexity, but I realized I barely use it, I delegate search to ChatGPT, to Grok when I need to dig through Twitter or to Claude. I used Perplexity actively for almost a year and couldn’t find a unique benefit for my workflow. I know there’s a lot of new stuff now ,Comet Desktop and so on maybe I’ll give it another shot later.</p><h3>Going voice-first (2025)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BUwLAs2RYUeqpL0aJRQ9w.png" /></figure><p>Around the same time I made another shift that ended up being just as big as moving to Claude Code: I went voice-first for almost all my interaction with agents.</p><p>I’d been doing this earlier through <strong>WhisperFlow</strong>, but I was getting uncomfortable with the privacy side my voice, my unfiltered thinking, going through someone else’s cloud. So on <strong>March 22, 2025</strong>, I switched to <strong>SuperWhisper</strong>: fully local STT models, plus a local model like <strong>Gemma 4</strong> for post-processing the transcript depending on what I’m doing with it a code comment, a Slack message, a long-form note, a prompt to an agent. Since that switch, my voice stays on my machine. The data doesn’t leave.</p><p>The other half of 2025 was <strong>Grok Voice and ChatGPT Voice</strong> becoming a daily thing for me. Not just for “questions” for actual companionship-while-doing-something. The dumbest example, but the one that sold me: I’m cooking chicken teriyaki, I prop up the phone, turn on GPT with voice and video, and we just go through it together, it watches the pan, I ask whatever, hands stay on the knife. Same pattern for fixing things around the house, walking somewhere and thinking through a problem, debugging an idea out loud before I sit down to write code. Keyboard-and-screen used to be the default interface. Now it’s the fallback.</p><h3>Current flow (2026)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KVXmwR0o1tUIciUlZdEEA.png" /></figure><p>The latest addition is <strong>Grok Builder</strong>, since <strong>May 15, 2026</strong>. The native agent picks up Claude Code configurations out of the box &gt;&gt;&gt; skills, MCP servers, all of it. What blew me away was the speed.</p><p>Here’s the loop I’ve settled on. Say I need to build a small custom service recent example was a grocery receipt analyzer: snap a photo of a receipt, a small Gemma model extracts the line items, custom logic updates an Excel sheet with what I bought, where, and when. Just a PoC to see how Gemma 4 runs locally.</p><p>The flow:</p><ol><li><strong>Claude writes the plan</strong> — architecture, edge cases, file structure.</li><li><strong>Codex implements</strong> it.</li><li><strong>Claude reviews</strong> the implementation against the original plan.</li><li><strong>CodeRabbit</strong> does a pass and leaves comments.</li><li><strong>Claude and Codex together</strong> decide whether the comments are reasonable, push back where they disagree, and sign off.</li></ol><p>End-to-end this kind of small service takes me 10–30 minutes of actual attention. Where I still step in manually: when the agents disagree about something architectural and keep ping-ponging, or when CodeRabbit flags something subtle that’s actually load-bearing. Codex tends to be better at tight, well-scoped implementation, Claude is better at planning and at catching when something’s structurally off. They genuinely complement each other.</p><p>On hardware: I run parallel Claude Code sessions in Docker via git worktrees, juggling multiple accounts with CLAUDE_CONFIG_DIR, and I use /btw for side-channel checks while longer agent runs are happening. I&#39;ve tried running local models for code assistance, but the honest truth is you need serious hardware to get something competitive with what you get from the frontier APIs.</p><h3>Garfield — my personal cat (2026)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WkjNl2s9zo07mazAhjOXfQ.png" /></figure><p>Since <strong>March 24, 2026</strong>, I’ve had a personal agent running for me. I call it <strong>Garfield</strong> my “personal cat” and it’s built on top of the <strong>Hermes agent</strong> framework. It’s not just mine, my wife and my sister use it too, and that turned out to matter more than I expected. The use cases are all over the map: language learning, planning and reminders for important dates, hunting down a new recipe, helping check kids’ school homework. Nothing flashy individually,but together it replaces a stack of half-broken apps and routines.</p><p>The piece I’m most happy with, though, is the morning briefing. Since I already pay for x.com, I built a sub-agent that pulls the latest news on AI and security through my Grok subscription,no separate x.com API access needed, it’s all included. Every morning I wake up to a personal message from Garfield: a clean summary of every event that actually matters to me, with a link to the original. No thousand Telegram channels, no RSS reader to maintain, no doomscrolling , just the signal I asked for. That single workflow probably gave me back an hour a day and a noticeable amount of mental noise.</p><h3>Where it breaks</h3><p>Worth being honest here, because the rest of this reads like a success story. The biggest losses I’ve taken have been from over-trust , letting an agent run further than it should have on a task it had silently misunderstood, and then having to undo more than I would’ve written by hand. CodeRabbit caught some of those; some I caught only after the fact. The fix wasn’t to trust less in general, it was to be much sharper about <em>when</em> to trust small, well-scoped, reversible changes get full autonomy, anything that touches state, security boundaries, or infra config gets a tighter leash and a real review step.</p><p>The other failure mode is subtler: the speedup is real, but it also makes it really easy to build things you don’t actually need. When the cost of a PoC drops from a day to fifteen minutes, the bar for “is this worth building” drops with it. Worth watching.</p><h3>Closing</h3><p>Times are changing. The only thing I can say with certainty is that I’ve sped up. For the things I personally wanted to do, somewhere between 10x and 100x. What used to take a day now takes 10–15 minutes. For personal projects especially, it’s just something else.</p><p>I see token usage growing, and the subscriptions will probably get more expensive soon… or the simpler models stay on the plans and the heavier ones move to API-only. API costs are climbing, and the reasons are obvious.</p><p>So yeah that’s the story. Hope this was what you were asking about, <strong>Liudmyla</strong>, since you’re the one who pushed me to write it. And hope it was useful for anyone else who made it this far.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58a3e879679d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to [Not] Lose Yourself in the AI Era]]></title>
            <link>https://medium.com/@mykola.kobzar/how-to-not-lose-yourself-in-the-ai-era-f717dc645010?source=rss-2a68416f138c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f717dc645010</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Mykola Kobzar]]></dc:creator>
            <pubDate>Sun, 25 May 2025 14:13:48 GMT</pubDate>
            <atom:updated>2025-05-25T14:13:48.356Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*shhsIWbyFvXyfYCy7UmBrQ.png" /></figure><p>I haven’t written much in recent years, and although this won’t be a tech article, it’s a topic I feel we need to address and support each other with. In this AI Era, especially over the past two years and now in 2025, when changes happen at lightning speed, it’s incredibly challenging to keep yourself in good shape. The world today is drastically different from what it was even five years ago.</p><p>Usually, tech people like myself aren’t afraid of changes, but honestly, even I feel nervous these days. I vividly remember how, back in 2012, my dear friend helped me with Cisco configurations and gave me a massive Cisco textbook. Oh boy, I read it every day during my commute. In 2013, a new colleague told me that if I wanted to progress, I needed to better understand Linux and handed me the “UNIX and Linux System Administration Handbook” by Evi Nemeth and other brilliant authors. This significantly boosted my knowledge and understanding of Linux, from the basics to the deeper corners.</p><p>By 2015, I transitioned from on-premises infrastructure to AWS, handling an e-commerce Hybris platform. Diving deep into AWS documentation, learning became a joyful journey rather than a fearsome challenge. Instead of fearing change, we should evolve, stay curious, and actively use these new tools.</p><p>However, nowadays, being just a good engineer isn’t enough. Previously, continuous learning was sufficient to keep up, but now you must run fast enough to stay aboard this rapidly moving train, with enough stamina to endure this AI era marathon. Otherwise, accept that someone else, a better engineer or even an AI may take your position.</p><p>I want to share some tips I’ve found helpful and that might be useful for you too. <strong>Disclaimer</strong>: This isn’t a guaranteed success guide, these are merely practices I believe can keep you in good shape. <br>Today, being a generalist who knows various fields but excels in one or two specialties is crucial. This approach helps you quickly expand your knowledge to a reasonable level in new areas, leveraging AI’s assistance. Personally, working in DevOps/SRE/MLOps has given me the advantage of interacting with diverse teams and technologies. Here are my top seven tips that have greatly benefited me:</p><ol><li><strong>Stop Reading Bad News: </strong>Mental health is incredibly important. Limit news exposure to about 15 minutes per day if necessary.</li><li><strong>Read Books: </strong>This might sound outdated in 2025, but reading books significantly boosts intelligence. Not all books need to be technical. Try reading aloud for 15–30 minutes daily.</li><li><strong>Delete Social Media Addictions: </strong>Remove TikTok, Instagram, and similar dopamine-driven distractions. They waste your most valuable asset <strong>time</strong>.</li><li><strong>Walk Daily: </strong>Take at least one hour-long walk every day. Your brain needs periods of diffusion mode to effectively absorb new information.</li><li><strong>Ensure Adequate Sleep: </strong>Aim for at least 5 or 6 hours of sleep nightly. Sleep is crucial for learning new material and maintaining communication skills.</li><li><strong>Proper Daily Planning: </strong>Dedicate at least one hour daily to learning something new. I deeply admire people in R&amp;D and Research roles, their continuous learning inspires me.</li><li><strong>Accept Difficult Tasks: </strong>If you face a challenging task and doubt your ability, accept it anyway. Don’t worry if you don’t immediately understand. That’s perfectly normal, as our brains need time to process complex information. Not everyone is a genius, but hard work pays off.</li></ol><p>I could expand this list further, but these are my essential tips. Notice how they are mostly not directly tech- or AI-related. However, shifting your mindset from a task solver to a business problem solver will benefit you greatly. Explore something new. With AI tools like ChatGPT, you can build a pet project, launch a startup, or even try out that recipe you’ve always wanted to cook. ChatGPT can be your mentor, problem solver or even a companion and a friend.</p><p>I don’t recall exactly where I heard this statistic, but less than 10% of the population is genuinely creative. If you don’t feel creative, now is the perfect time to start cultivating this skill. While I admit the upcoming changes fascinate and terrify me, the AI hype notwithstanding, it still can’t fully replace you. Embrace AI, overcome your fears and use it to propel yourself further ahead.</p><blockquote>P.S. This text was not created by AI, but I did use it to correct my grammar since English is not my mother tongue.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f717dc645010" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[9 tips to save costs in AWS]]></title>
            <link>https://medium.com/@mykola.kobzar/9-tips-to-save-costs-in-aws-f34692dcbb48?source=rss-2a68416f138c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f34692dcbb48</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cost-effective]]></category>
            <category><![CDATA[cost-effectiveness]]></category>
            <dc:creator><![CDATA[Mykola Kobzar]]></dc:creator>
            <pubDate>Sun, 25 Sep 2022 12:15:06 GMT</pubDate>
            <atom:updated>2022-09-25T12:15:06.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5Uap8VnTeZ8-Vsh8KY7fw.jpeg" /></figure><p>The Economics Crisis is on its own path all over the world and it’s very important to be prepared for it. <br>I put some tips which might help you to save costs on infrastructure and help your business to smash costs. I am going to talk about AWS, but in Azure or GCP you can use the same approach.</p><ol><li>It’s trivial but you should check your <strong>unused</strong> resources. I bet you have one of them for sure. It depends on your infrastructure architecture but you definitely will find some resources that could be deleted. <br>Such as Elastic IP, EBS Snapshots, unused EBS Volumes, KMS keys, etc<br>To do that you need to use <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/what-is-costmanagement.html">AWS Cost Management</a> with <a href="https://aws.amazon.com/aws-cost-management/aws-cost-explorer/">Cost Explorer</a> and your <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/view-billing-dashboard.html">AWS Billing Dashboard</a>.</li><li>Set up and configure your B<strong>udget</strong> and B<strong>illing Alerts</strong>. It’s very important to be ready for unusual usage in your cloud and quickly aware of such situations.<br>To do that you will need to create your budget in <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/what-is-costmanagement.html">AWS Cost Management</a> with <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-create.html">AWS Budget</a> and in <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/view-billing-dashboard.html">AWS Billing Dashboard</a> to enable <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html">Billing Alerts and AWS CloudWatch</a>.</li><li>Use <a href="https://aws.amazon.com/savingsplans/"><strong>Savings Plan</strong></a> or <a href="https://aws.amazon.com/ec2/pricing/reserved-instances/"><strong>Reserved instances</strong></a> for a prophesied load.<br>Depending you your choice you should remember that on one hand <strong>Saving Plan</strong> is a commitment to a consistent amount of usage (measured in $/hour) for a 1 or 3-year term on another hand <strong>Reserved Instances</strong> is a commitment-specific configuration with up-front payment for a 1 or 3-year term.</li><li>Use <a href="https://aws.amazon.com/ec2/spot/"><strong>Spot instances</strong></a> and <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html"><strong>Spot Fleet</strong></a> for development and part of production workload that is not crucial. It’s a very good manner to mix workload with a spot instance to achieve cost efficiency, but always remember the best result you might have with a stateless application to have a good tradeoff between stability and cost-effectiveness.</li><li>Nowadays everyone is using Kubernetes, it’s time to migrate from Cluster Autoscaler to <a href="https://karpenter.sh/"><strong>Karpenter</strong></a>. The Karpenter is a new auto-scaler tool for Kubernetes with extraordinary features such as <a href="https://aws.amazon.com/about-aws/whats-new/2022/08/workload-consolidation-karpenter/"><strong>Workload Consolidation</strong></a>. This is really huge step to saving money in clusters with under-utilized workloads.</li><li>Understand and fix your <strong>real workload usage</strong>. Make load and stress tests on your application and understand where are the bottlenecks with different infrastructure configurations. Are you ready to use T type of instances with CPU Credits or do you need less CPU and more memory?<br>To do that tools like <a href="https://www.kubecost.com/"><strong>Kubecost</strong></a><strong> </strong>saves you a lot of money on your bill.</li><li>Use <a href="https://aws.amazon.com/ec2/graviton/"><strong>ARM instances</strong></a> where you can. Migrate to ARM in your RDS or App stack. It saves you up to 15% in comparison to AMD64 architecture with the same CPU performance.</li><li><strong>Teach</strong> your developers to use the cloud in a proper way. You might astonish but if you start to talk with developers and understand their needs you can help them to point in the right direction where to go.<br>For example, the developer created an EC2 Instance with Nginx on a board and put static files there for the application. In this case, you can ask and provide information maybe it’s better to put it in an S3 bucket instead of using EC2 for this purpose?</li><li>Have <a href="https://www.finops.org/introduction/what-is-finops/"><strong>FinOps</strong></a> thinking and behaviour. It’s popular in our generation to not just push code and run workloads in a cloud but also be cost efficient.</li></ol><p>In conclusion, Don’t be afraid to test your own way of saving money in the cloud. It does not always work from the first time, but in each iteration of cost saving, you make your product better for the modern world. I hope these <strong>9 basic tips</strong> help you on your journey in this wild cost efficient adventure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f34692dcbb48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure way of using Atlantis in Kubernetes with Vault]]></title>
            <link>https://medium.com/@mykola.kobzar/secure-way-of-using-secrets-in-atlantis-with-vault-16c646676fe9?source=rss-2a68416f138c------2</link>
            <guid isPermaLink="false">https://medium.com/p/16c646676fe9</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[vault]]></category>
            <category><![CDATA[atlantis]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mykola Kobzar]]></dc:creator>
            <pubDate>Sun, 04 Sep 2022 15:22:56 GMT</pubDate>
            <atom:updated>2022-09-04T15:22:56.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fcACQP29YNosLFQ2rgH6tg.png" /></figure><p>Hello everyone, my name is Mykola and today I would like to show you one of the secure way on how to use <a href="https://www.runatlantis.io/">Atlantis</a> and <a href="https://www.vaultproject.io/">Hashicorp Vault</a></p><p><strong>Disclaimer:</strong></p><ul><li>We are not going to discuss how to deploy K8S or Vault nor Atlantis (I assume you already have it)</li><li>The Idea of this article is to show one of the approaches how to use secrets within Terraform and Vault</li></ul><p><strong>Brief plan of our steps:</strong></p><ol><li>Configure Vault Auth integration with K8S</li></ol><p>2. Configure Atlantis to use Vault Token to extract secrets</p><p>Let’s look at the diagram of what we want to achieve</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVeOilWtS-cmP59JQbCjrw.png" /></figure><p><strong>Configure Vault Auth integration with K8S.</strong></p><ol><li>We need to create a service account which we will use as JWT Reviewer</li></ol><pre>resource &quot;kubernetes_service_account&quot; &quot;vault_account&quot; {<br>  metadata {<br>    name      = &quot;vault-reviewer&quot;<br>    namespace = &quot;vault&quot;<br>  }<br>}</pre><p>2. We need to add Cluster Role binding to our reviewer service account</p><pre>resource &quot;kubernetes_cluster_role_binding&quot; &quot;vault_binding&quot; {<br>  metadata {<br>    name = &quot;vault-auth-role-token-review-binding&quot;<br>  }<br>  role_ref {<br>    api_group = &quot;rbac.authorization.k8s.io&quot;<br>    kind      = &quot;ClusterRole&quot;<br>    name      = &quot;system:auth-delegator&quot;<br>  }<br>  subject {<br>    kind      = &quot;ServiceAccount&quot;<br>    name      = kubernetes_service_account.vault_account.metadata.0.name<br>    namespace = &quot;vault&quot;<br>  }<br>}</pre><p>3. We need to enable and create Auth k8s backend in Vault</p><pre>resource &quot;vault_auth_backend&quot; &quot;this&quot; {<br>  type = &quot;kubernetes&quot;<br>  path = &quot;atlantis&quot;<br>}</pre><p>4. Lets configure our auth backend</p><pre>data &quot;kubernetes_service_account&quot; &quot;vault_account&quot; {<br>  metadata {<br>    name      = kubernetes_service_account.vault_account.metadata.0.name<br>    namespace = &quot;vault&quot;<br>  }<br>}</pre><pre>data &quot;kubernetes_secret&quot; &quot;vault_account_token&quot; {<br>  metadata {<br>    name      = data.kubernetes_service_account.vault_account.default_secret_name<br>    namespace = &quot;vault&quot;<br>  }<br>}</pre><pre>data &quot;aws_eks_cluster&quot; &quot;this&quot; {<br>  name = &quot;eks-test&quot;<br>}</pre><pre>resource &quot;vault_kubernetes_auth_backend_config&quot; &quot;this&quot; {<br>  backend                = vault_auth_backend.this.path<br>  kubernetes_host        = data.aws_eks_cluster.this.endpoint<br>  kubernetes_ca_cert     = base64decode(data.aws_eks_cluster.this.certificate_authority.0.data)<br>  token_reviewer_jwt     = lookup(<em>data</em>.kubernetes_secret.vault_account_token.data, &quot;token&quot;, &quot;&quot;)<br>  disable_iss_validation = &quot;true&quot;<br>}</pre><p>5. Now we need to create <a href="https://www.vaultproject.io/docs/concepts/policies">Vault Policy</a></p><pre>data &quot;vault_policy_document&quot; &quot;admin&quot; {<br>  rule {<br>    path         = &quot;*&quot;<br>    capabilities = [&quot;sudo&quot;, &quot;read&quot;, &quot;create&quot;, &quot;update&quot;, &quot;delete&quot;, &quot;list&quot;, &quot;patch&quot;]<br>    description  = &quot;allow all&quot;<br>  }<br>}<br><br>resource &quot;vault_policy&quot; &quot;admin&quot; {<br>  name   = &quot;admin&quot;<br>  policy = <em>data</em>.vault_policy_document.admin.hcl<br>}</pre><p>6. After policy provisioning, we need to configure roles binding for our auth method, where we are matching the service account name and its namespace</p><pre>resource &quot;vault_kubernetes_auth_backend_role&quot; &quot;this&quot; {<br>  role_name = &quot;atlantis&quot;<br>  backend   = vault_auth_backend.this.path<br>  bound_service_account_names = [<br>    &quot;atlantis&quot;<br>  ]<br>  bound_service_account_namespaces = [<br>    &quot;atlantis&quot;<br>  ]<br>  token_policies = [<br>    vault_policy.admin.name<br>  ]<br>  token_period = 1800<br>}</pre><p>Basically, this is pretty much it. We need to try get the Vault Token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAqDnG-b8A_C9QUheG9WJQ.png" /></figure><p>Cool, we got the our Vault token</p><p>P.S.</p><ol><li>If you are running Vault Cluster outside of your k8s cluster Its very important to open K8S API to Vault Cluster because you might see the error “Permission Denied”</li><li>If you are using Vault Enterprise you need also to specify namespace by adding Header to the request “X-Vault-Namespace: namespace_name”</li></ol><p><strong>Configure Atlantis to use Vault Token to extract secrets</strong></p><p>As I am using helm chart to deploy Atlantis it’s pretty easy to configure it to use our custom vault token by adding a custom workflow</p><pre>repoConfig: |<br>  ---<br>  repos:<br>  - id: /.*/<br>    apply_requirements: [mergeable, approved]<br>    allow_custom_workflows: false<br>    allowed_overrides: [workflow]<br>    allowed_workflows: [terragrunt]<br>    workflow: terragrunt<br>  workflows:<br>    terragrunt:<br>      plan:<br>        steps:<br>        - env:<br>            name: VAULT_TOKEN<br>            command: &quot;curl -s --location --request POST <a href="https://your_vault_address:8200/v1/auth/atlantis/login">https://YOUR_VAULT_ADDRESS:8200/v1/auth/atlantis/login</a> --header &quot;X-Vault-Namespace: admin&quot; --header &quot;Content-Type: application/json&quot; --data-raw &quot;{\&quot;jwt\&quot;: \&quot;$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\&quot;, \&quot;role\&quot;: \&quot;atlantis\&quot;}&quot; | jq -r .auth.client_token&quot;<br>        - run: terragrunt init -no-color<br>        - run: terragrunt plan -no-color -out=$PLANFILE<br>      apply:<br>        steps:<br>        - env:<br>            name: VAULT_TOKEN<br>            command: &quot;curl -s --location --request POST <a href="https://your_vault_address:8200/v1/auth/atlantis/login">https://YOUR_VAULT_ADDRESS:8200/v1/auth/atlantis/login</a> --header &quot;X-Vault-Namespace: admin&quot; --header &quot;Content-Type: application/json&quot; --data-raw &quot;{\&quot;jwt\&quot;: \&quot;$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\&quot;, \&quot;role\&quot;: \&quot;atlantis\&quot;}&quot; | jq -r .auth.client_token&quot;<br>        - run: terragrunt apply -no-color $PLANFILE</pre><p>Ok what we just did, we added a custom workflow to our Atlantis and set <strong>VAULT_TOKEN</strong> as environment variable so Vault provider would be able to use and extract Secrets from Vault as data resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCLJwO4XYZRktUFHA_krUw.png" /></figure><p><strong>Conclusion:</strong></p><p>It’s only one of the ways how to use a more secure way with Terraform. I hope you enjoyed your time reading this article. There is a million way to achieve the same goal, but this is one which is fast and explicitly easy to implement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16c646676fe9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>