<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mher Poghosyan</title>
    <description>The latest articles on DEV Community by Mher Poghosyan (@mher_poghosyan).</description>
    <link>https://dev.to/mher_poghosyan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4245164%2F84b3e33a-84bb-4e42-bb21-248c1f1a736c.png</url>
      <title>DEV Community: Mher Poghosyan</title>
      <link>https://dev.to/mher_poghosyan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mher_poghosyan"/>
    <language>en</language>
    <item>
      <title>How we give a fixed price for automation work before writing any code</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Sat, 05 Dec 2026 13:09:19 +0000</pubDate>
      <link>https://dev.to/kubmeta/how-we-give-a-fixed-price-for-automation-work-before-writing-any-code-526g</link>
      <guid>https://dev.to/kubmeta/how-we-give-a-fixed-price-for-automation-work-before-writing-any-code-526g</guid>
      <description>&lt;p&gt;Automation projects have a reputation for budgets that drift. A workflow that looked like "connect the form to the CRM" turns into three weeks of edge cases and an hourly invoice nobody planned for. The client cannot budget for that, and the engineer ends up paid for the questions nobody asked at the start.&lt;/p&gt;

&lt;p&gt;We price our projects as a fixed amount, agreed before we start. That only works if the scope is clear enough to price. So most of the effort goes into the first conversation and a short written plan. This article covers the process, the questions we ask, how changes work, and the cases where hourly work is fairer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The process, step by step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Day 1: first message.&lt;/strong&gt; You write to us or book a call. We reply within one business day and tell you honestly whether we can help. If we are not the right fit, we tell you that and suggest where to look instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A free 30-minute call&lt;/strong&gt; on Google Meet. We find out whether we are a good fit and agree on what happens next.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2–3 days later: a written plan with a fixed price.&lt;/strong&gt; It says what we build, how long it takes and what it costs. No hourly surprises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build and handover, usually 1–4 weeks.&lt;/strong&gt; The work lands in your repository and your accounts, with documentation. Production changes happen only after your approval.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monthly care, if you want it.&lt;/strong&gt; Monitoring, updates, backups, fixes and small improvements, from $300 per month.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Projects are paid half up front and half on delivery. Monthly care is paid at the start of each month.&lt;/p&gt;

&lt;p&gt;If you prefer writing to a call, our contact email opens with four questions. Answer what you can:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is getting in the way:
What should change:
Current setup (n8n, cloud, tools):
Timeline and budget, if known:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With those answers we come to the call with a rough idea of the solution, and the 30 minutes go into details.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we ask on the call
&lt;/h2&gt;

&lt;p&gt;Thirty minutes is enough if the questions are specific. The goal is to find everything that would change the price later and settle it now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What starts it, and how often.&lt;/strong&gt; A form submission, a schedule, an incoming email, a webhook from a payment system. How many items per run, and per day. Ten orders a day and ten thousand are different projects: pagination, rate limits and retries only appear once the volume grows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which systems, and how we get in.&lt;/strong&gt; For each system we ask whether there is an API and who owns the account. We ask whether there is a test account or a sandbox, and which plan you are on, since some APIs are only available on higher plans. A system without an API, where the only way in is a web page or an exported file, is the most common source of surprises. We want to know that on the call, not in week two.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when it fails.&lt;/strong&gt; What should happen if an API is down, if the same order arrives twice, or if half of a batch fails? Who gets the alert, and where? This is where "simple" workflows grow, and also where most of their value is. Error handling, retries and alerts are part of every workflow we build, so they are part of the price from the start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where the data lives.&lt;/strong&gt; Does it have to stay on your servers? That decides between self-hosted n8n and n8n Cloud. Is there personal data that needs special handling?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What "done" looks like.&lt;/strong&gt; We ask for a real example input and the output you expect. If someone on your team fills in a spreadsheet by hand today, that spreadsheet is the best acceptance test there is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who owns it afterwards.&lt;/strong&gt; Who on your side will look at it when something breaks? Do you already run n8n, or does it need a production setup first? The work always lives in your repository and accounts. If we stop working together, nothing stops working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timeline and budget.&lt;/strong&gt; If there is a budget, saying it on the call saves a round trip. We can propose a smaller first phase instead of a plan you will not buy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the written plan contains
&lt;/h2&gt;

&lt;p&gt;A page or two, not a contract-sized document. Every plan has the same sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Goal.&lt;/strong&gt; One or two sentences, in your words.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What we build.&lt;/strong&gt; Each workflow or component, with its trigger, the systems it touches and its output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Out of scope.&lt;/strong&gt; Things we discussed and agreed to leave out. This section prevents more arguments than any other.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assumptions.&lt;/strong&gt; API access, volumes, test accounts, and what happens if an assumption turns out wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you provide.&lt;/strong&gt; Access, test data, and a person who answers questions. Your servers, model APIs and SaaS subscriptions stay in your accounts, and you pay for them directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acceptance.&lt;/strong&gt; How we both check that it works, usually with the example from the call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handover.&lt;/strong&gt; Documentation, and where the code and workflows live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeline and price.&lt;/strong&gt; A fixed amount, half up front and half on delivery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is a made-up example, shortened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Goal: new orders from the web shop reach the warehouse sheet without manual copying.

Build:
1. n8n workflow "Orders -&amp;gt; warehouse": webhook from the shop on a new order,
   order lines mapped to the sheet format, one row per line.
   Repeated webhooks for the same order are ignored (order ID is the key).
2. Error path: failed runs are retried, then an alert goes to the team chat
   with the order ID and the error.

Out of scope: refunds and order edits (possible later as a separate workflow).
Assumptions: the shop's plan includes webhooks; volumes as discussed on the call.
Acceptance: test orders from the shop's test mode appear correctly in the sheet.
Handover: workflow JSON and a README in your repository.
Timeline: 1 week after access is provided.
Price: fixed; half up front, half on delivery.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every line in that plan is something either side can point to later. That is what keeps the price fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting prices, and what moves them
&lt;/h2&gt;

&lt;p&gt;These are the prices on our site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;n8n automation:&lt;/strong&gt; from $600 per workflow, and packages of 3–5 related workflows from $2,000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production n8n:&lt;/strong&gt; from $900 one-time, for self-hosted n8n with queue mode, monitoring, alerts, backups with a tested restore, and separate stage and production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DevOps and cloud:&lt;/strong&gt; a $750 audit, credited to the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monthly care:&lt;/strong&gt; from $300 per month.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A "from" price is only honest if you also say what moves it up. These are the things that do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More systems, and especially systems without a usable API.&lt;/li&gt;
&lt;li&gt;Volume: pagination, rate limits, and loading historical data before going live.&lt;/li&gt;
&lt;li&gt;Stricter requirements, such as results within seconds instead of minutes, or no duplicates under any failure.&lt;/li&gt;
&lt;li&gt;LLM steps whose output has to be checked against real examples before anyone trusts it.&lt;/li&gt;
&lt;li&gt;Existing workflows that nobody documented and that have to be understood before they can be changed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these is something we ask about on the call. So it shows up in the plan, not on the invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change requests
&lt;/h2&gt;

&lt;p&gt;Every project gets new ideas halfway through. That is normal. What matters is that nobody is surprised by the bill.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A clarification of something already in the plan&lt;/strong&gt; is part of the price. If the plan says "alert in the team chat" and you want it in a different channel, that is not a change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anything new&lt;/strong&gt;, such as another trigger, another system or another output, we write down as a change. It says what changes and how that affects the price and the timeline. You decide before we start on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Often the cheapest answer is a swap.&lt;/strong&gt; Drop something from the plan that matters less, add the new thing, and keep the price.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Larger additions&lt;/strong&gt; wait until delivery and become the next plan. Small improvements after handover are what monthly care is for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What we avoid in both directions: absorbing changes silently and cutting corners elsewhere to stay in budget, or adding them to the invoice without asking.&lt;/p&gt;

&lt;h2&gt;
  
  
  When hourly is the honest choice
&lt;/h2&gt;

&lt;p&gt;A fixed price is a promise based on a known scope. Sometimes the scope cannot be known from a call. Pretending otherwise means either padding the price heavily or arguing later. Hourly work is more honest when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nobody knows what is broken.&lt;/strong&gt; A freelancer built the automations and left, there is no documentation, and the failures cannot be reproduced. The first job is to find out what is going on, and that is investigation, not delivery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Something is down right now.&lt;/strong&gt; Incident work cannot wait for a written plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You want to steer day by day.&lt;/strong&gt; If the scope is meant to change as you see results, a fixed price works against you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Often there is a middle path. A short fixed-price audit turns the unknowns into a scope, and the build after it gets a fixed price like any other project. For DevOps and cloud work, the audit is $750 and credited to the project. A steady stream of small changes fits monthly care better than an hourly meter.&lt;/p&gt;

&lt;p&gt;If hourly is the right call, protect yourself the same way you would with a fixed price. Set a weekly cap and ask for a short written note every week: what was found, and what comes next. Upwork supports both fixed-price and hourly contracts, and you can hire Kubmeta there as an agency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist for any fixed quote
&lt;/h2&gt;

&lt;p&gt;Whoever you hire, a fixed quote should pass these checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Every workflow is listed with its trigger, systems and output&lt;/li&gt;
&lt;li&gt;[ ] There is an "out of scope" section&lt;/li&gt;
&lt;li&gt;[ ] Assumptions are written down, along with what happens if one is wrong&lt;/li&gt;
&lt;li&gt;[ ] Acceptance is a concrete test, not "works as expected"&lt;/li&gt;
&lt;li&gt;[ ] You know where the work lives after handover, and that you own it&lt;/li&gt;
&lt;li&gt;[ ] You know how changes are priced before the first one comes up&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have a project in mind, the four questions on &lt;a href="https://kubmeta.com/discuss/" rel="noopener noreferrer"&gt;our contact page&lt;/a&gt; are the fastest way to start. We reply within one business day, with questions or with a plan and a price.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>n8n</category>
      <category>consulting</category>
    </item>
    <item>
      <title>Moving a hand-built Cloudflare account into Terraform without downtime</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Thu, 03 Dec 2026 13:09:19 +0000</pubDate>
      <link>https://dev.to/kubmeta/moving-a-hand-built-cloudflare-account-into-terraform-without-downtime-37n9</link>
      <guid>https://dev.to/kubmeta/moving-a-hand-built-cloudflare-account-into-terraform-without-downtime-37n9</guid>
      <description>&lt;p&gt;Most Cloudflare accounts start in the dashboard. It works, but nobody can say why a setting has its value, and every change is a click with no review and no history.&lt;/p&gt;

&lt;p&gt;Our own account was like that: two zones with DNS records, several Cloudflare Tunnels to a server running n8n, Access applications and a policy in front of them, four response header rules, HSTS, SSL and cache settings. Some of it was set by hand, some by a small Python script. We moved all of it into Terraform with Terragrunt and the Cloudflare provider v5. Nothing was recreated and no site went down. Here is the order we followed and the traps we hit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule: no changes until the plan is empty
&lt;/h2&gt;

&lt;p&gt;An import is not the moment to improve anything. While importing, the only acceptable plan is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Plan: N to import, 0 to add, 0 to change, 0 to destroy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the apply, the next plan must say &lt;code&gt;No changes. Your infrastructure matches the configuration.&lt;/code&gt; Every &lt;code&gt;~&lt;/code&gt; or &lt;code&gt;+&lt;/code&gt; before that means the code does not yet describe reality: fix the code, not Cloudflare. Improvements come afterwards, as small separate changes with their own plans.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before the first import: state and one token
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;State lives in Cloudflare R2.&lt;/strong&gt; Terraform's S3 backend works with R2 and, since Terraform 1.10, locks state with a lock file in the same bucket (&lt;code&gt;use_lockfile&lt;/code&gt;). We generate the backend with Terragrunt's &lt;code&gt;generate&lt;/code&gt; block rather than &lt;code&gt;remote_state&lt;/code&gt;, so Terragrunt does not try to create or configure the bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;generate&lt;/span&gt; &lt;span class="s2"&gt;"backend"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;path&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"backend.tf"&lt;/span&gt;
  &lt;span class="n"&gt;if_exists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"overwrite_terragrunt"&lt;/span&gt;
  &lt;span class="n"&gt;contents&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;
    &lt;span class="n"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;bucket&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;state-bucket&amp;gt;"&lt;/span&gt;
        &lt;span class="n"&gt;key&lt;/span&gt;          &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"${path_relative_to_include()}/terraform.tfstate"&lt;/span&gt;
        &lt;span class="n"&gt;region&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"auto"&lt;/span&gt;
        &lt;span class="n"&gt;endpoints&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://&amp;lt;account-id&amp;gt;.eu.r2.cloudflarestorage.com"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;use_lockfile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

        &lt;span class="n"&gt;use_path_style&lt;/span&gt;              &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;skip_credentials_validation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;skip_region_validation&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;skip_requesting_account_id&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;skip_metadata_api_check&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="n"&gt;skip_s3_checksum&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="no"&gt;EOF&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The state bucket itself is created by Terraform: first with local state, then &lt;code&gt;terragrunt init -migrate-state&lt;/code&gt; moves that state into the bucket it just created. Terraform also creates the R2 token for state, scoped to that one bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One API token per provider.&lt;/strong&gt; Terraform gets a single account-owned Cloudflare token with only the permissions it uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;account level: Cloudflare Tunnel, Access: Apps and Policies, Workers R2 Storage, and Account API Tokens (so Terraform can create the scoped state token);&lt;/li&gt;
&lt;li&gt;all zones of the account: Zone (read), DNS, Zone Settings, SSL and Certificates, Cache Settings, Config Settings, Transform Rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we later added Cloudflare Pages and a Worker, we extended this token instead of creating a second one: one place to rotate, one list of permissions to review. It is stored encrypted with SOPS and reaches Terraform only as the &lt;code&gt;CLOUDFLARE_API_TOKEN&lt;/code&gt; environment variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Describe what exists, then import it
&lt;/h2&gt;

&lt;p&gt;Every zone has the same shape, so we wrote one module, &lt;code&gt;cloudflare-site&lt;/code&gt;, and one Terragrunt stack per zone with its inputs: records, tunnels and their hostnames, the Access policy, header rules, settings.&lt;/p&gt;

&lt;p&gt;Then import blocks, one per existing object. They are only allowed in the root module; with Terragrunt the stack is the root module, so each stack generates its own file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;generate&lt;/span&gt; &lt;span class="s2"&gt;"imports"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;path&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"imports.tf"&lt;/span&gt;
  &lt;span class="n"&gt;if_exists&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"overwrite_terragrunt"&lt;/span&gt;
  &lt;span class="n"&gt;contents&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;
      &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;zone-id&amp;gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_dns_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"spf"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;zone-id&amp;gt;/&amp;lt;record-id&amp;gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_zero_trust_access_application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"n8n.example.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"accounts/&amp;lt;account-id&amp;gt;/&amp;lt;app-id&amp;gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="no"&gt;EOF&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ID formats differ between resources: Access applications need the &lt;code&gt;accounts/&lt;/code&gt; prefix, Access policies and tunnels do not, rulesets use &lt;code&gt;zones/&amp;lt;zone-id&amp;gt;/&amp;lt;ruleset-id&amp;gt;&lt;/code&gt;. Check each resource's import section in the provider docs. The IDs themselves come from the API, for example &lt;code&gt;GET /zones/&amp;lt;zone-id&amp;gt;/dns_records&lt;/code&gt; for records.&lt;/p&gt;

&lt;p&gt;Zone settings are different: they always exist and cannot be created, only adopted. The module imports them itself whenever the stack passes the ID of an existing zone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;for_each&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zone_id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nf"&gt;toset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;toset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_zone_setting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"${var.zone_id}/${each.key}"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For kubmeta.com alone that was 23 import blocks, plus the zone settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the plan until it is empty
&lt;/h2&gt;

&lt;p&gt;The first plans were not empty. Each difference taught us something about the provider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access applications&lt;/strong&gt; showed &lt;code&gt;false -&amp;gt; null&lt;/code&gt; for attributes we had not set. The API returns &lt;code&gt;false&lt;/code&gt;, the provider treats a missing value as &lt;code&gt;null&lt;/code&gt;. Writing Cloudflare's defaults out explicitly fixed it:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;  &lt;span class="c1"&gt;# Cloudflare's defaults, written out: without them the plan shows false -&amp;gt; null&lt;/span&gt;
  &lt;span class="n"&gt;auto_redirect_to_identity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;enable_binding_cookie&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;options_preflight_bypass&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TXT records&lt;/strong&gt; must match byte for byte. Some of ours were stored with surrounding double quotes, some without. Copy the content exactly as the API returns it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HSTS&lt;/strong&gt; was already on with a one-year &lt;code&gt;max-age&lt;/code&gt;, subdomains and preload. We described it exactly as it was: browsers remember HSTS for the whole &lt;code&gt;max-age&lt;/code&gt;, so it is not something to change by accident.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rulesets: adopt them, never recreate them
&lt;/h2&gt;

&lt;p&gt;The four header rules (X-Frame-Options, Permissions-Policy, Content-Security-Policy, Referrer-Policy) were created in the dashboard. Cloudflare keeps them in the zone's entry-point ruleset for the &lt;code&gt;http_response_headers_transform&lt;/code&gt; phase, and a zone has only one entry point per phase. Terraform cannot create a second one next to it, and deleting the dashboard ruleset to make room would leave the site without those headers until the apply finishes.&lt;/p&gt;

&lt;p&gt;So the ruleset is imported, and each rule keeps the ID it already has as its &lt;code&gt;ref&lt;/code&gt;, in the same order as in the dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;existing_rulesets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;http_response_headers_transform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;ruleset-id&amp;gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;response_headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;rule-id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"X-Frame-Options"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"X-Frame-Options"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"SAMEORIGIN"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;rule-id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Referrer-Policy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Referrer-Policy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"same-origin"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rule IDs come from &lt;code&gt;GET /zones/&amp;lt;zone-id&amp;gt;/rulesets/&amp;lt;ruleset-id&amp;gt;&lt;/code&gt;. These rules mattered more than we expected: one of them was silently replacing our website's CSP, a story for a separate article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Protect what must never be recreated
&lt;/h2&gt;

&lt;p&gt;A zone and a tunnel must never be recreated. A new tunnel gets a new ID and a new token: every &lt;code&gt;cloudflared&lt;/code&gt; running with the old token disconnects, and every CNAME pointing to &lt;code&gt;&amp;lt;old-id&amp;gt;.cfargotunnel.com&lt;/code&gt; breaks. Both carry &lt;code&gt;prevent_destroy&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"cloudflare_zero_trust_tunnel_cloudflared"&lt;/span&gt; &lt;span class="s2"&gt;"this"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;for_each&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tunnels&lt;/span&gt;
  &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;account_id&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;
  &lt;span class="n"&gt;config_src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"cloudflare"&lt;/span&gt;

  &lt;span class="n"&gt;lifecycle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;prevent_destroy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# a new tunnel means a new ID and token&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;-/+&lt;/code&gt; (replace) on anything in the plan is a reason to stop and read, not to type &lt;code&gt;yes&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Order matters once you start changing things. When we switched the zones to Full (strict), two hostnames still pointed at an old server with an expired self-signed certificate. They got temporary SSL exceptions as configuration rules, and the SSL setting &lt;code&gt;depends_on&lt;/code&gt; those rules and the tunnel records, so it is applied last and no host returns 526 halfway through the apply.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refactor with moved blocks
&lt;/h2&gt;

&lt;p&gt;On 29 November we moved kubmeta.com and www from a placeholder page served through our tunnel to Cloudflare Pages. In the module, tunnel hostnames and Pages domains are different resources: &lt;code&gt;cloudflare_dns_record.tunnel[...]&lt;/code&gt; and &lt;code&gt;cloudflare_dns_record.pages[...]&lt;/code&gt;. Without help, Terraform deletes one record and creates another, with no ordering between the two: the create can fail because the old CNAME still exists, or the site is left without a record for a moment.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;moved&lt;/code&gt; block tells Terraform it is the same record under a new address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;moved&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_dns_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tunnel&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"kubmeta.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_dns_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"kubmeta.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;moved&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_dns_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tunnel&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"www.kubmeta.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_dns_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"www.kubmeta.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The plan then shows an in-place update of the record's target, not a delete and a create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # cloudflare_dns_record.pages["kubmeta.com"] will be updated in-place
  # (moved from cloudflare_dns_record.tunnel["kubmeta.com"])
  ~ resource "cloudflare_dns_record" "pages" {
      ~ comment = "Cloudflare Tunnel" -&amp;gt; "Cloudflare Pages"
      ~ content = "&amp;lt;tunnel-id&amp;gt;.cfargotunnel.com" -&amp;gt; "&amp;lt;project&amp;gt;.pages.dev"
        name    = "kubmeta.com"
        # (unchanged attributes hidden)
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moves that belong to one zone live in that stack's generated file, next to the provider block. Moves that apply to every zone go into the module. When the shared Access policy became optional (&lt;code&gt;count&lt;/code&gt;), one &lt;code&gt;moved&lt;/code&gt; block in the module, from &lt;code&gt;...access_policy.owners&lt;/code&gt; to &lt;code&gt;...access_policy.owners[0]&lt;/code&gt;, covered every stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Records that other services create
&lt;/h2&gt;

&lt;p&gt;On 29 November we verified kubmeta.com in Google Search Console. It offers to do this through Cloudflare: you approve access, and it writes a TXT verification record into the zone through the API. Terraform knew nothing about it.&lt;/p&gt;

&lt;p&gt;Nothing breaks at that moment: Terraform ignores what it does not manage. The trouble comes later. Someone adds the record to the code, and a plain apply tries to create a duplicate, which the API rejects. Or someone cleans up the zone to match the code, and the domain loses its verification.&lt;/p&gt;

&lt;p&gt;We added the record to the config with a clear comment and imported it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="s2"&gt;"google-search-console"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;type&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TXT"&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"kubmeta.com"&lt;/span&gt;
  &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"\"google-site-verification=&amp;lt;token&amp;gt;\""&lt;/span&gt;
  &lt;span class="n"&gt;ttl&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;
  &lt;span class="n"&gt;comment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Google Search Console: domain verification (do not delete)"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; live/kubmeta/cloudflare
terragrunt import &lt;span class="s1"&gt;'cloudflare_dns_record.this["google-search-console"]'&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;zone-id&amp;gt;/&amp;lt;record-id&amp;gt;'&lt;/span&gt;
terragrunt plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A plan never shows records Terraform does not manage. To find them, compare the API's list with the state from time to time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terragrunt show -json \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.values.root_module.resources[] | select(.type == "cloudflare_dns_record") | .values.id'&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; sort &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; managed.txt
curl -s -H &lt;span class="s2"&gt;"Authorization: Bearer $CLOUDFLARE_API_TOKEN"&lt;/span&gt; \
  &lt;span class="s2"&gt;"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records?per_page=100"&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.result[].id'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; live.txt
comm -13 managed.txt live.txt   &lt;span class="c"&gt;# records that exist only in Cloudflare&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  After the import
&lt;/h2&gt;

&lt;p&gt;Once applied, import blocks do nothing for objects already in state. We deleted them anyway: they clutter the code and carry IDs nobody needs to read. The commit that removed them says it plainly: plan for all stacks, no changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] One Terraform token per provider, only the permissions it uses; extend it instead of adding tokens&lt;/li&gt;
&lt;li&gt;[ ] Remote state with locking (R2 and &lt;code&gt;use_lockfile&lt;/code&gt;) and a token scoped to the state bucket&lt;/li&gt;
&lt;li&gt;[ ] Import blocks for every existing object; target: &lt;code&gt;N to import, 0 to add, 0 to change, 0 to destroy&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Fix the code, not Cloudflare, until the plan is empty&lt;/li&gt;
&lt;li&gt;[ ] Existing rulesets imported by ID, rules keep their IDs as &lt;code&gt;ref&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;prevent_destroy&lt;/code&gt; on zones and tunnels; stop at any &lt;code&gt;-/+&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] A &lt;code&gt;moved&lt;/code&gt; block for every refactor&lt;/li&gt;
&lt;li&gt;[ ] Records created by other services: into the code, imported, marked "do not delete"&lt;/li&gt;
&lt;li&gt;[ ] One-time import blocks removed after the apply&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The import is the boring part, and that is the point: the account looks exactly the same afterwards. The benefit comes with the next change: a plan, a review and a commit instead of a click. If your Cloudflare setup has grown by hand and you want it in code without a maintenance window, &lt;a href="https://kubmeta.com/discuss/" rel="noopener noreferrer"&gt;tell us about it&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>cloudflare</category>
      <category>devops</category>
      <category>iac</category>
    </item>
    <item>
      <title>n8n in production: stage, prod, and why nobody edits workflows on prod</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Tue, 01 Dec 2026 13:09:19 +0000</pubDate>
      <link>https://dev.to/kubmeta/n8n-in-production-stage-prod-and-why-nobody-edits-workflows-on-prod-3if3</link>
      <guid>https://dev.to/kubmeta/n8n-in-production-stage-prod-and-why-nobody-edits-workflows-on-prod-3if3</guid>
      <description>&lt;p&gt;A typical first self-hosted n8n looks like this. There is one instance. The editor is open to the internet. The database is SQLite on a Docker volume, the image tag is &lt;code&gt;latest&lt;/code&gt;, and workflows are changed directly where they run. That works until someone saves a half-finished change to a live workflow, or an image update changes a setting overnight.&lt;/p&gt;

&lt;p&gt;This is how we run n8n for ourselves and for clients. There are two separate instances, stage and production, and each has its own database. The editor sits behind Cloudflare Access. Nothing listens on a public port. Every version is pinned, and a change reaches production only after it has run on stage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two environments, two compose files
&lt;/h2&gt;

&lt;p&gt;Stage and production are two Docker Compose projects with the same services: PostgreSQL, n8n, a container for Code node runners, and &lt;code&gt;cloudflared&lt;/code&gt;. Each one has its own project name, volumes, database and Cloudflare tunnel. They share nothing at runtime, so breaking stage cannot touch production.&lt;/p&gt;

&lt;p&gt;Both run from one Git repository. Production runs from a working copy on the &lt;code&gt;main&lt;/code&gt; branch, stage from a second working copy on the &lt;code&gt;stage&lt;/code&gt; branch (&lt;code&gt;git worktree&lt;/code&gt; makes this cheap). Each has its own file, &lt;code&gt;compose.prod.yml&lt;/code&gt; or &lt;code&gt;compose.stage.yml&lt;/code&gt;, and every command names it with &lt;code&gt;-f&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There is deliberately no &lt;code&gt;docker-compose.yml&lt;/code&gt;. Without &lt;code&gt;-f&lt;/code&gt;, &lt;code&gt;docker compose up&lt;/code&gt; finds no file and does nothing. That is inconvenient on purpose: nobody can recreate production from the stage working copy by typing a command in the wrong directory.&lt;/p&gt;

&lt;p&gt;Here is the production file, shortened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;n8n-prod&lt;/span&gt;                               &lt;span class="c1"&gt;# stage uses its own name: n8n-stage
&lt;/span&gt;
&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres:18.6-alpine&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${POSTGRES_PASSWORD}&lt;/span&gt;
      &lt;span class="na"&gt;N8N_DB_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${N8N_DB_PASSWORD}&lt;/span&gt;    &lt;span class="c1"&gt;# init script creates the n8n role and database
&lt;/span&gt;    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pg_data:/var/lib/postgresql&lt;/span&gt;          &lt;span class="c1"&gt;# Postgres 18: the volume goes here, not to .../data
&lt;/span&gt;      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./postgres/init.sh:/docker-entrypoint-initdb.d/init.sh:ro&lt;/span&gt;
    &lt;span class="na"&gt;healthcheck&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CMD-SHELL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pg_isready -U postgres"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5s&lt;/span&gt;
      &lt;span class="na"&gt;retries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

  &lt;span class="na"&gt;n8n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker.n8n.io/n8nio/n8n:2.48.7&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service_healthy&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;DB_TYPE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgresdb&lt;/span&gt;
      &lt;span class="na"&gt;DB_POSTGRESDB_HOST&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;
      &lt;span class="na"&gt;DB_POSTGRESDB_DATABASE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;n8n&lt;/span&gt;
      &lt;span class="na"&gt;DB_POSTGRESDB_USER&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;n8n&lt;/span&gt;
      &lt;span class="na"&gt;DB_POSTGRESDB_PASSWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${N8N_DB_PASSWORD}&lt;/span&gt;
      &lt;span class="na"&gt;N8N_ENCRYPTION_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${N8N_ENCRYPTION_KEY}&lt;/span&gt;
      &lt;span class="na"&gt;N8N_HOST&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;n8n.example.com&lt;/span&gt;
      &lt;span class="na"&gt;N8N_PROTOCOL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https&lt;/span&gt;
      &lt;span class="na"&gt;N8N_WEBHOOK_URL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://n8n.example.com/&lt;/span&gt;
      &lt;span class="na"&gt;N8N_PROXY_HOPS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt;                    &lt;span class="c1"&gt;# exactly one proxy in front: cloudflared
&lt;/span&gt;      &lt;span class="na"&gt;N8N_RUNNERS_MODE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;external&lt;/span&gt;             &lt;span class="c1"&gt;# Code nodes run in the n8n-runners container
&lt;/span&gt;      &lt;span class="na"&gt;N8N_RUNNERS_AUTH_TOKEN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${N8N_RUNNERS_AUTH_TOKEN}&lt;/span&gt;
      &lt;span class="na"&gt;N8N_RUNNERS_BROKER_LISTEN_ADDRESS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.0.0.0&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"127.0.0.1:5778:5678"&lt;/span&gt;                &lt;span class="c1"&gt;# local only; everyone else comes through the tunnel
&lt;/span&gt;    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;n8n_data:/home/node/.n8n&lt;/span&gt;

  &lt;span class="na"&gt;n8n-runners&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;n8nio/runners:2.48.7&lt;/span&gt;              &lt;span class="c1"&gt;# always the same version as n8n
&lt;/span&gt;    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;N8N_RUNNERS_TASK_BROKER_URI&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://n8n:5679&lt;/span&gt;
      &lt;span class="na"&gt;N8N_RUNNERS_AUTH_TOKEN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${N8N_RUNNERS_AUTH_TOKEN}&lt;/span&gt;

  &lt;span class="na"&gt;cloudflared&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cloudflare/cloudflared:2026.10.3&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tunnel --no-autoupdate run&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;TUNNEL_TOKEN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${CLOUDFLARE_TUNNEL_TOKEN}&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pg_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;n8n_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three of these settings matter more than they look:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;N8N_WEBHOOK_URL&lt;/code&gt;.&lt;/strong&gt; Without it, n8n builds webhook URLs from its own host and port, and external services get an address with &lt;code&gt;:5678&lt;/code&gt; that they cannot reach. Older guides use &lt;code&gt;WEBHOOK_URL&lt;/code&gt;, which is deprecated in n8n 2.x.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;N8N_PROXY_HOPS: "1"&lt;/code&gt;.&lt;/strong&gt; There is exactly one proxy in front of n8n, so n8n can trust the forwarded headers for the client address and protocol.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;N8N_RUNNERS_MODE: external&lt;/code&gt;.&lt;/strong&gt; Code nodes (JavaScript and Python) run in a separate &lt;code&gt;n8nio/runners&lt;/code&gt; container that has no access to the n8n database or volumes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  PostgreSQL instead of SQLite
&lt;/h2&gt;

&lt;p&gt;SQLite is the default, and it is fine for trying n8n. For anything a business depends on, we use PostgreSQL. &lt;code&gt;pg_dump&lt;/code&gt; takes a consistent backup while n8n keeps running, while with SQLite you copy a file that may be in the middle of a write. n8n gets its own role that owns only its own database. PostgreSQL is also the base for queue mode with Redis and separate workers, which we add when one n8n process is no longer enough.&lt;/p&gt;

&lt;p&gt;There are two pitfalls in the file above. First, Postgres 18 images expect the volume at &lt;code&gt;/var/lib/postgresql&lt;/code&gt;, not at &lt;code&gt;/var/lib/postgresql/data&lt;/code&gt; like older guides say. Second, n8n waits for the &lt;code&gt;pg_isready&lt;/code&gt; healthcheck, so after a reboot it does not start before the database accepts connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  No public ports: Cloudflare Tunnel
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;cloudflared&lt;/code&gt; opens an outbound connection to Cloudflare and receives the hostname's traffic through it. The server needs no inbound ports, no public IP and no certificate management, because TLS ends at Cloudflare. n8n itself is bound to &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We keep the tunnels, their routes and the DNS records in Terraform. The route list ends with a catch-all &lt;code&gt;http_status:404&lt;/code&gt;, so a hostname nobody configured never reaches a service. The tunnel resource has &lt;code&gt;prevent_destroy&lt;/code&gt;, because a recreated tunnel gets a new token and every &lt;code&gt;cloudflared&lt;/code&gt; using the old one stops connecting. And the DNS record that publishes a hostname depends on its Access application, so the address goes live only after the login is in front of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloudflare Access in front of the editor
&lt;/h2&gt;

&lt;p&gt;The whole hostname is behind a Cloudflare Access application. Before the n8n login page appears, Cloudflare asks for an email address and sends a one-time code. Only addresses on a short list get a code, and the session lasts 24 hours. After that comes the normal n8n login, so an attacker has to get past two different systems.&lt;/p&gt;

&lt;p&gt;Webhooks are the exception. Telegram or a payment provider cannot log in, and opening the whole hostname for them would also open the editor. Instead, each webhook path gets its own narrow hole: a separate Access application on that path, with a bypass policy limited to the sender's published IP ranges. In Access, the application with the more specific path wins over the one on the whole hostname. Our email policy stays second on the path, so we can still open it ourselves.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Telegram's webhook source ranges, from core.telegram.org/bots/webhooks&lt;/span&gt;
&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"cloudflare_zero_trust_access_policy"&lt;/span&gt; &lt;span class="s2"&gt;"telegram_webhook"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;account_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;account_id&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n8n: Telegram webhook without login"&lt;/span&gt;
  &lt;span class="n"&gt;decision&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"bypass"&lt;/span&gt;
  &lt;span class="n"&gt;include&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"149.154.160.0/20"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"91.108.4.0/22"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"cloudflare_zero_trust_access_application"&lt;/span&gt; &lt;span class="s2"&gt;"telegram_webhook"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;account_id&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;account_id&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;         &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n8n: Telegram webhook"&lt;/span&gt;
  &lt;span class="k"&gt;type&lt;/span&gt;         &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"self_hosted"&lt;/span&gt;
  &lt;span class="n"&gt;domain&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n8n.example.com/webhook"&lt;/span&gt;
  &lt;span class="n"&gt;destinations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;uri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"n8n.example.com/webhook"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;policies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_zero_trust_access_policy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;telegram_webhook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;precedence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cloudflare_zero_trust_access_policy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;precedence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We follow three rules for these holes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A bypass always has both paths and source IPs.&lt;/strong&gt; Our Terraform module refuses to plan a bypass with an empty IP list, because that would open the path to the whole internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The workflow still checks a secret.&lt;/strong&gt; Telegram sends the &lt;code&gt;X-Telegram-Bot-Api-Secret-Token&lt;/code&gt; header you set when registering the webhook, and n8n checks it. IP ranges are a filter, not authentication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If a sender does not publish its IP ranges&lt;/strong&gt;, the path has to stay open to everyone, and the workflow must verify a signature or a shared secret on every request.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Changes go through stage
&lt;/h2&gt;

&lt;p&gt;Our rule is that nobody edits a workflow on production. The editor is not the risk. The risk is what a change made there skips. The JSON in Git goes stale, and the next release from stage silently overwrites the edit. A test execution uses production credentials, so it sends real messages and writes real rows. And nobody else sees what changed or why.&lt;/p&gt;

&lt;p&gt;So a change goes the same way every time. We build or change the workflow on stage, where imported workflows are inactive by default and run by hand. When it works, we export it to JSON and commit it to the &lt;code&gt;stage&lt;/code&gt; branch. Then production takes exactly that commit, always with a fast-forward, so it never runs anything stage has not run first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# stage working copy, branch "stage": export the tested workflow into the repository&lt;/span&gt;
docker compose -f compose.stage.yml &lt;span class="nb"&gt;exec&lt;/span&gt; -T n8n \
  n8n export:workflow --id=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --output=/tmp/wf.json &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null
docker compose -f compose.stage.yml cp n8n:/tmp/wf.json workflows/orders-sync.json
git add workflows/orders-sync.json &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit -m &lt;span class="s2"&gt;"orders-sync: retry on 429"&lt;/span&gt;
git push origin stage

&lt;span class="c"&gt;# production working copy, branch "main": take exactly that commit, then import and publish&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /srv/n8n
git fetch origin &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git merge --ff-only origin/stage   &lt;span class="c"&gt;# refuses if main has anything stage lacks&lt;/span&gt;
docker compose -f compose.prod.yml cp workflows/orders-sync.json n8n:/tmp/wf.json
docker compose -f compose.prod.yml &lt;span class="nb"&gt;exec&lt;/span&gt; -T n8n n8n import:workflow --input=/tmp/wf.json &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null
docker compose -f compose.prod.yml &lt;span class="nb"&gt;exec&lt;/span&gt; -T n8n n8n publish:workflow --id=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exported JSON keeps the workflow ID, so the import replaces the workflow instead of creating a copy. &lt;code&gt;-T&lt;/code&gt; and &lt;code&gt;&amp;lt;/dev/null&lt;/code&gt; make &lt;code&gt;docker compose exec&lt;/code&gt; behave in a script the same way it does in a terminal.&lt;/p&gt;

&lt;p&gt;Two things to decide up front:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Credentials.&lt;/strong&gt; Our stage and production share &lt;code&gt;N8N_ENCRYPTION_KEY&lt;/code&gt;, so credentials can move between them. The trade-off is that stage becomes as sensitive as production, so it sits behind the same Access policy. Where an API offers read-only keys, stage gets those.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared rate limits.&lt;/strong&gt; When stage and production call the same API with the same account, they share its limits. In our marketplace analytics project, stage workflows never run on a schedule, only by hand and outside the minutes when production collects data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One change is fine to make directly on production: switching a broken workflow off. The fix then goes through stage like everything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pinned versions and an upgrade routine
&lt;/h2&gt;

&lt;p&gt;Every image has an exact tag: &lt;code&gt;n8n:2.48.7&lt;/code&gt;, &lt;code&gt;runners:2.48.7&lt;/code&gt;, &lt;code&gt;postgres:18.6-alpine&lt;/code&gt;, &lt;code&gt;cloudflared:2026.10.3&lt;/code&gt;. Never &lt;code&gt;latest&lt;/code&gt;, and &lt;code&gt;cloudflared&lt;/code&gt; runs with &lt;code&gt;--no-autoupdate&lt;/code&gt;. An upgrade is a commit, and it goes through stage like a workflow change:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Read the release notes&lt;/strong&gt; between the two versions, looking for breaking changes and renamed settings. On our last upgrade, from 2.46.6 to 2.48.7, the same commit replaced &lt;code&gt;WEBHOOK_URL&lt;/code&gt; with &lt;code&gt;N8N_WEBHOOK_URL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bump n8n and the runners together on stage.&lt;/strong&gt; They must run the same version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare the runner config with the new image.&lt;/strong&gt; By default, the runner allows only &lt;code&gt;crypto&lt;/code&gt; and &lt;code&gt;moment&lt;/code&gt; in JavaScript and no modules in Python. Our mounted &lt;code&gt;task-runners.json&lt;/code&gt; widens that allowlist and must match the image in everything else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the smoke test.&lt;/strong&gt; It executes a small workflow with one JavaScript and one Python Code node and fails unless both produce output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the real workflows on stage&lt;/strong&gt;, including webhooks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Release to production:&lt;/strong&gt; take a fresh backup, fast-forward &lt;code&gt;main&lt;/code&gt;, and run &lt;code&gt;docker compose -f compose.prod.yml up -d&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# step 3: the launcher config shipped in the new runner image vs ours&lt;/span&gt;
diff &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;docker run --rm --entrypoint cat n8nio/runners:2.48.7 /etc/n8n-task-runners.json&lt;span class="o"&gt;)&lt;/span&gt; \
     n8n/task-runners.json
&lt;span class="c"&gt;# step 4&lt;/span&gt;
tools/smoke-test.sh stage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only one environment changes at a time. If the new version breaks something, production is still on the old one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backups
&lt;/h2&gt;

&lt;p&gt;Every night, production gets a &lt;code&gt;pg_dump&lt;/code&gt; of the n8n database and a copy of &lt;code&gt;.env&lt;/code&gt; with the encryption key, kept for 14 days. An encrypted copy goes offsite, and we test that it restores. The full setup, scripts included, is in &lt;a href="https://kubmeta.com/blog/n8n-backups-r2/" rel="noopener noreferrer"&gt;Offsite backups for self-hosted n8n&lt;/a&gt;. Stage is not in the nightly backup, and its workflows are in Git anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Stage and production each have their own compose file, project name, database, volumes and tunnel&lt;/li&gt;
&lt;li&gt;[ ] There is no default compose file, and every command has &lt;code&gt;-f&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] PostgreSQL, with a healthcheck that n8n waits for&lt;/li&gt;
&lt;li&gt;[ ] n8n is bound to &lt;code&gt;127.0.0.1&lt;/code&gt;, and public traffic comes only through Cloudflare Tunnel&lt;/li&gt;
&lt;li&gt;[ ] Access covers the whole hostname, and webhook paths are open only to the sender's IP ranges, with a secret checked in the workflow&lt;/li&gt;
&lt;li&gt;[ ] Workflows live in Git, are built on stage, and reach production by fast-forward&lt;/li&gt;
&lt;li&gt;[ ] Every image has an exact tag, and upgrades go to stage first, with a smoke test&lt;/li&gt;
&lt;li&gt;[ ] Nightly backups, an offsite copy and a restore test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is complicated, and most of it is a few lines of configuration. What makes it work is that production only ever runs what stage has already run.&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>devops</category>
      <category>docker</category>
      <category>cloudflare</category>
    </item>
    <item>
      <title>Offsite backups for self-hosted n8n: restic, Cloudflare R2 and a restore test</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Sun, 29 Nov 2026 20:58:30 +0000</pubDate>
      <link>https://dev.to/kubmeta/offsite-backups-for-self-hosted-n8n-restic-cloudflare-r2-and-a-restore-test-57e4</link>
      <guid>https://dev.to/kubmeta/offsite-backups-for-self-hosted-n8n-restic-cloudflare-r2-and-a-restore-test-57e4</guid>
      <description>&lt;p&gt;Self-hosting n8n is cheap and gives you full control over your data. It also makes you responsible for the part a cloud plan quietly does for you: backups. Most self-hosted setups we see have one of three problems. There is no backup at all. The backup sits on the same disk as the data. Or there is a backup nobody has ever tried to restore.&lt;/p&gt;

&lt;p&gt;This is the setup we use for our own n8n instances and for clients: a nightly local dump, an encrypted offsite copy in Cloudflare R2, a Telegram message when anything goes wrong, and a restore test that proves the copy is usable. It runs on a single server with Docker Compose and costs close to nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually needs a backup
&lt;/h2&gt;

&lt;p&gt;An n8n instance is more than its workflows. To bring it back on a new machine you need three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The database.&lt;/strong&gt; Workflows, credentials, users, tags, variables and execution history all live there. With PostgreSQL that is one &lt;code&gt;pg_dump&lt;/code&gt;. With the default SQLite it is the &lt;code&gt;database.sqlite&lt;/code&gt; file in the n8n data folder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The encryption key.&lt;/strong&gt; n8n encrypts every saved credential with &lt;code&gt;N8N_ENCRYPTION_KEY&lt;/code&gt;. If you did not set it yourself, n8n generated one and stored it in &lt;code&gt;/home/node/.n8n/config&lt;/code&gt; inside the container volume. Restore the database without this key and every credential is unreadable: you will be re-entering API keys and OAuth connections by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your environment file.&lt;/strong&gt; The &lt;code&gt;.env&lt;/code&gt; with database passwords, the encryption key, webhook URL and other settings. Without it you will rebuild the configuration from memory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you store binary data on the filesystem (&lt;code&gt;N8N_DEFAULT_BINARY_DATA_MODE=filesystem&lt;/code&gt;), add the binary data folder too.&lt;/p&gt;

&lt;p&gt;Workflow JSON exports in git are nice for reviewing changes, but they are not a backup: they do not include credentials, users or the key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: a nightly local dump
&lt;/h2&gt;

&lt;p&gt;A small script next to the Compose file, started by cron at night:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# Nightly n8n backup: database dump and the .env with the encryption key. Keeps 14 days.&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail
&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"$(dirname "&lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;")"&lt;/span&gt;

&lt;span class="nb"&gt;umask&lt;/span&gt; 077                                   &lt;span class="c"&gt;# backups are readable only by the owner&lt;/span&gt;
&lt;span class="nv"&gt;dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"backups/$(date +%F)"&lt;/span&gt;
mkdir -p &lt;span class="s2"&gt;"$dir"&lt;/span&gt;

docker compose -f compose.prod.yml &lt;span class="nb"&gt;exec&lt;/span&gt; -T postgres \
  pg_dump -U postgres -Fc n8n &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"$dir/n8n.dump"&lt;/span&gt;
cp .env &lt;span class="s2"&gt;"$dir/env.backup"&lt;/span&gt;

find backups -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt; +
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"$(date '+%F %T') ok: $(du -sh "&lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="s2"&gt;" | cut -f1)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three details that save time later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-T&lt;/code&gt; and &lt;code&gt;&amp;lt;/dev/null&lt;/code&gt; on &lt;code&gt;docker compose exec&lt;/code&gt;. Without them the command behaves differently under cron than in your terminal, and it can swallow the rest of a script's input.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-Fc&lt;/code&gt; writes PostgreSQL's custom format: compressed, and &lt;code&gt;pg_restore&lt;/code&gt; can restore it into an existing database with &lt;code&gt;--clean&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;umask 077&lt;/code&gt;, because the dump contains encrypted credentials and the &lt;code&gt;.env&lt;/code&gt; contains the key to decrypt them.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;40 3 * * * /srv/n8n/backup.sh &amp;gt;&amp;gt; /srv/n8n/backups/backup.log 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This protects you from a broken upgrade or a deleted workflow. It does not protect you from a dead disk, a lost server or a compromised machine. For that you need a copy somewhere else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: an encrypted copy in Cloudflare R2
&lt;/h2&gt;

&lt;p&gt;We use &lt;a href="https://restic.net/" rel="noopener noreferrer"&gt;restic&lt;/a&gt; for the offsite copy and Cloudflare R2 as storage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;restic encrypts on your server&lt;/strong&gt; before anything leaves it. R2 only ever sees encrypted blobs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deduplication.&lt;/strong&gt; Nightly dumps of the same database share most of their data, so 30 days of history take far less than 30 full copies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;R2 has no egress fees&lt;/strong&gt;, so a full restore does not come with a surprise bill. The free tier includes 10 GB of storage, which is plenty for most n8n instances.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the Cloudflare dashboard, create an R2 bucket and an API token with &lt;em&gt;Object Read &amp;amp; Write&lt;/em&gt; for that bucket only. Then restic needs four variables. Keep them out of git: in a root-only file, a password manager or SOPS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...                &lt;span class="c"&gt;# R2 token&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;AWS_DEFAULT_REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto              &lt;span class="c"&gt;# R2 uses "auto" instead of a region&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RESTIC_REPOSITORY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"s3:https://&amp;lt;account-id&amp;gt;.r2.cloudflarestorage.com/&amp;lt;bucket&amp;gt;/restic"&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RESTIC_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...                  &lt;span class="c"&gt;# long random string, see the warning below&lt;/span&gt;
restic init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Store &lt;code&gt;RESTIC_PASSWORD&lt;/code&gt; in a second place, such as a password manager. It is the only way to decrypt the repository. If it is lost, so are all the backups.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The offsite script runs after the local dump. Before uploading, it checks that today's dump exists and is not empty. Without this check, a silently failing cron job would upload yesterday's data every night and you would never notice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -uo pipefail
&lt;span class="nb"&gt;source&lt;/span&gt; /etc/n8n-backup.env                  &lt;span class="c"&gt;# the variables above + TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID; chmod 600&lt;/span&gt;
&lt;span class="nv"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/srv/n8n/backups
&lt;span class="nv"&gt;today&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;date +%F&lt;span class="o"&gt;)&lt;/span&gt;

notify&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;                                  &lt;span class="c"&gt;# Telegram message; the token goes through stdin, not argv&lt;/span&gt;
  &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'url = "https://api.telegram.org/bot%s/sendMessage"\n'&lt;/span&gt; &lt;span class="s2"&gt;"$TELEGRAM_BOT_TOKEN"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
    curl -s -m 20 -o /dev/null -K - --data-urlencode &lt;span class="s2"&gt;"chat_id=$TELEGRAM_CHAT_ID"&lt;/span&gt; --data-urlencode &lt;span class="s2"&gt;"text=$1"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
fail&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; notify &lt;span class="s2"&gt;"❌ n8n offsite backup: $1"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

find &lt;span class="s2"&gt;"$src/$today"&lt;/span&gt; -name &lt;span class="s1"&gt;'*.dump'&lt;/span&gt; -size +0 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;|&lt;/span&gt; grep -q . &lt;span class="o"&gt;||&lt;/span&gt; fail &lt;span class="s2"&gt;"no local dump for $today"&lt;/span&gt;

restic backup --quiet --tag n8n &lt;span class="s2"&gt;"$src"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; fail &lt;span class="s2"&gt;"restic backup failed"&lt;/span&gt;
restic forget --quiet --tag n8n --keep-daily 14 --keep-weekly 8 --keep-monthly 12 --prune \
  &lt;span class="o"&gt;||&lt;/span&gt; fail &lt;span class="s2"&gt;"cleanup of old snapshots failed"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"$(date +%u)"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 7 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;           &lt;span class="c"&gt;# on Sundays: verify 10% of the stored data&lt;/span&gt;
  restic check --quiet --read-data-subset=10% &lt;span class="o"&gt;||&lt;/span&gt; fail &lt;span class="s2"&gt;"restic check: repository damaged"&lt;/span&gt;
  notify &lt;span class="s2"&gt;"✅ n8n offsite backups OK: $(restic snapshots --json | jq length) snapshots"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The retention policy keeps two weeks of daily snapshots, two months of weekly ones and a year of monthly ones. Thanks to deduplication this is still small.&lt;/p&gt;

&lt;p&gt;Silence means success, and any failure sends a message. The weekly "OK" message matters as much as the failure alerts: if it stops arriving, the backup job itself is broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: prove that it restores
&lt;/h2&gt;

&lt;p&gt;A backup is a hypothesis until you restore it. We test at two levels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weekly, automatically:&lt;/strong&gt; restore the latest snapshot into a temporary folder and compare checksums with the local files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;mktemp -d&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;trap&lt;/span&gt; &lt;span class="s1"&gt;'rm -rf "$tmp"'&lt;/span&gt; EXIT
restic restore latest --quiet --tag n8n --target &lt;span class="s2"&gt;"$tmp"&lt;/span&gt;
&lt;span class="nv"&gt;last&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;ls &lt;span class="s2"&gt;"$tmp/srv/n8n/backups"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; grep -E &lt;span class="s1"&gt;'^[0-9]{4}-'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort &lt;span class="o"&gt;|&lt;/span&gt; tail -1&lt;span class="o"&gt;)&lt;/span&gt;
diff &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"$tmp/srv/n8n/backups/$last"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sha256sum -- * &lt;span class="o"&gt;|&lt;/span&gt; sort&lt;span class="o"&gt;)&lt;/span&gt; \
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"/srv/n8n/backups/$last"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sha256sum -- * &lt;span class="o"&gt;|&lt;/span&gt; sort&lt;span class="o"&gt;)&lt;/span&gt; \
  &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"restore OK: $last"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"MISMATCH in $last"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Every few months, by hand:&lt;/strong&gt; a real restore into a throwaway n8n. Start an empty stack with the same image version and the restored &lt;code&gt;.env&lt;/code&gt;, then load the dump:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose -f compose.test.yml up -d postgres
docker compose -f compose.test.yml &lt;span class="nb"&gt;exec&lt;/span&gt; -T postgres \
  pg_restore -U postgres -d n8n --clean --if-exists &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; n8n.dump
docker compose -f compose.test.yml up -d n8n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log in, open a workflow that uses credentials and run a step. If the credential works, the encryption key and the database belong together, and your backup is real. Write down how long this took: that is your actual recovery time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this costs
&lt;/h2&gt;

&lt;p&gt;For a typical small instance with a few hundred megabytes of database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;R2 storage stays within the free tier.&lt;/li&gt;
&lt;li&gt;restic and cron are free and run on the same server.&lt;/li&gt;
&lt;li&gt;Setting it up takes an afternoon.&lt;/li&gt;
&lt;li&gt;Maintenance comes down to reading the weekly Telegram message.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] &lt;code&gt;N8N_ENCRYPTION_KEY&lt;/code&gt; is set explicitly and stored outside the server&lt;/li&gt;
&lt;li&gt;[ ] Nightly &lt;code&gt;pg_dump&lt;/code&gt; (or SQLite copy) plus &lt;code&gt;.env&lt;/code&gt;, kept for at least 14 days&lt;/li&gt;
&lt;li&gt;[ ] Encrypted offsite copy in a different provider or region&lt;/li&gt;
&lt;li&gt;[ ] The restic password is stored in a second place&lt;/li&gt;
&lt;li&gt;[ ] Alerts on failure and a weekly "OK" message&lt;/li&gt;
&lt;li&gt;[ ] An automatic restore check, plus a full restore test every few months&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your n8n runs workflows the business depends on, this afternoon of work is the cheapest insurance you will buy this year.&lt;/p&gt;

</description>
      <category>n8n</category>
      <category>devops</category>
      <category>backup</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>A zero-trust service mesh in 3 months: Istio ambient mode as a self-service building block</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Sun, 15 Nov 2026 08:40:52 +0000</pubDate>
      <link>https://dev.to/mher_poghosyan/a-zero-trust-service-mesh-in-3-months-istio-ambient-mode-as-a-self-service-building-block-561f</link>
      <guid>https://dev.to/mher_poghosyan/a-zero-trust-service-mesh-in-3-months-istio-ambient-mode-as-a-self-service-building-block-561f</guid>
      <description>&lt;p&gt;A regulated launch in New Jersey needed every service-to-service connection encrypted and mutually authenticated. The requirement had been open for a year and a half. I joined the team to close it, and three months later the mesh was ready as a building block: any team joins in about ten minutes, without changing a line of application code.&lt;/p&gt;

&lt;p&gt;Here is how it is built, the details that decided whether it worked, and a clean-room reference implementation: &lt;a href="https://github.com/devopsmher/istio-ambient-building-block" rel="noopener noreferrer"&gt;github.com/devopsmher/istio-ambient-building-block&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The requirement in engineering terms
&lt;/h3&gt;

&lt;p&gt;The launch fell under New Jersey’s internet gaming rules and the GLI-19 standard. For the platform that meant four things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every connection&lt;/strong&gt; between services encrypted and mutually authenticated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deny by default&lt;/strong&gt; : a service talks only to callers that are explicitly allowed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No bypass&lt;/strong&gt; : plain-text traffic must not reach a workload, even from inside the cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence&lt;/strong&gt; : something an auditor can check, and that we can re-check after every change.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why ambient mode
&lt;/h3&gt;

&lt;p&gt;The classic Istio data plane puts a sidecar proxy into every pod. That works, but for dozens of teams it turns the mesh into an application change: sidecar injection, rolling restarts, extra CPU and memory in every pod, and every team in the critical path.&lt;/p&gt;

&lt;p&gt;Ambient mode moves the proxy out of the pod:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ztunnel&lt;/strong&gt; , one per node, carries mTLS for every pod of an enrolled namespace and enforces L4 authorization by workload identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Waypoints&lt;/strong&gt; add L7 features (HTTP authorization, retries, header routing) only for the namespaces that need them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Joining is a label&lt;/strong&gt; : istio.io/dataplane-mode=ambient on the namespace. Leaving is removing it. No restarts in either direction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That made the mesh an infrastructure change, owned by the platform, instead of a migration that every team had to schedule.&lt;/p&gt;

&lt;h3&gt;
  
  
  The pieces
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Terraform module (istio_enabled)
  └─ istiod · istio-cni · ztunnel · STRICT mTLS · shared Gateway · Kiali
Team values file → Argo CD ApplicationSet
  ├─ mesh-namespace : ambient label · default-deny · allow rules · NetworkPolicy
  ├─ mesh-routes : Gateway API HTTPRoutes to the shared gateway
  └─ mesh-egress : external hosts as ServiceEntries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whole mesh sits behind one Terraform feature flag, istio_enabled, off by default. Turning it on installs Istio and changes nothing for running workloads: namespaces still opt in one by one.&lt;/p&gt;

&lt;p&gt;North-south traffic uses the Kubernetes Gateway API: one shared Gateway, and an HTTPRoute per team route. The same resources work with other Gateway API implementations, so teams learn one model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two layers of defense
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Identity.&lt;/strong&gt; Every workload has a SPIFFE identity such as cluster.local/ns/orders/sa/checkout. Each team namespace starts with a default-deny policy and allows only the callers listed in its values file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;allowFrom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payments&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;istio-ingress&lt;/span&gt;
    &lt;span class="na"&gt;serviceAccounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;public-istio&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;orders&lt;/span&gt;
    &lt;span class="na"&gt;serviceAccounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;checkout&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Transport.&lt;/strong&gt; A mesh-wide PeerAuthentication enforces STRICT mTLS, and a NetworkPolicy in every enrolled namespace admits only mesh traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15008&lt;/span&gt; &lt;span class="c1"&gt;# HBONE: the mTLS tunnel between ztunnels
&lt;/span&gt;        &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ipBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;cidr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;169.254.7.127/32&lt;/span&gt; &lt;span class="c1"&gt;# kubelet probes, IPv4
&lt;/span&gt;      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;ipBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;cidr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fd16:9254:7127:1337:ffff:ffff:ffff:ffff/128&lt;/span&gt; &lt;span class="c1"&gt;# kubelet probes, IPv6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Istio decides who may connect; the CNI (Calico in our case) makes sure nothing reaches a pod around the mesh.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-service onboarding
&lt;/h3&gt;

&lt;p&gt;A team writes one values file and opens a pull request. CI renders the three charts with it and validates the result against the Kubernetes, Istio and Gateway API schemas, so a typo fails in the pull request, not in the cluster. After the merge, an Argo CD ApplicationSet creates the team’s Application, and within minutes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the namespace is in ambient mode;&lt;/li&gt;
&lt;li&gt;default-deny and the allow rules are in force;&lt;/li&gt;
&lt;li&gt;the routes are attached to the shared gateway;&lt;/li&gt;
&lt;li&gt;the external hosts are registered as ServiceEntries.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Leaving the mesh is the same file with enrolled: false. In the reference implementation the team namespace is also protected from deletion: it carries helm.sh/resource-policy: keep and an Argo CD Delete=false sync option, because a mistake in a GitOps repository should never delete a team's workloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  A validation plan as a deliverable
&lt;/h3&gt;

&lt;p&gt;Before the first team joined, I wrote a validation plan: a table of scenarios, each with a command and an expected result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ingress through the shared gateway;&lt;/li&gt;
&lt;li&gt;a route from a namespace that is not allowed to attach to the gateway;&lt;/li&gt;
&lt;li&gt;east-west traffic from an allowed caller and from an unknown one;&lt;/li&gt;
&lt;li&gt;plain text from outside the mesh;&lt;/li&gt;
&lt;li&gt;egress to an external API and to an external database;&lt;/li&gt;
&lt;li&gt;health probes after enrolment;&lt;/li&gt;
&lt;li&gt;the same checks through a waypoint;&lt;/li&gt;
&lt;li&gt;rollback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It became the most useful document of the project: we ran it after the PoC and before handing the mesh over, it is the checklist for every upgrade, and its output is exactly the evidence an auditor asks for.&lt;/p&gt;

&lt;h3&gt;
  
  
  Details that decide whether it works
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;NetworkPolicy and ambient.&lt;/strong&gt; Mesh traffic arrives on port 15008, and kubelet probes come from fixed link-local addresses after istio-cni rewrites them. Allow both families of probe addresses, or pods go unready the moment they join the mesh.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Waypoints change who the caller is.&lt;/strong&gt; With a waypoint, ztunnel sees the waypoint’s identity, not the original client’s. Put the caller rules on the waypoint, and let ztunnel admit only the waypoint, so nothing can skip it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ingress bypasses waypoints by default.&lt;/strong&gt; Label the namespace with istio.io/ingress-use-waypoint=true and enable ENABLE_INGRESS_WAYPOINT_ROUTING in istiod; otherwise ingress traffic misses the L7 policy, and a ztunnel that admits only the waypoint rejects it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egress is explicit.&lt;/strong&gt; Every external API and database gets a ServiceEntry visible only in its namespace. Databases speak TCP, so test them separately from HTTPS APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No big bang.&lt;/strong&gt; A feature flag for the cluster, an opt-in label per namespace and a one-line rollback made it possible to start with one team and grow without a freeze.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin versions.&lt;/strong&gt; One Istio minor version at a time, the Gateway API CRDs that this Istio release documents, and the validation plan after every upgrade.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Observability and handover
&lt;/h3&gt;

&lt;p&gt;The mesh came with Kiali behind single sign-on, Istio dashboards in the shared Grafana, tracing through waypoints and gateways, and alerts with short runbooks, for example: istiod unavailable, ztunnel not ready on a node, a spike of denied connections, 5xx growth at the gateway.&lt;/p&gt;

&lt;p&gt;At the end, I wrote the HOWTO and handed the mesh over to the platform team as a ready building block.&lt;/p&gt;

&lt;h3&gt;
  
  
  Results
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The service mesh the launch had been waiting for 1.5 years, &lt;strong&gt;delivered in 3 months&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;About ten minutes&lt;/strong&gt; for a team to join, with no application code changes.&lt;/li&gt;
&lt;li&gt;STRICT mTLS and default-deny across the mesh, with a validation plan as evidence.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;The reference implementation is on GitHub: &lt;a href="https://github.com/devopsmher/istio-ambient-building-block" rel="noopener noreferrer"&gt;devopsmher/istio-ambient-building-block&lt;/a&gt;. It is a clean-room rewrite of the pattern with no code from the original project: the Terraform module behind the feature flag, the three team charts with JSON schemas, the Argo CD ApplicationSet, the validation plan and the runbooks. Everything renders and validates in CI without a cluster.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Mher Poghosyan is a Senior DevOps &amp;amp; Platform Engineer in Yerevan, Armenia. He builds Kubernetes platforms on AWS and GCP.&lt;/em&gt; &lt;a href="https://www.linkedin.com/in/mher-poghosyan/" rel="noopener noreferrer"&gt;&lt;em&gt;LinkedIn&lt;/em&gt;&lt;/a&gt; &lt;em&gt;·&lt;/em&gt; &lt;a href="https://github.com/devopsmher" rel="noopener noreferrer"&gt;&lt;em&gt;GitHub&lt;/em&gt;&lt;/a&gt; _· &lt;em&gt;[_Medium&lt;/em&gt;](&lt;a href="https://medium.com/@mher.poghosyan" rel="noopener noreferrer"&gt;https://medium.com/@mher.poghosyan&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>istio</category>
      <category>kubernetes</category>
      <category>calico</category>
      <category>servicemesh</category>
    </item>
    <item>
      <title>From 2–3 days to 30 minutes: an internal IaC platform with Terragrunt stacks</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Sat, 14 Nov 2026 22:59:00 +0000</pubDate>
      <link>https://dev.to/mher_poghosyan/from-2-3-days-to-30-minutes-an-internal-iac-platform-with-terragrunt-stacks-4ibi</link>
      <guid>https://dev.to/mher_poghosyan/from-2-3-days-to-30-minutes-an-internal-iac-platform-with-terragrunt-stacks-4ibi</guid>
      <description>&lt;p&gt;A new team needed an AWS environment: an account baseline, a VPC, DNS, an EKS cluster, GitOps, monitoring, security settings. A DevOps engineer spent two to three days on it: copying folders from another team's live repository, renaming things, hunting for the one value that was different last time.&lt;/p&gt;

&lt;p&gt;Today the same team writes about fifteen lines, opens a pull request and has a working environment about thirty minutes after the merge. Most of that time is EKS creating its control plane.&lt;/p&gt;

&lt;p&gt;Here is how the platform is built, what I learned while building it, and a clean-room reference implementation you can read and run: &lt;a href="https://github.com/devopsmher/terragrunt-platform" rel="noopener noreferrer"&gt;github.com/devopsmher/terragrunt-platform&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where we started
&lt;/h2&gt;

&lt;p&gt;The company had more than seventy DevOps engineers spread across domain teams. Every team had its own Terraform, and most of it had been copied from another team at some point.&lt;/p&gt;

&lt;p&gt;That worked until it didn't:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Copies drifted.&lt;/strong&gt; Two environments built from "the same" code had different subnet layouts, different tags, different IAM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modules floated.&lt;/strong&gt; &lt;code&gt;ref=main&lt;/code&gt; was common, so a change in a shared module reached production on the next plan, unreviewed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bootstrap was manual.&lt;/strong&gt; State buckets, CI credentials, DNS delegation: a checklist in someone's head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reviews were useless.&lt;/strong&gt; When every environment is a few thousand lines of copied code, nobody reads the diff.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I wanted instead
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Self-service.&lt;/strong&gt; A team describes what it needs; it does not write Terraform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The same result every time.&lt;/strong&gt; One definition of "a team environment", not twenty variations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versioned and reviewable.&lt;/strong&gt; Every change to an environment is a small diff with a plan attached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure by default.&lt;/strong&gt; No long-lived keys in CI, no "admin because it was easier".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Four layers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;live repository  →  stack  →  units  →  modules  →  AWS
  values only       composition  contracts  Terraform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Modules&lt;/strong&gt; are plain Terraform. Mostly thin wrappers over well-known modules from &lt;code&gt;terraform-aws-modules&lt;/code&gt;, pinned to exact versions, with our defaults on top: tags, subnet layout, access rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Units&lt;/strong&gt; wrap one module each and add a contract: which values the unit needs, which outputs it gives, which other units it depends on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stacks&lt;/strong&gt; compose units into a product. In the reference implementation that product is &lt;code&gt;team-environment&lt;/code&gt;: account baseline, network, DNS and EKS with Karpenter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live repositories&lt;/strong&gt; belong to domain teams. They hold values and a pinned release, nothing else.&lt;/p&gt;

&lt;p&gt;This is a whole environment from the team's side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;stack&lt;/span&gt; &lt;span class="s2"&gt;"platform"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"${local.catalog}//stacks/team-environment?ref=${local.version}"&lt;/span&gt;
  &lt;span class="n"&gt;path&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"platform"&lt;/span&gt;

  &lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;catalog&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;catalog&lt;/span&gt;
    &lt;span class="n"&gt;version&lt;/span&gt;            &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
    &lt;span class="n"&gt;team&lt;/span&gt;               &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"payments"&lt;/span&gt;
    &lt;span class="n"&gt;environment&lt;/span&gt;        &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"dev"&lt;/span&gt;
    &lt;span class="n"&gt;cidr&lt;/span&gt;               &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.20.0.0/16"&lt;/span&gt;
    &lt;span class="n"&gt;zone_name&lt;/span&gt;          &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"payments-dev.example.com"&lt;/span&gt;
    &lt;span class="n"&gt;kubernetes_version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"1.35"&lt;/span&gt;
    &lt;span class="n"&gt;github_repository&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"example-org/payments-live"&lt;/span&gt;
    &lt;span class="n"&gt;state_bucket&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tfstate-${local.env.locals.account_id}-${local.env.locals.region}"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Terragrunt stacks made this possible without a custom generator: &lt;code&gt;terragrunt stack generate&lt;/code&gt; expands the stack into units, and &lt;code&gt;terragrunt stack run plan&lt;/code&gt; runs them in dependency order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contracts between layers
&lt;/h2&gt;

&lt;p&gt;The most useful decision was to treat every boundary as a contract and write it down where people look first: at the top of the unit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Unit: eks — cluster, system node group and Karpenter with interruption handling.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# Contract&lt;/span&gt;
&lt;span class="c1"&gt;#   values in : catalog, version, name, kubernetes_version, network_path, account_baseline_path, tags&lt;/span&gt;
&lt;span class="c1"&gt;#   needs     : network.vpc_id, network.private_subnet_ids, network.intra_subnet_ids,&lt;/span&gt;
&lt;span class="c1"&gt;#               account_baseline.apply_role_arn&lt;/span&gt;
&lt;span class="c1"&gt;#   outputs   : cluster_name, cluster_endpoint, oidc_provider_arn, karpenter_queue_name, ...&lt;/span&gt;

&lt;span class="n"&gt;dependency&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;config_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;network_path&lt;/span&gt;

  &lt;span class="n"&gt;mock_outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;vpc_id&lt;/span&gt;             &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"vpc-00000000000000000"&lt;/span&gt;
    &lt;span class="n"&gt;private_subnet_ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"subnet-00000000000000001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"subnet-00000000000000002"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"subnet-00000000000000003"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;intra_subnet_ids&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"subnet-00000000000000004"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"subnet-00000000000000005"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"subnet-00000000000000006"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;mock_outputs_allowed_terraform_commands&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"init"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"validate"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"plan"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three things make the contract real rather than decorative:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Missing values fail early.&lt;/strong&gt; A stack that forgets a value fails at generation time, not twenty minutes into an apply.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mock outputs only for planning.&lt;/strong&gt; A brand-new environment can be planned before its VPC exists, but mocks are never allowed for &lt;code&gt;apply&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict input validation in CI.&lt;/strong&gt; &lt;code&gt;terragrunt hcl validate --inputs --strict&lt;/code&gt; fails if a unit passes an input its module does not declare, or misses one it needs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Renaming an output is a breaking change, and the version number says so.&lt;/p&gt;

&lt;h2&gt;
  
  
  Versions and release discipline
&lt;/h2&gt;

&lt;p&gt;The catalog (modules, units and stacks) is released together under one semver tag:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MAJOR&lt;/strong&gt;: a breaking contract change or a resource replacement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MINOR&lt;/strong&gt;: a new optional value or a new unit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PATCH&lt;/strong&gt;: a fix that changes no contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Live repositories pin an exact tag. An upgrade is a one-line pull request: &lt;code&gt;dev&lt;/code&gt; first, read the plan, then &lt;code&gt;prod&lt;/code&gt;. A small script in CI rejects anything that floats: branches, missing refs, version ranges for registry modules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./live/payments/dev/terragrunt.stack.hcl:6: version is not a release tag (vX.Y.Z)
./units/dns/terragrunt.hcl:12: source is not pinned with ?ref=${values.version}
./modules/network/main.tf:21: module version is not exact (X.Y.Z)
pinning check failed: see the lines above
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It sounds strict. In practice it removed a whole class of "nobody changed anything, but the plan is different" incidents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan in the pull request, apply after merge, no keys
&lt;/h2&gt;

&lt;p&gt;CI has no AWS keys. Every account gets two roles from the &lt;code&gt;account-baseline&lt;/code&gt; unit, and GitHub Actions exchanges its OIDC token for short-lived credentials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plan role&lt;/strong&gt;: read-only, trusted for pull requests of the team's live repository. With S3 native locking it can still write the &lt;code&gt;.tflock&lt;/code&gt; file it needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply role&lt;/strong&gt;: trusted only for jobs that run in the protected GitHub environment of that account, for example &lt;code&gt;payments-dev&lt;/code&gt;, which requires an approval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trusting an environment instead of a branch matters: a workflow edited inside a pull request still cannot assume the apply role, because its job never passes the environment's protection rules.&lt;/p&gt;

&lt;p&gt;A pull request that touches &lt;code&gt;live/payments/dev&lt;/code&gt; plans only that environment. A change to the shared &lt;code&gt;root.hcl&lt;/code&gt; plans every environment. Each environment gets its own job, its own role and its own concurrency group.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick start that a team can actually follow
&lt;/h2&gt;

&lt;p&gt;The platform is only self-service if a team can use it without asking the platform team. The documentation was part of the product from day one, written in two languages, with a quick start of four steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the example environment directory and change the values.&lt;/li&gt;
&lt;li&gt;Bootstrap once: an admin applies the account baseline, which creates the state bucket and the CI roles.&lt;/li&gt;
&lt;li&gt;Open a pull request: CI plans; merge and approve: CI applies.&lt;/li&gt;
&lt;li&gt;Delegate the DNS zone from the parent domain.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The one manual step, bootstrap, is written down explicitly instead of hidden. Pretending there is no chicken-and-egg problem does not make it go away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A new team environment: &lt;strong&gt;from 2–3 days to about 30 minutes&lt;/strong&gt;, most of it EKS.&lt;/li&gt;
&lt;li&gt;Every environment comes from the same versioned definition; differences are visible as values, not as code.&lt;/li&gt;
&lt;li&gt;Upgrades are one-line pull requests with a plan.&lt;/li&gt;
&lt;li&gt;I designed and built the platform on my own in under four months: modules, stacks, contracts, CI and documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start from contracts, not modules.&lt;/strong&gt; Deciding what a unit takes and gives was harder and more important than any Terraform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep stacks thin.&lt;/strong&gt; Composition belongs in stacks; logic belongs in modules, where it can be tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin everything, including your own catalog.&lt;/strong&gt; If your own code floats, nobody will take pinning seriously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mocks are for planning only.&lt;/strong&gt; Allowing them for apply turns a missing dependency into a broken environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation is part of the platform.&lt;/strong&gt; The quick start removed more support requests than any feature.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Working with an AI coding agent, with guardrails
&lt;/h2&gt;

&lt;p&gt;I used Claude Code as a pair engineer through the whole project: module and stack code, CI scripts, merge request reviews, documentation and its translation. It also had read access to Jira, Confluence and Kubernetes through MCP.&lt;/p&gt;

&lt;p&gt;The rules were simple and non-negotiable: the agent had read-only access to clouds and clusters, it never ran &lt;code&gt;apply&lt;/code&gt;, and every change was reviewed by me before commit. With those rules, an agent made me faster without taking any decision about production away from a human.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The reference implementation is on GitHub: &lt;a href="https://github.com/devopsmher/terragrunt-platform" rel="noopener noreferrer"&gt;devopsmher/terragrunt-platform&lt;/a&gt;. It is a clean-room rewrite of the pattern and contains no code from the original project. Every module passes &lt;code&gt;terraform validate&lt;/code&gt;, the example stack generates and passes strict input validation, and the CI workflows are ready for a real account.&lt;/p&gt;

&lt;p&gt;Next in the platform: handing every new cluster over to GitOps right after creation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Mher Poghosyan is a Senior DevOps &amp;amp; Platform Engineer in Yerevan, Armenia. He builds Kubernetes platforms on AWS and GCP. &lt;a href="https://www.linkedin.com/in/mher-poghosyan/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; · &lt;a href="https://github.com/devopsmher" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>devops</category>
      <category>aws</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Can AI Ever Replace Priests in the Armenian Apostolic Church?</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Tue, 04 Mar 2025 19:38:29 +0000</pubDate>
      <link>https://dev.to/mher_poghosyan/can-ai-ever-replace-priests-in-the-armenian-apostolic-church-1f8g</link>
      <guid>https://dev.to/mher_poghosyan/can-ai-ever-replace-priests-in-the-armenian-apostolic-church-1f8g</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcenkghpluqrh4iwo2oag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcenkghpluqrh4iwo2oag.png" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In an era where artificial intelligence is revolutionizing every industry, one question remains: Are there roles that AI will never be able to replace? One such role is that of a priest in the Armenian Apostolic Church. Let’s explore why AI will never take on this sacred responsibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Requirement of Baptism and the Soul
&lt;/h3&gt;

&lt;p&gt;Becoming a priest in the Armenian Apostolic Church requires baptism, which is a sacred rite that signifies spiritual rebirth.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI cannot be baptized&lt;/strong&gt;  — It is not a living being and does not possess a soul.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faith in the immortality of the soul&lt;/strong&gt;  — Christianity teaches that every human has a soul that continues after death. Since AI has no soul, it cannot fully participate in religious sacraments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Necessity of Genuine Faith
&lt;/h3&gt;

&lt;p&gt;A priest is not just a religious scholar; he is a believer who dedicates his life to God.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI cannot believe in God&lt;/strong&gt;  — Faith is not a function of data processing; it is a deeply personal experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A priest’s role is not just intellectual but spiritual&lt;/strong&gt;  — AI may generate religious texts, but it will never experience faith or devotion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Spiritual Guidance and Emotional Connection
&lt;/h3&gt;

&lt;p&gt;A crucial part of being a priest is guiding people through their spiritual journeys, offering emotional and moral support.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI lacks true empathy&lt;/strong&gt;  — While AI can analyze emotions and respond accordingly, it does not feel or understand human struggles on a personal level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A priest shares his personal journey of faith&lt;/strong&gt;  — Faith is lived and experienced, not just learned. AI cannot form a genuine connection with believers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. The Divine Nature of Priesthood
&lt;/h3&gt;

&lt;p&gt;According to Christian teachings, a soul is given by God at birth.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI is not born naturally&lt;/strong&gt;  — It is created by humans, not by divine will.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Without a soul, AI cannot serve as a priest&lt;/strong&gt;  — The role of a priest is not just about knowledge; it’s about spiritual existence and divine calling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion: AI Will Never Replace Priests
&lt;/h3&gt;

&lt;p&gt;The Armenian Apostolic Church is more than an institution — it is a living faith that has been passed down for generations. AI may assist with translations, research, and religious education, but it will never replace the role of a priest.&lt;/p&gt;

&lt;p&gt;Priesthood is not just about delivering sermons — it is about faith, soul, and divine connection. And these are things no machine can ever truly possess.&lt;/p&gt;

&lt;p&gt;👉 What do you think? Are there other fields where AI will never replace humans? Let’s discuss in the comments!&lt;/p&gt;

&lt;h1&gt;
  
  
  ArtificialIntelligence #Faith #Religion #Technology #ArmenianApostolicChurch
&lt;/h1&gt;

</description>
      <category>church</category>
      <category>ai</category>
      <category>apostolic</category>
      <category>armenia</category>
    </item>
    <item>
      <title>Может ли ИИ заменить священников в Армянской Апостольской Церкви?</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Tue, 04 Mar 2025 19:34:07 +0000</pubDate>
      <link>https://dev.to/mher_poghosyan/mozhiet-li-ii-zamienit-sviashchiennikov-v-armianskoi-apostolskoi-tsierkvi-k6n</link>
      <guid>https://dev.to/mher_poghosyan/mozhiet-li-ii-zamienit-sviashchiennikov-v-armianskoi-apostolskoi-tsierkvi-k6n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcenkghpluqrh4iwo2oag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcenkghpluqrh4iwo2oag.png" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;В эпоху искусственного интеллекта многие профессии подвергаются автоматизации. Однако религия, особенно такие древние традиции, как Армянская Апостольская Церковь, ставит перед ИИ непреодолимые барьеры. Давайте разберем, почему искусственный интеллект никогда не сможет заменить священников этой церкви.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Таинство крещения и душа
&lt;/h3&gt;

&lt;p&gt;Чтобы стать священником в Армянской Апостольской Церкви, человек должен быть крещён. Крещение — это не просто ритуал, а духовное перерождение, в ходе которого человек принимает Святой Дух и становится частью Церкви.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ИИ не может быть крещён&lt;/strong&gt; : он не рождается, не имеет физического тела, и, главное, не обладает душой.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Вера в бессмертную душу&lt;/strong&gt; : Церковь учит, что у каждого человека есть душа, которая продолжает существовать после смерти. ИИ не обладает душой, следовательно, он не может участвовать в духовных таинствах.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Вера в Бога и Троицу
&lt;/h3&gt;

&lt;p&gt;Священник не просто исполняет ритуалы — он верит в Бога, Троицу (Отца, Сына и Святого Духа) и следует канонам Церкви.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ИИ не может верить&lt;/strong&gt; : вера — это осознанное, внутреннее чувство, а не алгоритмическая обработка информации. Даже если ИИ сможет цитировать Библию или вести богословские дискуссии, это не будет выражением личной веры.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Духовное наставничество
&lt;/h3&gt;

&lt;p&gt;Священник не просто читает молитвы и проводит обряды — он является духовным наставником, помогает людям найти смысл жизни, справляться с трудностями и укреплять веру.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ИИ не может проявлять истинное сочувствие&lt;/strong&gt; : Он может анализировать эмоции, предлагать советы, но это останется имитацией. Священник же сопереживает на глубинном уровне, потому что сам является частью общины и носителем духовного опыта.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Священник делится личной верой&lt;/strong&gt; : Опыт служения Богу, молитвы и жизни в вере нельзя воспроизвести алгоритмом.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Бог дает душу человеку
&lt;/h3&gt;

&lt;p&gt;Согласно христианскому учению, душа даётся человеку Богом в момент рождения.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ИИ не рождается естественным путём&lt;/strong&gt; : Его не создаёт Бог, а разрабатывают программисты.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Отсутствие души делает невозможным духовное служение&lt;/strong&gt; : Священник — это не просто носитель знаний о религии, а человек, который живёт духовной жизнью и соединён с Богом.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Вывод: ИИ никогда не заменит священников
&lt;/h3&gt;

&lt;p&gt;Армянская Апостольская Церковь — это не просто организация, а живая вера, передающаяся из поколения в поколение. Искусственный интеллект может быть полезен в анализе текстов, переводе религиозных книг или даже в создании виртуальных помощников для изучения Библии, но он никогда не заменит священника.&lt;/p&gt;

&lt;p&gt;Священство — это призвание, связанное с духовностью, душой и верой, которые неподвластны алгоритмам. ИИ может стать инструментом, но не носителем веры.&lt;/p&gt;

</description>
      <category>armenia</category>
      <category>church</category>
      <category>apostolic</category>
      <category>ai</category>
    </item>
    <item>
      <title>GitHub Actions Manual Approval via Telegram</title>
      <dc:creator>Mher Poghosyan</dc:creator>
      <pubDate>Mon, 03 Mar 2025 07:25:25 +0000</pubDate>
      <link>https://dev.to/mher_poghosyan/github-actions-manual-approval-via-telegram-2j1a</link>
      <guid>https://dev.to/mher_poghosyan/github-actions-manual-approval-via-telegram-2j1a</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi0t88vh3ripynek5bjsx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi0t88vh3ripynek5bjsx.jpeg" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Approval via Telegram&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In CI/CD workflows, especially those involving &lt;strong&gt;production deployments&lt;/strong&gt; , an extra layer of approval can be crucial. Using &lt;strong&gt;Telegram Manual Approval&lt;/strong&gt; for GitHub Actions allows workflows to &lt;strong&gt;pause until an explicit approval or rejection is given via Telegram&lt;/strong&gt;. This article walks through &lt;strong&gt;setup, configuration, and usage&lt;/strong&gt; of this approach to ensure controlled and secure deployments.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why Use Telegram Manual Approval?
&lt;/h3&gt;

&lt;p&gt;GitHub Actions enables automation, but sometimes manual intervention is needed before proceeding with sensitive operations like &lt;strong&gt;deployments&lt;/strong&gt;. With &lt;strong&gt;Telegram Manual Approval&lt;/strong&gt; , you can:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Pause the workflow&lt;/strong&gt; until an approval or rejection is received.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Grant specific users the ability to approve or reject&lt;/strong&gt; the workflow.&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Enhance security and reduce deployment risks.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Automate approval requests via Telegram messages.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;When the workflow reaches the &lt;strong&gt;telegram-manual-approval&lt;/strong&gt; step, it sends a &lt;strong&gt;customizable message&lt;/strong&gt; to a specified &lt;strong&gt;Telegram chat&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The message includes &lt;strong&gt;Approve&lt;/strong&gt; and &lt;strong&gt;Reject&lt;/strong&gt;  buttons.&lt;/li&gt;
&lt;li&gt;A user with the appropriate permissions can &lt;strong&gt;click on the buttons&lt;/strong&gt; to either:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Approve:&lt;/strong&gt; The workflow continues execution.&lt;/li&gt;
&lt;li&gt;❌ &lt;strong&gt;Reject:&lt;/strong&gt; The workflow fails and stops.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Setup Guide
&lt;/h3&gt;
&lt;h3&gt;
  
  
  1️⃣ Create a Telegram Bot
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open Telegram and &lt;strong&gt;search for&lt;/strong&gt; &lt;a class="mentioned-user" href="https://dev.to/botfather"&gt;@botfather&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use the command /newbot to &lt;strong&gt;create a bot&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save the API token&lt;/strong&gt; provided by BotFather.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2️⃣ Get Your Telegram Chat ID
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use @getmyid_bot in Telegram to &lt;strong&gt;retrieve your chat ID&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3️⃣ Store Secrets in GitHub
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;strong&gt;GitHub Repository → Settings → Secrets and Variables → Actions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Save:&lt;/li&gt;
&lt;li&gt;TELEGRAM_KEY → &lt;strong&gt;Your bot’s API key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;TELEGRAM_CHAT_ID → &lt;strong&gt;Your Telegram chat ID&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  How to Use the Action in GitHub Actions
&lt;/h3&gt;

&lt;p&gt;Add the following step to your &lt;strong&gt;GitHub Actions workflow file&lt;/strong&gt; (.github/workflows/deploy.yml):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;khasanovbi/telegram-manual-approval@v0.0.2&lt;/span&gt;
    &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;telegram-key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.TELEGRAM_KEY }}&lt;/span&gt;
      &lt;span class="na"&gt;telegram-chat-id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ vars.TELEGRAM_CHAT_ID }}&lt;/span&gt;
      &lt;span class="na"&gt;github-to-telegram&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="na"&gt;githubUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;telegramUsername&lt;/span&gt;
          &lt;span class="na"&gt;anotherGitHubUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;123456789&lt;/span&gt;
      &lt;span class="na"&gt;approvers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;githubUsername&lt;/span&gt;
      &lt;span class="na"&gt;super-approvers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;anotherGitHubUsername&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Explanation of Parameters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;telegram-key&lt;/strong&gt; → The Telegram bot token.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;telegram-chat-id&lt;/strong&gt; → The chat ID where the approval request is sent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;github-to-telegram&lt;/strong&gt; → Maps GitHub usernames to Telegram usernames or IDs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;approvers&lt;/strong&gt; → GitHub users allowed to approve/reject deployments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;super-approvers&lt;/strong&gt; → Users with elevated privileges (can override settings).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Message Text Customization
&lt;/h3&gt;

&lt;p&gt;You can personalize &lt;strong&gt;approval/rejection messages&lt;/strong&gt; and buttons:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="n"&gt;approval&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"%%actor%% wants to deploy %%github_ref_url%% to production."&lt;/span&gt;
&lt;span class="n"&gt;approve&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"✅ Approve"&lt;/span&gt;
&lt;span class="n"&gt;reject&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"❌ Reject"&lt;/span&gt;
&lt;span class="n"&gt;approved&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"✅ Approved by %%approver%%"&lt;/span&gt;
&lt;span class="n"&gt;rejected&lt;/span&gt;&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"❌ Rejected by %%approver%%"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Available Template Variables
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;%%actor%%&lt;/strong&gt; → The user who triggered the workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;%%approver%%&lt;/strong&gt; → The user who approved or rejected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;%%github_ref_url%%&lt;/strong&gt; → URL to the GitHub branch/tag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;%%workflow_run_url%%&lt;/strong&gt; → URL to the workflow run.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example: Deployment Workflow with Approval
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Release&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Environment'&lt;/span&gt;
        &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stage&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;environment&lt;/span&gt;
        &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ inputs.environment }}&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;khasanovbi/telegram-manual-approval@v0.0.2&lt;/span&gt;
        &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;inputs.environment == 'prod'&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;telegram-key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'${{ secrets.TELEGRAM_KEY }}'&lt;/span&gt;
          &lt;span class="na"&gt;telegram-chat-id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'${{ vars.TELEGRAM_CHAT_ID }}'&lt;/span&gt;
          &lt;span class="na"&gt;github-to-telegram&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
              &lt;span class="na"&gt;githubUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;telegramUsername&lt;/span&gt;
              &lt;span class="na"&gt;anotherGitHubUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;123456789&lt;/span&gt;
          &lt;span class="na"&gt;approvers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
              &lt;span class="s"&gt;githubUsername&lt;/span&gt;
          &lt;span class="na"&gt;super-approvers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
              &lt;span class="s"&gt;anotherGitHubUsername&lt;/span&gt;

      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run deploy&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "Deploying..."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What Happens Here?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The workflow is manually triggered (workflow_dispatch).&lt;/li&gt;
&lt;li&gt;If the environment is &lt;strong&gt;‘prod’&lt;/strong&gt; , the Telegram approval request is sent.&lt;/li&gt;
&lt;li&gt;The deployment &lt;strong&gt;pauses&lt;/strong&gt; until an approval is received.&lt;/li&gt;
&lt;li&gt;Once approved, the deployment continues (Run deploy).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Using &lt;strong&gt;Telegram Manual Approval&lt;/strong&gt; adds an extra layer of &lt;strong&gt;security and control&lt;/strong&gt; to GitHub Actions workflows. This is particularly useful for &lt;strong&gt;critical deployments&lt;/strong&gt; where an extra review step is necessary.&lt;/p&gt;

&lt;p&gt;By integrating Telegram approvals, teams can:&lt;br&gt;&lt;br&gt;
✔ Ensure &lt;strong&gt;controlled deployments&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
✔ Improve &lt;strong&gt;team collaboration&lt;/strong&gt; through chat-based approvals.&lt;br&gt;&lt;br&gt;
✔ Reduce the risk of &lt;strong&gt;accidental deployments&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Try it out and enhance your GitHub CI/CD workflows today!&lt;/strong&gt;  🚀&lt;/p&gt;

</description>
      <category>approval</category>
      <category>githubactions</category>
      <category>continuousdelivery</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
