<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Terraform on Digital Archive Systems Tech Blog</title><link>https://tech.ldas.jp/en/tags/terraform/</link><description>Recent content in Terraform on Digital Archive Systems Tech Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 16 Apr 2026 22:30:00 +0900</lastBuildDate><atom:link href="https://tech.ldas.jp/en/tags/terraform/index.xml" rel="self" type="application/rss+xml"/><item><title>Retrofitting CloudFront + WAF onto an Existing Reverse-Proxy Origin: Practical Patterns</title><link>https://tech.ldas.jp/en/posts/cloudfront-waf-add-to-existing-origin/</link><pubDate>Thu, 16 Apr 2026 22:30:00 +0900</pubDate><guid>https://tech.ldas.jp/en/posts/cloudfront-waf-add-to-existing-origin/</guid><description>&lt;p>I migrated a set of production web services from a configuration where &lt;strong>DNS pointed directly at the origin&lt;/strong> (Docker + Traefik on a VPS) to one where &lt;strong>CloudFront + AWS WAF sit in front of the origin&lt;/strong>. This article summarises the patterns I used and the pitfalls I did not expect, in a general form.&lt;/p>
&lt;p>The goal is to help anyone migrating a similar setup avoid the same mistakes.&lt;/p>
&lt;h2 id="before">Before&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">Browser ──► DNS ──► Origin IP (reverse proxy: Traefik on VPS)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> ├── service-a (equivalent to cultural.jp)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> ├── service-b (equivalent to api.cultural.jp)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> └── service-c (equivalent to webcatplus.jp)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Each service is a Docker container.&lt;/li>
&lt;li>Traefik routes by the Host header and terminates TLS with Let&amp;rsquo;s Encrypt (HTTP-01).&lt;/li>
&lt;li>The CrowdSec bouncer plugin handles attack detection.&lt;/li>
&lt;/ul>
&lt;h2 id="after">After&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">Browser ──► DNS ──► CloudFront ──► origin domain ──► Traefik
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> │ (origin.example.com)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> └── WAF (OWASP / known bad inputs / IP reputation / rate limit)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Three key points:&lt;/p></description></item></channel></rss>