<?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: Cristhian Becerra</title>
    <description>The latest articles on DEV Community by Cristhian Becerra (@cbecerra).</description>
    <link>https://dev.to/cbecerra</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3545716%2Fa8cbf641-51dd-4f99-ad6b-abe0f714fa3b.jpeg</url>
      <title>DEV Community: Cristhian Becerra</title>
      <link>https://dev.to/cbecerra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cbecerra"/>
    <language>en</language>
    <item>
      <title>Protege tu dominio con DNSSEC en Amazon Route 53: Guía paso a paso</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Tue, 28 Oct 2025 14:54:06 +0000</pubDate>
      <link>https://dev.to/cbecerra/protege-tu-dominio-con-dnssec-en-amazon-route-53-guia-paso-a-paso-1amd</link>
      <guid>https://dev.to/cbecerra/protege-tu-dominio-con-dnssec-en-amazon-route-53-guia-paso-a-paso-1amd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Este artículo te guiará en la implementación de DNSSEC para tus dominios en Amazon Route 53. Mostraré paso a paso cómo activar DNSSEC en tu zona alojada en Route 53 y cómo establecer la cadena de confianza entre el Domain Registrar (Namecheap) y los Authoritative DNS Providers (Cloudflare y Amazon Route 53), todo ello alineado con el pilar de Seguridad del AWS Well-Architected Framework. 🔐&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tiempo estimado de lectura:&lt;/strong&gt; 10 minutos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nivel:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versión en inglés:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/secure-your-domain-with-dnssec-in-amazon-route-53-a-step-by-step-guide-328i"&gt;Secure Your Domain with DNSSEC in Amazon Route 53: A Step-by-Step Guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tabla de Contenidos:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Introducción

&lt;ul&gt;
&lt;li&gt;Resolución DNS Recursiva&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Qué es DNSSEC&lt;/li&gt;

&lt;li&gt;

Cómo funciona DNSSEC

&lt;ul&gt;
&lt;li&gt;Resolución DNS Recursiva con DNSSEC&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Por qué implementar DNSSEC

&lt;ul&gt;
&lt;li&gt;Envenenamiento de caché sin DNSSEC&lt;/li&gt;
&lt;li&gt;Envenenamiento de caché con DNSSEC habilitado&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Qué vas a implementar&lt;/li&gt;

&lt;li&gt;Prerrequisitos&lt;/li&gt;

&lt;li&gt;

Pasos de Implementación

&lt;ul&gt;
&lt;li&gt;Configura DNSSEC en Amazon Route 53&lt;/li&gt;
&lt;li&gt;Configura DNSSEC en Cloudflare&lt;/li&gt;
&lt;li&gt;Configura DNSSEC en Namecheap&lt;/li&gt;
&lt;li&gt;Valida la implementación de DNSSEC&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Costo de la Implementación&lt;/li&gt;

&lt;li&gt;Lecciones Aprendidas&lt;/li&gt;

&lt;li&gt;Conclusión&lt;/li&gt;

&lt;li&gt;Qué sigue&lt;/li&gt;

&lt;li&gt;Recursos oficiales&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;Como todos sabemos, a medida que la tecnología avanza, las amenazas y la cantidad de agentes maliciosos aumentan exponencialmente, por lo que la ciberseguridad se ha convertido en una prioridad cada vez mayor.&lt;/p&gt;

&lt;p&gt;El Sistema de Nombres de Dominio (DNS) es una parte esencial de la infraestructura de la web; sin embargo, su diseño original carece de mecanismos de seguridad robustos. En otras palabras, el DNS por sí mismo no es seguro: es susceptible a ataques como &lt;em&gt;DNS Spoofing&lt;/em&gt; o &lt;em&gt;DNS Cache Poisoning&lt;/em&gt;, en los cuales agentes maliciosos envenenan la caché de los servidores DNS para manipular los registros y la resolución de nombres a su conveniencia, redirigiendo así a los usuarios hacia sitios web maliciosos. 😯&lt;/p&gt;

&lt;p&gt;Aquí es donde entra &lt;strong&gt;DNSSEC&lt;/strong&gt;, una extensión del protocolo DNS que protege la integridad y autenticidad de la información transmitida durante una consulta DNS, previniendo de este modo los ataques mencionados anteriormente. ¿Y saben qué es lo mejor de todo? ¡Que es muy sencillo de implementar! 🤩&lt;/p&gt;

&lt;p&gt;En este artículo explicaremos qué es DNSSEC, cómo funciona, cuáles son sus beneficios y cómo implementarlo para proteger tus dominios en Amazon Route 53.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolución DNS Recursiva
&lt;/h3&gt;

&lt;p&gt;Antes de entrar de lleno en DNSSEC, me gustaría recordarles brevemente cómo funciona la recursividad durante la resolución DNS. Cuando un usuario intenta acceder a un dominio, se envía una consulta DNS al servidor DNS local. Este servidor buscará el registro correspondiente en su caché DNS y, si no lo encuentra, el &lt;em&gt;DNS Resolver&lt;/em&gt; iniciará consultas recursivas hacia el &lt;em&gt;Root DNS Server&lt;/em&gt; y luego al &lt;em&gt;TLD DNS Server&lt;/em&gt;, hasta llegar al &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; que contiene el registro solicitado. Finalmente, dicho registro será almacenado en la caché DNS local durante el TTL predeterminado, antes de devolver la dirección IP correspondiente al usuario.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fbqfcq4dcqn18shi7su8g.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.amazonaws.com%2Fuploads%2Farticles%2Fbqfcq4dcqn18shi7su8g.png" alt="Resolución DNS Recursiva" width="800" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué es DNSSEC
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DNSSEC (Domain Name System Security Extensions)&lt;/strong&gt; es un conjunto de extensiones de seguridad para el protocolo DNS que permite verificar que las respuestas DNS provienen de una fuente autenticada y que no han sido alteradas durante la transmisión. Su objetivo principal es prevenir amenazas como el &lt;em&gt;DNS Spoofing&lt;/em&gt; o &lt;em&gt;DNS Cache Poisoning&lt;/em&gt; y los ataques de tipo &lt;em&gt;man-in-the-middle&lt;/em&gt;, que pueden comprometer la seguridad de los usuarios al permitir que los atacantes intercepten o modifiquen los datos en tránsito para manipular la información recibida por los usuarios y redirigir a los usuarios hacia sitios falsos. 🫤&lt;/p&gt;

&lt;p&gt;Cuando activamos DNSSEC cada respuesta a una consulta DNS incluye una firma digital basada en criptografía de clave pública, y esta firma puede ser verificada por el resolutor DNS para confirmar la autenticidad e integridad de la información devuelta. 😌&lt;/p&gt;

&lt;p&gt;En resumen, DNSSEC ayuda a garantizar que los usuarios accedan al sitio web real que están buscando y no a uno falso. Si bien DNSSEC no protege la privacidad de las consultas con cifrado. dado que esa función corresponde a protocolos como &lt;em&gt;TLS (Transport Layer Security)&lt;/em&gt;, DNSSEC sí evita que actores maliciosos inserten respuestas manipuladas en las consultas DNS durante el proceso de resolución de nombres.&lt;/p&gt;

&lt;p&gt;Hasta ahora todo suena increíble, pero quizá se estén preguntando: ¿Y cómo funciona DNSSEC por detrás? 🤔&lt;/p&gt;

&lt;h2&gt;
  
  
  Cómo funciona DNSSEC
&lt;/h2&gt;

&lt;p&gt;DNSSEC añade una capa adicional de seguridad mediante validación criptográfica al proceso de resolución de nombres DNS. El funcionamiento de DNSSEC se basa en varios componentes que trabajan en conjunto para establecer una &lt;em&gt;cadena de confianza&lt;/em&gt;, entre los cuales se encuentran:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Registros DNSKEY:&lt;/strong&gt; almacenan las claves públicas utilizadas para verificar las firmas digitales de los registros DNS. Dentro de estos registros se incluyen dos tipos de claves:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ZSK (Zone Signing Key):&lt;/strong&gt; se utiliza para firmar los registros dentro de la zona DNS (por ejemplo, A, MX, TXT, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KSK (Key Signing Key):&lt;/strong&gt; se utiliza exclusivamente para firmar la ZSK, y su clave pública se publica en el registro &lt;strong&gt;DS&lt;/strong&gt; en la zona superior.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Registros RRSIG:&lt;/strong&gt; contienen la firma digital de cada conjunto de registros DNS.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Registro DS:&lt;/strong&gt; vincula la clave pública del dominio con su zona superior, estableciendo así la cadena de confianza.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Durante la resolución de un nombre de dominio, cuando un usuario intenta acceder a un sitio web, el &lt;em&gt;resolutor recursivo&lt;/em&gt; consulta los registros DNS y verifica la firma digital utilizando la clave pública correspondiente. Si la firma es válida, la respuesta se considera confiable y es aceptada. De lo contrario, se asume que la información pudo haber sido alterada y, por lo tanto, se considera peligrosa, bloqueando el acceso. ⛔&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolución DNS Recursiva con DNSSEC
&lt;/h3&gt;

&lt;p&gt;Ahora les quiero mostrar cómo se ve el proceso de resolución DNS recursiva cuando se implementa DNSSEC, estableciendo una cadena de confianza de extremo a extremo. La resolución recursiva es similar, pero esta vez cada respuesta DNS incluye una &lt;code&gt;DNSKEY&lt;/code&gt; para la validación de autenticidad con el dominio superior y un registro &lt;code&gt;DS&lt;/code&gt; para la validación con un subdominio. En otras palabras, para cada respuesta DNS, el &lt;em&gt;DNS Resolver&lt;/em&gt; valida la &lt;code&gt;DNSKEY&lt;/code&gt; recibida contra el registro &lt;code&gt;DS&lt;/code&gt; correspondiente en el dominio superior, y solo si la validación es correcta, la respuesta DNS es aceptada por el &lt;em&gt;DNS Resolver&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdc1z6czg4wvovc0ym4bt.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.amazonaws.com%2Fuploads%2Farticles%2Fdc1z6czg4wvovc0ym4bt.png" alt="Resolución DNS Recursiva con DNSSEC" width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Por qué implementar DNSSEC
&lt;/h2&gt;

&lt;p&gt;Como he mencionado líneas arriba, DNS por sí solo no es seguro y, por defecto, estamos expuestos a ataques como &lt;em&gt;DNS Spoofing&lt;/em&gt; o &lt;em&gt;DNS Cache Poisoning&lt;/em&gt;. Sin embargo, estos riesgos pueden mitigarse fácilmente si configuramos DNSSEC en nuestros dominios.&lt;/p&gt;

&lt;p&gt;Implementar DNSSEC ofrece varios beneficios importantes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Protección contra manipulaciones:&lt;/strong&gt; evita que los atacantes modifiquen o falsifiquen respuestas DNS durante la transmisión.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mayor nivel de confianza:&lt;/strong&gt; al verificar la autenticidad de la información, los usuarios pueden estar seguros de que están accediendo al sitio correcto.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Defensa frente a ataques de envenenamiento de caché y redireccionamientos maliciosos.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mejor reputación para tu marca o proyecto:&lt;/strong&gt; demostrar un compromiso con la seguridad es un factor clave para mejorar la percepción y la experiencia del usuario.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Envenenamiento de caché sin DNSSEC
&lt;/h3&gt;

&lt;p&gt;Durante un envenenamiento de caché sin DNSSEC, el atacante intercepta la solicitud DNS realizada por el usuario y, antes de que el &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; pueda responder, realiza un &lt;em&gt;spoofing&lt;/em&gt; enviando rápidamente una respuesta DNS manipulada para inyectar un registro malicioso en el servidor DNS local. Dado que el &lt;em&gt;DNS Resolver&lt;/em&gt; no tiene forma de determinar si la respuesta es auténtica, debido al &lt;em&gt;IP address spoofing&lt;/em&gt;, el servidor DNS local almacena la respuesta en caché durante el TTL predeterminado, redirigiendo así a los usuarios al sitio web malicioso. Cuando finalmente llega la respuesta legítima del &lt;em&gt;Authoritative DNS Provider&lt;/em&gt;, el &lt;em&gt;DNS Resolver&lt;/em&gt; la descarta, ya que la consulta DNS ya fue atendida.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Feu4tjq0ddi17f8u6m70d.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.amazonaws.com%2Fuploads%2Farticles%2Feu4tjq0ddi17f8u6m70d.png" alt="DNS Spoofing without DNSSEC" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Envenenamiento de caché con DNSSEC habilitado
&lt;/h3&gt;

&lt;p&gt;Durante un envenenamiento de caché con DNSSEC habilitado, el atacante intenta inyectar una respuesta DNS manipulada. Sin embargo, el &lt;em&gt;DNS Resolver&lt;/em&gt;, esta vez &lt;em&gt;DNSSEC-aware&lt;/em&gt;, valida la firma de la respuesta DNS contra la llave pública almacenada en el registro &lt;code&gt;DS&lt;/code&gt; del dominio superior. Al no ser válida, la respuesta DNS maliciosa es bloqueada. Por el contrario, la respuesta auténtica del &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; contiene una firma válida, por lo que es aceptada y el usuario es dirigido al sitio web legítimo.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fb856gj4pvnjv66aozug8.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.amazonaws.com%2Fuploads%2Farticles%2Fb856gj4pvnjv66aozug8.png" alt="DNS Spoofing with DNSSEC" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;En un entorno cada vez más dependiente de la tecnología, proteger la integridad de las comunicaciones DNS es una prioridad para todos. Por ello, es importante que sepas cómo implementar DNSSEC. Además, cuando te muestre lo sencillo que resulta hacerlo, probablemente conviertas su implementación en un estándar para todos tus dominios. 🙌🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué vas a implementar
&lt;/h2&gt;

&lt;p&gt;Esta guía asume que ya cuentas con una &lt;em&gt;Hosted Zone&lt;/em&gt; en Route 53 correctamente configurada para tu dominio. Lo que haremos será implementar DNSSEC sobre dicha &lt;em&gt;Hosted Zone&lt;/em&gt; y a lo largo de toda la cadena de confianza.&lt;/p&gt;

&lt;p&gt;En mi caso, cuento con los siguientes componentes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Domain Name Registrar:&lt;/em&gt; Namecheap&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Authoritative DNS Provider:&lt;/em&gt; Cloudflare&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Managed DNS Service:&lt;/em&gt; Amazon Route 53&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Delegated DNS Zone:&lt;/em&gt; Amazon Route 53 Hosted Zone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dentro de la consola de &lt;em&gt;Amazon Route 53&lt;/em&gt;, activaremos &lt;em&gt;DNSSEC Signing&lt;/em&gt; para la &lt;em&gt;Hosted Zone&lt;/em&gt; y estableceremos una cadena de confianza entre Amazon Route 53 y Cloudflare, y luego entre Cloudflare y Namecheap.&lt;/p&gt;

&lt;p&gt;Cabe mencionar que, dependiendo de tu caso de uso particular, es posible que no estés utilizando Cloudflare como &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; como en mi caso, y que emplees directamente Amazon Route 53. Incluso podrías usar Amazon Route 53 también como &lt;em&gt;Domain Name Registrar&lt;/em&gt;, lo que implicaría una cadena de confianza mucho más corta y sencilla al momento de implementar DNSSEC, pero esta guía asume que tu &lt;em&gt;Domain Name Registrar&lt;/em&gt; no es Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnyexug8vxxkiaonbaibt.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.amazonaws.com%2Fuploads%2Farticles%2Fnyexug8vxxkiaonbaibt.png" alt="Qué vas a implementar" width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerrequisitos
&lt;/h2&gt;

&lt;p&gt;Para esta implementación de DNSSEC, se requiere contar con los siguientes prerrequisitos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Acceso a una cuenta AWS.&lt;/li&gt;
&lt;li&gt;Acceso administrativo al &lt;em&gt;Domain Name Registrar&lt;/em&gt; (por ejemplo, Namecheap) y ser propietario del dominio.&lt;/li&gt;
&lt;li&gt;Acceso administrativo al &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; (Cloudflare o Amazon Route 53).&lt;/li&gt;
&lt;li&gt;Acceso administrativo a cualquier &lt;em&gt;secondary&lt;/em&gt; o &lt;em&gt;delegated Authoritative DNS Provider&lt;/em&gt; dentro de la cadena de confianza.&lt;/li&gt;
&lt;li&gt;Contar con una &lt;em&gt;Hosted Zone&lt;/em&gt; en Amazon Route 53 correctamente configurada y/o delegada.&lt;/li&gt;
&lt;li&gt;Permisos IAM en la cuenta AWS para utilizar los servicios &lt;em&gt;Amazon Route 53&lt;/em&gt; y &lt;em&gt;AWS Key Management Service (KMS)&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pasos de Implementación
&lt;/h2&gt;

&lt;p&gt;Las siguientes secciones ofrecen una guía paso a paso para la configuración de DNSSEC, mostrando cómo se integran cada uno de los componentes —Amazon Route 53, Cloudflare y Namecheap— para establecer la cadena de confianza de tu dominio. Primero implementaré la confianza entre Amazon Route 53 y Cloudflare, y luego entre Cloudflare y Namecheap.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configura DNSSEC en Amazon Route 53
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Ingresa a la consola de Amazon Route 53.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En el listado de &lt;em&gt;Hosted Zones&lt;/em&gt;, selecciona la zona alojada a la cual deseas implementar DNSSEC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Dentro de la zona alojada, selecciona la pestaña &lt;strong&gt;DNSSEC signing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; En la sección &lt;em&gt;DNSSEC signing&lt;/em&gt;, haz clic en el botón &lt;strong&gt;Enable DNSSEC Signing&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fna1qvrb3waul5857lwea.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.amazonaws.com%2Fuploads%2Farticles%2Fna1qvrb3waul5857lwea.png" alt="Enable DNSSEC Signing" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Especifica un nombre para la &lt;em&gt;Key-signing key (KSK)&lt;/em&gt;, por ejemplo: &lt;code&gt;mi_dominio_ksk&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Selecciona una &lt;em&gt;Customer managed key (CMK)&lt;/em&gt; existente o crea una nueva.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;En este ejemplo, se creará una nueva CMK. Para ello, ingresa el nombre deseado para la clave, por ejemplo: &lt;code&gt;dnssec_cmk&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Haz clic en &lt;strong&gt;Create KSK and enable signing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Verás el mensaje &lt;em&gt;"Enabling DNSSEC signing for the hosted zone"&lt;/em&gt; — este proceso puede tomar algunos minutos.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Frfd3xal6u12pwrvs9hym.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.amazonaws.com%2Fuploads%2Farticles%2Frfd3xal6u12pwrvs9hym.png" alt="Create KSK and enable signing" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Una vez que aparezca el mensaje &lt;em&gt;"DNSSEC signing was successfully enabled for the hosted zone"&lt;/em&gt;, en la pestaña &lt;em&gt;DNSSEC Signing&lt;/em&gt; podrás verificar que DNSSEC se encuentra en estado &lt;em&gt;Signing&lt;/em&gt;, y que la nueva &lt;em&gt;Key-signing key (KSK)&lt;/em&gt; está activa.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; En la sección &lt;em&gt;DNSSEC Signing&lt;/em&gt;, haz clic en el botón &lt;strong&gt;View information to create DS Record&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fy06c4u5mavkl7i9xvoyy.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.amazonaws.com%2Fuploads%2Farticles%2Fy06c4u5mavkl7i9xvoyy.png" alt="View information to create DS Record" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; En la sección &lt;em&gt;Establish a chain of trust&lt;/em&gt;, ubica el apartado &lt;strong&gt;Another domain registrar&lt;/strong&gt; (si aplica) y revisa los valores para &lt;em&gt;Domain name&lt;/em&gt;, &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Signing algorithm type&lt;/em&gt;, &lt;em&gt;Digest algorithm type&lt;/em&gt;, &lt;em&gt;Digest&lt;/em&gt; y &lt;em&gt;DS record&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdskouw5tcelkwu2hqqfo.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.amazonaws.com%2Fuploads%2Farticles%2Fdskouw5tcelkwu2hqqfo.png" alt="Establish a chain of trust" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configura DNSSEC en Cloudflare
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; En &lt;strong&gt;Cloudflare&lt;/strong&gt;, abre el listado de &lt;em&gt;Records&lt;/em&gt; del dominio correspondiente y selecciona &lt;strong&gt;Add record&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F13ftlrhxhv7fvtyf5pj6.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.amazonaws.com%2Fuploads%2Farticles%2F13ftlrhxhv7fvtyf5pj6.png" alt="Add record" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Selecciona el tipo de &lt;em&gt;record&lt;/em&gt; &lt;strong&gt;DS&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;En el campo &lt;em&gt;Name&lt;/em&gt;, ingresa el subdominio necesario para completar el &lt;em&gt;Domain name&lt;/em&gt;, o utiliza &lt;em&gt;@&lt;/em&gt; para el dominio raíz.&lt;/li&gt;
&lt;li&gt;Completa los valores correspondientes para &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Signing algorithm type&lt;/em&gt;, &lt;em&gt;Digest algorithm type&lt;/em&gt; y &lt;em&gt;Digest&lt;/em&gt;, utilizando la información obtenida desde Route 53.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Guarda el registro.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fl7jsi0256g3cm8kh1vji.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.amazonaws.com%2Fuploads%2Farticles%2Fl7jsi0256g3cm8kh1vji.png" alt="Edit DS Record" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;El contenido del registro &lt;code&gt;DS&lt;/code&gt; debe ser idéntico al valor del &lt;em&gt;DS Record&lt;/em&gt; generado en Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F2tsuy1b4ocakrcwl14ca.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.amazonaws.com%2Fuploads%2Farticles%2F2tsuy1b4ocakrcwl14ca.png" alt="Review DS Record" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Con esto se completa la confianza entre Amazon Route 53 y Cloudflare. A continuación, estableceremos la confianza entre Cloudflare y Namecheap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; En &lt;strong&gt;Cloudflare&lt;/strong&gt;, abre los &lt;strong&gt;DNS Settings&lt;/strong&gt; del dominio correspondiente y selecciona &lt;strong&gt;Enable DNSSEC&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F0li9r1pix1wxgd96aonq.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.amazonaws.com%2Fuploads%2Farticles%2F0li9r1pix1wxgd96aonq.png" alt="Enable DNSSEC" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; En la pestaña &lt;em&gt;How to enable DNSSEC&lt;/em&gt;, revisa los valores para &lt;em&gt;DS record&lt;/em&gt;, &lt;em&gt;Digest&lt;/em&gt;, &lt;em&gt;Digest type&lt;/em&gt;, &lt;em&gt;Algorithm&lt;/em&gt; y &lt;em&gt;Key tag&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F1oqo282vim2zz31gaxfr.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.amazonaws.com%2Fuploads%2Farticles%2F1oqo282vim2zz31gaxfr.png" alt="How to enable DNSSEC" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Haz clic en &lt;strong&gt;Confirm&lt;/strong&gt; para habilitar DNSSEC.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configura DNSSEC en Namecheap
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; En &lt;strong&gt;Namecheap&lt;/strong&gt;, selecciona el dominio correspondiente y dirígete a la pestaña &lt;strong&gt;Advanced DNS&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnabfu7x472ciqjbhzwyi.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.amazonaws.com%2Fuploads%2Farticles%2Fnabfu7x472ciqjbhzwyi.png" alt="Advanced DNS" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En la sección &lt;em&gt;DNSSEC&lt;/em&gt;, activa la opción ubicada junto al campo &lt;strong&gt;Status&lt;/strong&gt; para habilitar DNSSEC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Completa el registro &lt;code&gt;DS&lt;/code&gt; con los valores de &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Algorithm&lt;/em&gt;, &lt;em&gt;Digest Type&lt;/em&gt; y &lt;em&gt;Digest&lt;/em&gt; obtenidos desde Cloudflare, y guarda los cambios.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fd792sko4sawic9ip11p1.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.amazonaws.com%2Fuploads%2Farticles%2Fd792sko4sawic9ip11p1.png" alt="Edit DS Record" width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;El contenido del registro &lt;code&gt;DS&lt;/code&gt; debe coincidir con el valor del &lt;em&gt;DS Record&lt;/em&gt; de Cloudflare.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F36bzg946ft6h6odvx0ro.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.amazonaws.com%2Fuploads%2Farticles%2F36bzg946ft6h6odvx0ro.png" alt="Review DS Record" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; En &lt;strong&gt;Cloudflare&lt;/strong&gt;, al revisar nuevamente los &lt;em&gt;DNS Settings&lt;/em&gt; del dominio, deberías ver el mensaje: &lt;em&gt;"Success! Your domain is protected with DNSSEC"&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F8iyfy57ya3tsv2wjn1rx.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.amazonaws.com%2Fuploads%2Farticles%2F8iyfy57ya3tsv2wjn1rx.png" alt="DNS Settings" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Con esto, se completa la confianza entre Cloudflare y Namecheap. En este punto, toda la cadena de confianza requerida para configurar DNSSEC en tu &lt;em&gt;Hosted Zone&lt;/em&gt; de Amazon Route 53 habrá sido establecida exitosamente.&lt;/p&gt;

&lt;h3&gt;
  
  
  Valida la implementación de DNSSEC
&lt;/h3&gt;

&lt;p&gt;Como último paso, es importante verificar que la configuración de DNSSEC sea completamente funcional. Para ello, puedes utilizar herramientas en línea como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dnssec-analyzer.verisignlabs.com" rel="noopener noreferrer"&gt;dnssec-analyzer.verisignlabs.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dnssec-debugger.verisignlabs.com" rel="noopener noreferrer"&gt;dnssec-debugger.verisignlabs.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Estas herramientas permiten ingresar tu dominio y comprobar si DNSSEC está correctamente habilitado y configurado en toda la cadena de confianza.&lt;/p&gt;

&lt;p&gt;A continuación, estoy compartiendo un análisis de &lt;em&gt;DNSSEC Analyzer&lt;/em&gt; con un resultado exitoso, el cual demuestra una correcta configuración de DNSSEC desde Namecheap, pasando por Cloudflare, hasta Amazon Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Flbkj0dm7wlahodny2ciw.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.amazonaws.com%2Fuploads%2Farticles%2Flbkj0dm7wlahodny2ciw.png" alt="DNSSEC Analyzer" width="686" height="773"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Costo de la Implementación
&lt;/h2&gt;

&lt;p&gt;La implementación de DNSSEC por parte de Amazon Route 53 no tiene costo, y dado que ya contabas con el dominio, el único gasto asociado sería el correspondiente a la &lt;em&gt;Customer Managed Key (CMK)&lt;/em&gt; utilizada para generar la &lt;em&gt;Key Signing Key (KSK)&lt;/em&gt;.💲&lt;/p&gt;

&lt;p&gt;Así que solo se te cobrará por el uso de AWS KMS según la forma en que utilices las claves requeridas para la firma DNSSEC de tus zonas alojadas.&lt;/p&gt;

&lt;p&gt;Es importante mencionar que una &lt;em&gt;CMK&lt;/em&gt; puede reutilizarse para la firma de múltiples dominios, lo que contribuiría a optimizar costos.&lt;/p&gt;

&lt;p&gt;Para más información y detalles específicos sobre los precios, consulta la página de precios de AWS Key Management Service, disponible en la sección final de recursos oficiales.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lecciones Aprendidas
&lt;/h2&gt;

&lt;p&gt;Si bien la solución es sencilla de implementar y de bajo costo en la factura de AWS, debes tener en cuenta la posible complejidad operativa en entornos donde un dominio utiliza múltiples proveedores de DNS, ya que mantener sincronizadas las claves y los registros &lt;code&gt;DS&lt;/code&gt; puede volverse un proceso complejo y, por ende, propenso a errores. 🧐&lt;/p&gt;

&lt;p&gt;En otras palabras, DNSSEC conlleva un costo operativo que no necesariamente es económico, pues implica mantenimiento y responsabilidad continua, rotación de claves, verificación periódica y la posible actualización de automatizaciones o scripts CI/CD relacionados con la infraestructura DNS.&lt;/p&gt;

&lt;p&gt;Por otro lado, es importante recordar que DNSSEC garantiza autenticidad e integridad, pero no protege contra todos los tipos de ataques. Amenazas como la filtración de datos DNS o la privacidad del usuario requieren el uso de protocolos como &lt;em&gt;DNS-over-HTTPS (DoH)&lt;/em&gt; o &lt;em&gt;DNS-over-TLS (DoT)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Finalmente, en mi experiencia, algo común que puede ocurrir es que, aun después de haber configurado correctamente toda la cadena de confianza para implementar DNSSEC, el &lt;em&gt;DNSSEC Analyzer&lt;/em&gt; continúe mostrando errores. Esto puede deberse a que algunos registros aún no se han propagado completamente, proceso que puede tardar varias horas. Para verificarlo, accede a &lt;a href="https://dns.google" rel="noopener noreferrer"&gt;dns.google&lt;/a&gt; y consulta el registro &lt;code&gt;DS&lt;/code&gt; de tu dominio. Revisa la &lt;em&gt;data&lt;/em&gt; de la respuesta y confirma que coincida con el registro DS de Route 53; si no coincide, la propagación aún no ha finalizado. ⌛&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwf1ywvfndcxheoxtb1r6.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.amazonaws.com%2Fuploads%2Farticles%2Fwf1ywvfndcxheoxtb1r6.png" alt="DNS Público de Google" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;De manera sencilla y con un costo reducido —aunque sin dejar de considerar los posibles costos operativos—, la implementación de DNSSEC fortalece la infraestructura de la web al ofrecer un sistema de nombres de dominio más seguro y confiable, reduciendo significativamente el riesgo de ataques o modificaciones no autorizadas a las respuestas a consultas DNS durante su transmisión. 🥳&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué sigue
&lt;/h2&gt;

&lt;p&gt;En la siguiente sección encontrarás los recursos y documentos oficiales de los servicios mencionados, junto con algunos puntos interesantes relacionados con los temas tratados, por si deseas seguir aprendiendo o profundizar para evaluar si realmente aplican a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Te invito también a realizar esta implementación en tu propia cuenta de AWS. Recuerda que, si aún no cuentas con un dominio propio, puedes adquirir uno en Namecheap, ya que comprar un &lt;em&gt;domain name&lt;/em&gt; ahí es, bueno… &lt;em&gt;cheap&lt;/em&gt; jaja. Cuéntame en los comentarios qué te pareció esta guía o si descubriste algo interesante durante tu implementación. ✍🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos oficiales
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/Route53/latest/DeveloperGuide/Welcome.html" rel="noopener noreferrer"&gt;¿Qué es Amazon Route 53?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/Route53/latest/DeveloperGuide/domain-configure-dnssec.html" rel="noopener noreferrer"&gt;Configurar DNSSEC para un dominio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/Route53/latest/DeveloperGuide/dns-configuring-dnssec.html" rel="noopener noreferrer"&gt;Configuración de la firma de DNSSEC en Amazon Route 53&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/kms/pricing/" rel="noopener noreferrer"&gt;Precios de AWS Key Management Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/dns/dnssec/" rel="noopener noreferrer"&gt;Cloudflare Docs: DNSSEC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.namecheap.com/support/knowledgebase/article.aspx/9722/2232/managing-dnssec-for-domains-pointed-to-custom-dns/" rel="noopener noreferrer"&gt;Namecheap: Administrar DNSSEC para dominios que apuntan a DNS personalizados&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>aws</category>
      <category>networking</category>
      <category>dns</category>
    </item>
    <item>
      <title>Secure Your Domain with DNSSEC in Amazon Route 53: A Step-by-Step Guide</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Tue, 28 Oct 2025 14:53:10 +0000</pubDate>
      <link>https://dev.to/cbecerra/secure-your-domain-with-dnssec-in-amazon-route-53-a-step-by-step-guide-328i</link>
      <guid>https://dev.to/cbecerra/secure-your-domain-with-dnssec-in-amazon-route-53-a-step-by-step-guide-328i</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; This article will guide you through implementing DNSSEC for your domains in Amazon Route 53. I’ll show step by step how to enable DNSSEC in your hosted zone in Route 53 and how to establish the chain of trust between the Domain Registrar (Namecheap) and the Authoritative DNS Providers (Cloudflare and Amazon Route 53), all aligned with the Security pillar of the AWS Well-Architected Framework. 🔐&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Estimated reading time:&lt;/strong&gt; 10 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spanish version:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/protege-tu-dominio-con-dnssec-en-amazon-route-53-guia-paso-a-paso-1amd"&gt;Protege tu dominio con DNSSEC en Amazon Route 53: Guía paso a paso&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Table of Contents:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Introduction

&lt;ul&gt;
&lt;li&gt;Recursive DNS Resolution&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;What is DNSSEC&lt;/li&gt;

&lt;li&gt;

How DNSSEC Works

&lt;ul&gt;
&lt;li&gt;Recursive DNS Resolution with DNSSEC&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Why Implement DNSSEC

&lt;ul&gt;
&lt;li&gt;DNS Cache Poisoning without DNSSEC&lt;/li&gt;
&lt;li&gt;DNS Cache Poisoning with DNSSEC Enabled&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;What You Are Going to Implement&lt;/li&gt;

&lt;li&gt;Prerequisites&lt;/li&gt;

&lt;li&gt;

Implementation Steps

&lt;ul&gt;
&lt;li&gt;Configure DNSSEC in Amazon Route 53&lt;/li&gt;
&lt;li&gt;Configure DNSSEC in Cloudflare&lt;/li&gt;
&lt;li&gt;Configure DNSSEC in Namecheap&lt;/li&gt;
&lt;li&gt;Validate the DNSSEC Implementation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Implementation Cost&lt;/li&gt;

&lt;li&gt;Lessons Learned&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;What’s Next&lt;/li&gt;

&lt;li&gt;Official Resources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As we all know, as technology advances, the number of threats and malicious actors increases exponentially, making cybersecurity an ever-growing priority.&lt;/p&gt;

&lt;p&gt;The Domain Name System (DNS) is a fundamental part of the web’s infrastructure; however, its original design lacks robust security mechanisms. In other words, DNS by itself is not secure — it’s vulnerable to attacks such as &lt;em&gt;DNS Spoofing&lt;/em&gt; or &lt;em&gt;DNS Cache Poisoning&lt;/em&gt;, in which malicious actors poison the cache of DNS servers to manipulate records and name resolution to their advantage, redirecting users to malicious websites. 😯&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;DNSSEC&lt;/strong&gt; comes in — an extension of the DNS protocol that protects the integrity and authenticity of the information transmitted during a DNS query, thereby preventing the aforementioned attacks. And you know what’s best? It’s actually very easy to implement! 🤩&lt;/p&gt;

&lt;p&gt;In this article, we’ll explain what DNSSEC is, how it works, what its benefits are, and how to implement it to protect your domains in Amazon Route 53.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recursive DNS Resolution
&lt;/h3&gt;

&lt;p&gt;Before diving into DNSSEC, I’d like to briefly remind you how recursion works during DNS resolution. When a user tries to access a domain, a DNS query is sent to the local DNS server. This server will look for the corresponding record in its DNS cache, and if it’s not found, the &lt;em&gt;DNS Resolver&lt;/em&gt; will start recursive queries to the &lt;em&gt;Root DNS Server&lt;/em&gt; and then to the &lt;em&gt;TLD DNS Server&lt;/em&gt;, until it reaches the &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; that contains the requested record. Finally, that record will be stored in the local DNS cache for the default TTL before returning the corresponding IP address to the user.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fbqfcq4dcqn18shi7su8g.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.amazonaws.com%2Fuploads%2Farticles%2Fbqfcq4dcqn18shi7su8g.png" alt="Recursive DNS Resolution" width="800" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DNSSEC
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DNSSEC (Domain Name System Security Extensions)&lt;/strong&gt; is a set of security extensions for the DNS protocol that allows verification that DNS responses come from an authenticated source and have not been altered during transmission. Its main goal is to prevent threats such as &lt;em&gt;DNS Spoofing&lt;/em&gt;, &lt;em&gt;DNS Cache Poisoning&lt;/em&gt;, and &lt;em&gt;man-in-the-middle&lt;/em&gt; attacks, which can compromise user security by allowing attackers to intercept or modify data in transit to manipulate the information received by users and redirect them to fake websites. 🫤&lt;/p&gt;

&lt;p&gt;When DNSSEC is enabled, each response to a DNS query includes a digital signature based on public key cryptography, and this signature can be verified by the DNS resolver to confirm the authenticity and integrity of the returned information. 😌&lt;/p&gt;

&lt;p&gt;In short, DNSSEC helps ensure that users reach the legitimate website they are looking for, not a fraudulent one. While DNSSEC does not protect the privacy of DNS queries through encryption — since that function belongs to protocols such as &lt;em&gt;TLS (Transport Layer Security)&lt;/em&gt; — it does prevent malicious actors from injecting tampered responses into DNS queries during the name resolution process.&lt;/p&gt;

&lt;p&gt;So far, everything sounds great — but you might be wondering: how does DNSSEC actually work behind the scenes? 🤔&lt;/p&gt;

&lt;h2&gt;
  
  
  How DNSSEC Works
&lt;/h2&gt;

&lt;p&gt;DNSSEC adds an additional layer of security through cryptographic validation to the DNS name resolution process. The operation of DNSSEC is based on several components that work together to establish a &lt;em&gt;chain of trust&lt;/em&gt;, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DNSKEY Records:&lt;/strong&gt; store the public keys used to verify the digital signatures of DNS records. Within these records, there are two types of keys:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ZSK (Zone Signing Key):&lt;/strong&gt; used to sign records within the DNS zone (e.g., A, MX, TXT, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KSK (Key Signing Key):&lt;/strong&gt; used exclusively to sign the ZSK, and its public key is published in the &lt;strong&gt;DS&lt;/strong&gt; record in the parent zone.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;RRSIG Records:&lt;/strong&gt; contain the digital signature for each set of DNS records.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;DS Record:&lt;/strong&gt; links the domain’s public key with its parent zone, thus establishing the chain of trust.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;During the resolution of a domain name, when a user tries to access a website, the &lt;em&gt;recursive resolver&lt;/em&gt; queries the DNS records and verifies the digital signature using the corresponding public key. If the signature is valid, the response is considered trustworthy and accepted. Otherwise, it is assumed that the information may have been tampered with and is therefore considered unsafe, blocking access. ⛔&lt;/p&gt;

&lt;h3&gt;
  
  
  Recursive DNS Resolution with DNSSEC
&lt;/h3&gt;

&lt;p&gt;Now I want to show you how the recursive DNS resolution process looks when DNSSEC is implemented, establishing an end-to-end chain of trust. The recursive resolution is similar, but this time each DNS response includes a &lt;code&gt;DNSKEY&lt;/code&gt; for authenticity validation with the parent domain and a &lt;code&gt;DS&lt;/code&gt; record for validation with a subdomain. In other words, for each DNS response, the &lt;em&gt;DNS Resolver&lt;/em&gt; validates the received &lt;code&gt;DNSKEY&lt;/code&gt; against the corresponding &lt;code&gt;DS&lt;/code&gt; record in the parent domain, and only if the validation succeeds, the DNS response is accepted by the &lt;em&gt;DNS Resolver&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdc1z6czg4wvovc0ym4bt.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.amazonaws.com%2Fuploads%2Farticles%2Fdc1z6czg4wvovc0ym4bt.png" alt="Recursive DNS Resolution with DNSSEC" width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Implement DNSSEC
&lt;/h2&gt;

&lt;p&gt;As I mentioned earlier, DNS by itself is not secure, and by default, we are exposed to attacks such as &lt;em&gt;DNS Spoofing&lt;/em&gt; or &lt;em&gt;DNS Cache Poisoning&lt;/em&gt;. However, these risks can be easily mitigated by configuring DNSSEC on our domains.&lt;/p&gt;

&lt;p&gt;Implementing DNSSEC offers several important benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Protection against tampering:&lt;/strong&gt; prevents attackers from modifying or forging DNS responses during transmission.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Higher level of trust:&lt;/strong&gt; by verifying the authenticity of information, users can be confident they are accessing the correct site.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Defense against cache poisoning and malicious redirections.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved reputation for your brand or project:&lt;/strong&gt; demonstrating a commitment to security is a key factor in improving user perception and experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  DNS Cache Poisoning without DNSSEC
&lt;/h3&gt;

&lt;p&gt;During cache poisoning without DNSSEC, the attacker intercepts the DNS query made by the user and, before the &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; can respond, performs &lt;em&gt;spoofing&lt;/em&gt; by quickly sending a manipulated DNS response to inject a malicious record into the local DNS server. Since the &lt;em&gt;DNS Resolver&lt;/em&gt; has no way to determine whether the response is authentic, due to &lt;em&gt;IP address spoofing&lt;/em&gt;, the local DNS server caches the response for the default TTL, redirecting users to the malicious website. When the legitimate response from the &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; finally arrives, the &lt;em&gt;DNS Resolver&lt;/em&gt; discards it because the DNS query has already been resolved.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Feu4tjq0ddi17f8u6m70d.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.amazonaws.com%2Fuploads%2Farticles%2Feu4tjq0ddi17f8u6m70d.png" alt="DNS Spoofing without DNSSEC" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DNS Cache Poisoning with DNSSEC Enabled
&lt;/h3&gt;

&lt;p&gt;During cache poisoning with DNSSEC enabled, the attacker attempts to inject a manipulated DNS response. However, this time the &lt;em&gt;DNS Resolver&lt;/em&gt;, being &lt;em&gt;DNSSEC-aware&lt;/em&gt;, validates the signature of the DNS response against the public key stored in the &lt;code&gt;DS&lt;/code&gt; record of the parent domain. Since it’s invalid, the malicious DNS response is blocked. In contrast, the legitimate response from the &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; contains a valid signature, so it is accepted and the user is directed to the legitimate website.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fb856gj4pvnjv66aozug8.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.amazonaws.com%2Fuploads%2Farticles%2Fb856gj4pvnjv66aozug8.png" alt="DNS Spoofing with DNSSEC enabled" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In an increasingly technology-dependent environment, protecting the integrity of DNS communications is a priority for everyone. That’s why it’s important to understand how to implement DNSSEC. Moreover, once I show you how simple it is to do, you’ll probably make its implementation a standard practice across all your domains. 🙌🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Are Going to Implement
&lt;/h2&gt;

&lt;p&gt;This guide assumes that you already have a Hosted Zone in Route 53 correctly configured for your domain. What we will do is implement DNSSEC on this Hosted Zone and throughout the entire chain of trust.&lt;/p&gt;

&lt;p&gt;In my case, I have the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain Name Registrar: Namecheap&lt;/li&gt;
&lt;li&gt;Authoritative DNS Provider: Cloudflare&lt;/li&gt;
&lt;li&gt;Managed DNS Service: Amazon Route 53&lt;/li&gt;
&lt;li&gt;Delegated DNS Zone: Amazon Route 53 Hosted Zone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Within the Amazon Route 53 console, we will enable DNSSEC Signing for the Hosted Zone and establish a chain of trust between Amazon Route 53 and Cloudflare, and then between Cloudflare and Namecheap.&lt;/p&gt;

&lt;p&gt;It is worth mentioning that, depending on your particular use case, you may not be using Cloudflare as the Authoritative DNS Provider as in my case, and you might be using Amazon Route 53 directly. You could even use Amazon Route 53 as the Domain Name Registrar as well, which would imply a much shorter and simpler chain of trust when implementing DNSSEC, but this guide assumes that your Domain Name Registrar is not Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnyexug8vxxkiaonbaibt.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.amazonaws.com%2Fuploads%2Farticles%2Fnyexug8vxxkiaonbaibt.png" alt="What You Are Going to Implement" width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;For this DNSSEC implementation, the following prerequisites are required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to an AWS account.&lt;/li&gt;
&lt;li&gt;Administrative access to the Domain Name Registrar (e.g., Namecheap) and ownership of the domain.&lt;/li&gt;
&lt;li&gt;Administrative access to the Authoritative DNS Provider (Cloudflare or Amazon Route 53).&lt;/li&gt;
&lt;li&gt;Administrative access to any secondary or delegated Authoritative DNS Provider within the chain of trust.&lt;/li&gt;
&lt;li&gt;A properly configured and/or delegated Hosted Zone in Amazon Route 53.&lt;/li&gt;
&lt;li&gt;IAM permissions in the AWS account to use &lt;em&gt;Amazon Route 53&lt;/em&gt; and &lt;em&gt;AWS Key Management Service (KMS)&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Implementation Steps
&lt;/h2&gt;

&lt;p&gt;The following sections provide a step-by-step guide for DNSSEC configuration, showing how each component—Amazon Route 53, Cloudflare, and Namecheap—integrates to establish your domain’s chain of trust. First, I will implement trust between Amazon Route 53 and Cloudflare, and then between Cloudflare and Namecheap.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure DNSSEC in Amazon Route 53
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Log in to the Amazon Route 53 console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the list of &lt;em&gt;Hosted Zones&lt;/em&gt;, select the hosted zone where you want to implement DNSSEC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Within the hosted zone, select the &lt;strong&gt;DNSSEC signing&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; In the &lt;em&gt;DNSSEC signing&lt;/em&gt; section, click the &lt;strong&gt;Enable DNSSEC Signing&lt;/strong&gt; button.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fna1qvrb3waul5857lwea.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.amazonaws.com%2Fuploads%2Farticles%2Fna1qvrb3waul5857lwea.png" alt="Enable DNSSEC Signing" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Specify a name for the &lt;em&gt;Key-signing key (KSK)&lt;/em&gt;, for example: &lt;code&gt;my_domain_ksk&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Select an existing &lt;em&gt;Customer managed key (CMK)&lt;/em&gt; or create a new one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this example, a new CMK will be created. Enter the desired name for the key, for example: &lt;code&gt;dnssec_cmk&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Click &lt;strong&gt;Create KSK and enable signing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You will see the message &lt;em&gt;"Enabling DNSSEC signing for the hosted zone"&lt;/em&gt; — this process may take a few minutes.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Frfd3xal6u12pwrvs9hym.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.amazonaws.com%2Fuploads%2Farticles%2Frfd3xal6u12pwrvs9hym.png" alt="Create KSK and enable signing" width="800" height="634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the message &lt;em&gt;"DNSSEC signing was successfully enabled for the hosted zone"&lt;/em&gt; appears, you can verify in the &lt;em&gt;DNSSEC Signing&lt;/em&gt; tab that DNSSEC is in &lt;em&gt;Signing&lt;/em&gt; status, and that the new &lt;em&gt;Key-signing key (KSK)&lt;/em&gt; is active.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; In the &lt;em&gt;DNSSEC Signing&lt;/em&gt; section, click the &lt;strong&gt;View information to create DS Record&lt;/strong&gt; button.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fy06c4u5mavkl7i9xvoyy.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.amazonaws.com%2Fuploads%2Farticles%2Fy06c4u5mavkl7i9xvoyy.png" alt="View information to create DS Record" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; In the &lt;em&gt;Establish a chain of trust&lt;/em&gt; section, locate the &lt;strong&gt;Another domain registrar&lt;/strong&gt; area (if applicable) and review the values for &lt;em&gt;Domain name&lt;/em&gt;, &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Signing algorithm type&lt;/em&gt;, &lt;em&gt;Digest algorithm type&lt;/em&gt;, &lt;em&gt;Digest&lt;/em&gt;, and &lt;em&gt;DS record&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdskouw5tcelkwu2hqqfo.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.amazonaws.com%2Fuploads%2Farticles%2Fdskouw5tcelkwu2hqqfo.png" alt="Establish a chain of trust" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure DNSSEC in Cloudflare
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In &lt;strong&gt;Cloudflare&lt;/strong&gt;, open the &lt;em&gt;Records&lt;/em&gt; list for the corresponding domain and select &lt;strong&gt;Add record&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F13ftlrhxhv7fvtyf5pj6.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.amazonaws.com%2Fuploads%2Farticles%2F13ftlrhxhv7fvtyf5pj6.png" alt="Add record" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Select the &lt;em&gt;record&lt;/em&gt; type &lt;strong&gt;DS&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;Name&lt;/em&gt; field, enter the necessary subdomain to complete the &lt;em&gt;Domain name&lt;/em&gt;, or use &lt;em&gt;@&lt;/em&gt; for the root domain.&lt;/li&gt;
&lt;li&gt;Fill in the corresponding values for &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Signing algorithm type&lt;/em&gt;, &lt;em&gt;Digest algorithm type&lt;/em&gt;, and &lt;em&gt;Digest&lt;/em&gt;, using the information obtained from Route 53.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Save the record.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fl7jsi0256g3cm8kh1vji.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.amazonaws.com%2Fuploads%2Farticles%2Fl7jsi0256g3cm8kh1vji.png" alt="Edit DS Record" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The content of the &lt;code&gt;DS&lt;/code&gt; record must be identical to the &lt;em&gt;DS Record&lt;/em&gt; value generated in Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F2tsuy1b4ocakrcwl14ca.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.amazonaws.com%2Fuploads%2Farticles%2F2tsuy1b4ocakrcwl14ca.png" alt="Review DS Record" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This completes the trust between Amazon Route 53 and Cloudflare. Next, we will establish trust between Cloudflare and Namecheap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; In &lt;strong&gt;Cloudflare&lt;/strong&gt;, open the &lt;strong&gt;DNS Settings&lt;/strong&gt; for the corresponding domain and select &lt;strong&gt;Enable DNSSEC&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F0li9r1pix1wxgd96aonq.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.amazonaws.com%2Fuploads%2Farticles%2F0li9r1pix1wxgd96aonq.png" alt="Enable DNSSEC" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; In the &lt;em&gt;How to enable DNSSEC&lt;/em&gt; tab, review the values for &lt;em&gt;DS record&lt;/em&gt;, &lt;em&gt;Digest&lt;/em&gt;, &lt;em&gt;Digest type&lt;/em&gt;, &lt;em&gt;Algorithm&lt;/em&gt;, and &lt;em&gt;Key tag&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F1oqo282vim2zz31gaxfr.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.amazonaws.com%2Fuploads%2Farticles%2F1oqo282vim2zz31gaxfr.png" alt="How to enable DNSSEC" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Click &lt;strong&gt;Confirm&lt;/strong&gt; to enable DNSSEC.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure DNSSEC in Namecheap
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In &lt;strong&gt;Namecheap&lt;/strong&gt;, select the corresponding domain and go to the &lt;strong&gt;Advanced DNS&lt;/strong&gt; tab.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnabfu7x472ciqjbhzwyi.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.amazonaws.com%2Fuploads%2Farticles%2Fnabfu7x472ciqjbhzwyi.png" alt="Advanced DNS" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the &lt;em&gt;DNSSEC&lt;/em&gt; section, enable the option next to the &lt;strong&gt;Status&lt;/strong&gt; field to activate DNSSEC.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Complete the &lt;code&gt;DS&lt;/code&gt; record with the values for &lt;em&gt;Key tag&lt;/em&gt;, &lt;em&gt;Algorithm&lt;/em&gt;, &lt;em&gt;Digest Type&lt;/em&gt;, and &lt;em&gt;Digest&lt;/em&gt; obtained from Cloudflare, and save the changes.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fd792sko4sawic9ip11p1.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.amazonaws.com%2Fuploads%2Farticles%2Fd792sko4sawic9ip11p1.png" alt="Edit DS Record" width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The content of the &lt;code&gt;DS&lt;/code&gt; record must match the &lt;em&gt;DS Record&lt;/em&gt; value from Cloudflare.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F36bzg946ft6h6odvx0ro.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.amazonaws.com%2Fuploads%2Farticles%2F36bzg946ft6h6odvx0ro.png" alt="Review DS Record" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; In &lt;strong&gt;Cloudflare&lt;/strong&gt;, when reviewing the &lt;em&gt;DNS Settings&lt;/em&gt; of the domain again, you should see the message: &lt;em&gt;"Success! Your domain is protected with DNSSEC"&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F8iyfy57ya3tsv2wjn1rx.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.amazonaws.com%2Fuploads%2Farticles%2F8iyfy57ya3tsv2wjn1rx.png" alt="DNS Settings" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This completes the trust between Cloudflare and Namecheap. At this point, the entire chain of trust required to configure DNSSEC on your Amazon Route 53 Hosted Zone has been successfully established.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validate the DNSSEC Implementation
&lt;/h3&gt;

&lt;p&gt;As a final step, it is important to verify that the DNSSEC configuration is fully functional. For this, you can use online tools such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dnssec-analyzer.verisignlabs.com" rel="noopener noreferrer"&gt;dnssec-analyzer.verisignlabs.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dnssec-debugger.verisignlabs.com" rel="noopener noreferrer"&gt;dnssec-debugger.verisignlabs.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools allow you to enter your domain and check if DNSSEC is properly enabled and configured throughout the chain of trust.&lt;/p&gt;

&lt;p&gt;Below, I am sharing a &lt;em&gt;DNSSEC Analyzer&lt;/em&gt; report with a successful result, demonstrating a correct DNSSEC configuration from Namecheap, through Cloudflare, to Amazon Route 53.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Flbkj0dm7wlahodny2ciw.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.amazonaws.com%2Fuploads%2Farticles%2Flbkj0dm7wlahodny2ciw.png" alt="DNSSEC Analyzer" width="686" height="773"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Implementation Cost
&lt;/h2&gt;

&lt;p&gt;The implementation of DNSSEC by Amazon Route 53 has no cost, and since you already owned the domain, the only associated expense would be for the &lt;em&gt;Customer Managed Key (CMK)&lt;/em&gt; used to generate the &lt;em&gt;Key Signing Key (KSK)&lt;/em&gt;. 💲&lt;/p&gt;

&lt;p&gt;So you will only be charged for the use of AWS KMS according to how you use the keys required for DNSSEC signing of your hosted zones.&lt;/p&gt;

&lt;p&gt;It is important to mention that a &lt;em&gt;CMK&lt;/em&gt; can be reused for signing multiple domains, which helps optimize costs.&lt;/p&gt;

&lt;p&gt;For more information and specific pricing details, check the AWS Key Management Service pricing page, available in the official resources section at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Although the solution is straightforward to implement and low-cost on the AWS bill, you should consider the possible operational complexity in environments where a domain uses multiple DNS providers, as keeping keys and &lt;code&gt;DS&lt;/code&gt; records synchronized can become a complex process and, therefore, prone to errors. 🧐&lt;/p&gt;

&lt;p&gt;In other words, DNSSEC carries an operational cost that is not necessarily inexpensive, as it involves ongoing maintenance and responsibility, key rotation, periodic verification, and the possible update of automations or CI/CD scripts related to DNS infrastructure.&lt;/p&gt;

&lt;p&gt;On the other hand, it is important to remember that DNSSEC guarantees authenticity and integrity, but does not protect against all types of attacks. Threats such as DNS data exfiltration or user privacy require using protocols like &lt;em&gt;DNS-over-HTTPS (DoH)&lt;/em&gt; or &lt;em&gt;DNS-over-TLS (DoT)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Finally, in my experience, a common occurrence is that even after correctly configuring the entire chain of trust to implement DNSSEC, the &lt;em&gt;DNSSEC Analyzer&lt;/em&gt; may still show errors. This can happen because some records have not yet fully propagated, a process that can take several hours. To verify, access &lt;a href="https://dns.google" rel="noopener noreferrer"&gt;dns.google&lt;/a&gt; and check your domain’s &lt;code&gt;DS&lt;/code&gt; record. Review the response &lt;em&gt;data&lt;/em&gt; and confirm it matches the Route 53 DS record; if it does not match, propagation is still incomplete. ⌛&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwf1ywvfndcxheoxtb1r6.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.amazonaws.com%2Fuploads%2Farticles%2Fwf1ywvfndcxheoxtb1r6.png" alt="Google Public DNS" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In a simple and low-cost manner—although still considering potential operational costs—the implementation of DNSSEC strengthens web infrastructure by providing a more secure and reliable domain name system, significantly reducing the risk of unauthorized attacks or modifications to DNS query responses during transmission. 🥳&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;p&gt;In the next section, you’ll find official resources and documentation for the services mentioned, along with some interesting points related to the topics covered — in case you want to keep learning or dive deeper to evaluate whether they truly apply to your use case.&lt;/p&gt;

&lt;p&gt;I also invite you to try this implementation in your own AWS account. Remember that if you do not yet have your own domain, you can purchase one from Namecheap, since buying a domain name there is, well… &lt;em&gt;cheap&lt;/em&gt; haha. Share in the comments what you thought of this guide or if you discovered something interesting during your implementation. ✍🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html" rel="noopener noreferrer"&gt;What is Amazon Route 53?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-configure-dnssec.html" rel="noopener noreferrer"&gt;Configure DNSSEC for a Domain&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec.html" rel="noopener noreferrer"&gt;Configuring DNSSEC Signing in Amazon Route 53&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/kms/pricing/" rel="noopener noreferrer"&gt;AWS Key Management Service Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.cloudflare.com/dns/dnssec/" rel="noopener noreferrer"&gt;Cloudflare Docs: DNSSEC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.namecheap.com/support/knowledgebase/article.aspx/9722/2232/managing-dnssec-for-domains-pointed-to-custom-dns/" rel="noopener noreferrer"&gt;Namecheap: Managing DNSSEC for domains pointed to Custom DNS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>english</category>
      <category>aws</category>
      <category>networking</category>
      <category>dns</category>
    </item>
    <item>
      <title>Protege los orígenes de Amazon CloudFront con funcionalidades de seguridad integradas: Mejores prácticas de AWS</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Sat, 25 Oct 2025 19:49:47 +0000</pubDate>
      <link>https://dev.to/cbecerra/protege-los-origenes-de-amazon-cloudfront-con-funcionalidades-de-seguridad-integradas-mejores-57ll</link>
      <guid>https://dev.to/cbecerra/protege-los-origenes-de-amazon-cloudfront-con-funcionalidades-de-seguridad-integradas-mejores-57ll</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; En este artículo te mostraré cómo y por qué debes proteger los orígenes de Amazon CloudFront usando múltiples funcionalidades de seguridad integradas que he puesto en práctica personalmente, junto con el caso de uso y los beneficios de cada una, para lograr un origen protegido y resiliente, todo ello alineado con los pilares de Seguridad y Fiabilidad del AWS Well-Architected Framework. 🌐&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tiempo estimado de lectura:&lt;/strong&gt; 15 minutos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nivel:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versión en inglés:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/protect-amazon-cloudfront-origins-with-built-in-security-features-aws-best-practices-4pln"&gt;Protect Amazon CloudFront Origins with Built-in Security Features: AWS Best Practices&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tabla de Contenidos:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introducción&lt;/li&gt;
&lt;li&gt;Por qué proteger los orígenes de Amazon CloudFront&lt;/li&gt;
&lt;li&gt;
Funcionalidades de seguridad integradas de CloudFront

&lt;ul&gt;
&lt;li&gt;Restricción del acceso al Application Load Balancer&lt;/li&gt;
&lt;li&gt;Restricción del acceso a un origen de Amazon S3&lt;/li&gt;
&lt;li&gt;Restricción del acceso con orígenes de la VPC&lt;/li&gt;
&lt;li&gt;Listas de prefijos administradas por AWS&lt;/li&gt;
&lt;li&gt;Rangos de direcciones IP de AWS&lt;/li&gt;
&lt;li&gt;Restricción de la distribución geográfica&lt;/li&gt;
&lt;li&gt;Cifrado a nivel de campo&lt;/li&gt;
&lt;li&gt;CloudFront Origin Shield&lt;/li&gt;
&lt;li&gt;AWS WAF Core Protections&lt;/li&gt;
&lt;li&gt;CloudFront Origin Groups&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lecciones Aprendidas&lt;/li&gt;

&lt;li&gt;Conclusión&lt;/li&gt;

&lt;li&gt;Qué sigue&lt;/li&gt;

&lt;li&gt;Recursos oficiales&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;Si has oído hablar de &lt;strong&gt;Amazon CloudFront&lt;/strong&gt;, sabes que es un servicio de &lt;em&gt;Content Delivery Network (CDN)&lt;/em&gt; que nos ayuda a distribuir contenido estático y dinámico de forma rápida y confiable. CloudFront entrega el contenido a nuestros usuarios a través de una red global de centros de datos conocidos como ubicaciones de borde. Cuando un usuario solicita contenido que estás sirviendo mediante CloudFront, la solicitud se enruta a la ubicación de borde más cercana al usuario —o a la que proporcione la menor latencia— para que el contenido sea entregado con el mejor rendimiento posible.&lt;/p&gt;

&lt;p&gt;Si tu contenido es estático, CloudFront te permite almacenarlo en caché, de modo que las solicitudes se atiendan directamente desde el caché y no lleguen al origen, reduciendo así la carga en este. Por otro lado, si tu contenido es dinámico, no se debe almacenar en caché, pero CloudFront permite enrutar la solicitud del usuario hacia el origen a través de la infraestructura de red global de AWS, optimizando la latencia y el rendimiento. 🤩&lt;/p&gt;

&lt;p&gt;Cuando empezamos a familiarizarnos con Amazon CloudFront, es común que no conozcamos las mejores prácticas de seguridad recomendadas y, sin querer, las omitamos, dejando nuestros orígenes desprotegidos o vulnerables. Un error frecuente es no restringir el acceso a los orígenes exclusivamente a CloudFront, lo que puede permitir el acceso directo al origen desde rutas no controladas, ocasionando comportamientos no deseados o brechas de seguridad. Para evitar estos problemas, en este artículo te explicaré por qué es importante proteger los orígenes de Amazon CloudFront, además de presentarte múltiples funcionalidades de seguridad integradas que he puesto en práctica y que están alineadas con las mejores prácticas de AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Por qué proteger los orígenes de Amazon CloudFront
&lt;/h2&gt;

&lt;p&gt;En el mundo actual, la tecnología avanza a un ritmo acelerado, y con ello las amenazas de ciberseguridad crecen exponencialmente. Por esta razón, la seguridad se ha convertido en una prioridad fundamental.&lt;/p&gt;

&lt;p&gt;Amazon CloudFront nos permite añadir una capa adicional de protección entre nuestros usuarios y los orígenes, los cuales pueden ser balanceadores, servidores, contenedores, entre otros. En lugar de dirigir a los usuarios directamente hacia los orígenes, los redirigimos a través de CloudFront, que actúa como intermediario para recuperar el contenido solicitado y entregarlo posteriormente al usuario.&lt;/p&gt;

&lt;p&gt;Al usar CloudFront para crear una distribución estamos añadiendo una capa adicional a nuestro sistema, aunque inicialmente solo se haya pensado en mejorar el rendimiento y la velocidad, estamos incorporando un nuevo componente a nuestra arquitectura que también debe ser protegido. CloudFront ofrece un conjunto de funcionalidades de seguridad integradas que ayudan a proteger nuestros orígenes. Proporciona una defensa adicional frente a múltiples tipos de ataques, incluidos los ataques DDoS, y se integra directamente con &lt;em&gt;AWS WAF&lt;/em&gt; y &lt;em&gt;AWS Shield&lt;/em&gt;. 🛡️&lt;/p&gt;

&lt;p&gt;Sin embargo, de poco sirve implementar múltiples medidas de seguridad en la distribución de CloudFront si nuestros orígenes no están protegidos o si la comunicación hacia ellos no está restringida exclusivamente a CloudFront. Esto dejaría nuestros orígenes expuestos a amenazas y vulnerabilidades que podrían pasar inadvertidas bajo la falsa percepción de que todo el tráfico pasa únicamente por CloudFront. Por estas razones, proteger los orígenes de Amazon CloudFront es un paso esencial para garantizar la seguridad y la integridad de nuestras aplicaciones.&lt;/p&gt;




&lt;h2&gt;
  
  
  Funcionalidades de seguridad integradas de CloudFront
&lt;/h2&gt;

&lt;p&gt;En las siguientes secciones te presentaré diversas funcionalidades de seguridad integradas que he puesto en práctica, las cuales están alineadas con las mejores prácticas de AWS y que considero podrían resultarte muy útiles conocer. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nota:&lt;/strong&gt; En la sección de recursos oficiales al final encontrarás toda la documentación de AWS correspondiente a cada una de las funcionalidades mencionadas a continuación.&lt;/p&gt;

&lt;h3&gt;
  
  
  Restricción del acceso al Application Load Balancer
&lt;/h3&gt;

&lt;p&gt;Cuando utilizas un balanceador de carga público (ALB) como origen de una distribución de Amazon CloudFront, este sigue siendo accesible desde Internet de forma predeterminada, y no únicamente a través de CloudFront. Para restringir el acceso al balanceador público de modo que solo sea posible mediante la distribución de CloudFront, puedes usar un &lt;strong&gt;encabezado HTTP personalizado&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;En la distribución de CloudFront, para el origen específico que deseas proteger, añade un encabezado HTTP personalizado con un valor secreto, el cual no debe exponerse públicamente. De esta forma, CloudFront incluirá este encabezado en todas las solicitudes que envíe al origen (ALB).&lt;/p&gt;

&lt;p&gt;Posteriormente, configura el &lt;em&gt;listener&lt;/em&gt; del Application Load Balancer para que únicamente reenvíe las solicitudes a sus targets cuando estas contengan el encabezado HTTP personalizado con el valor secreto especificado. Así, el ALB descartará cualquier solicitud que no contenga dicho encabezado, garantizando que solo el tráfico proveniente de CloudFront sea aceptado.&lt;/p&gt;

&lt;p&gt;Te recomiendo renovar el valor secreto del encabezado HTTP personalizado al menos una vez al año, como medida preventiva ante posibles filtraciones de seguridad.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F5z4af3xes2xxmilirzdi.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.amazonaws.com%2Fuploads%2Farticles%2F5z4af3xes2xxmilirzdi.png" alt="Restricción del acceso al Application Load Balancer" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restricción del acceso a un origen de Amazon S3
&lt;/h3&gt;

&lt;p&gt;Cuando utilizas un &lt;em&gt;bucket&lt;/em&gt; de Amazon S3 como origen de una distribución de Amazon CloudFront, este permanece accesible desde Internet de forma predeterminada, y no únicamente a través de CloudFront. Para restringir el acceso a los objetos del bucket de modo que solo sea posible mediante la distribución de CloudFront, puedes utilizar &lt;strong&gt;Origin Access Control (OAC)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Origin Access Control (OAC)&lt;/em&gt; nos permite proteger los orígenes de S3 y, a diferencia de su predecesor &lt;em&gt;Origin Access Identity (OAI)&lt;/em&gt;, es compatible con todos los buckets de S3 en todas las regiones de AWS. Además, ofrece soporte para cifrado mediante AWS KMS y permite solicitudes dinámicas (como &lt;code&gt;PUT&lt;/code&gt; y &lt;code&gt;DELETE&lt;/code&gt;) hacia Amazon S3.&lt;/p&gt;

&lt;p&gt;Para implementar &lt;em&gt;Origin Access Control (OAC)&lt;/em&gt;, en el origen específico que deseas proteger, simplemente crea un nuevo &lt;em&gt;origin access control&lt;/em&gt; en lugar de utilizar un origen de acceso público, y actualiza la &lt;em&gt;bucket policy&lt;/em&gt; del bucket de S3 añadiendo el &lt;em&gt;statement&lt;/em&gt; proporcionado por CloudFront, el cual tiene la siguiente estructura:&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2008-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PolicyForCloudFrontPrivateContent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AllowCloudFrontServicePrincipal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cloudfront.amazonaws.com"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;Bucket Name&amp;gt;/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"StringEquals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"AWS:SourceArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:cloudfront::&amp;lt;Account ID&amp;gt;:distribution/&amp;lt;Distribution ID&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&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.amazonaws.com%2Fuploads%2Farticles%2F804ngg3bg9lrcf3sxbom.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.amazonaws.com%2Fuploads%2Farticles%2F804ngg3bg9lrcf3sxbom.png" alt="Restricción del acceso a un origen de Amazon S3" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restricción del acceso con orígenes de la VPC
&lt;/h3&gt;

&lt;p&gt;Hasta hace relativamente poco tiempo, CloudFront solo permitía configurar orígenes públicos. Es decir, si se deseaba colocar un balanceador de carga o una instancia EC2 detrás de una distribución de CloudFront, estos debían contar obligatoriamente con un DNS resolvible a una dirección IP pública.&lt;/p&gt;

&lt;p&gt;A finales de 2024, AWS introdujo &lt;strong&gt;CloudFront Virtual Private Cloud (VPC) Origins&lt;/strong&gt;, una funcionalidad que permite asignar como orígenes a balanceadores privados o instancias EC2 privadas ubicadas en subredes privadas dentro de una VPC. ¡Ya no es necesario que sean públicos!&lt;/p&gt;

&lt;p&gt;Para implementar &lt;em&gt;VPC Origins&lt;/em&gt;, simplemente crea un nuevo &lt;em&gt;VPC Origin&lt;/em&gt; en CloudFront, especificando el ARN del ELB privado o de la instancia EC2 privada. El grupo de seguridad asociado a estos recursos privados debe seguir permitiendo el acceso desde las direcciones IP de CloudFront.&lt;/p&gt;

&lt;p&gt;Si bien podrías permitir acceso entrante desde Internet —dado que no se trata de un recurso público—, si deseas evitar que otros recursos privados dentro de la misma VPC puedan acceder al origen y garantizar que solo CloudFront tenga acceso, lo más recomendable es utilizar &lt;em&gt;prefix lists&lt;/em&gt;. Para ello, revisa la siguiente sección.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnmdouut8kq0d6kloenbn.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.amazonaws.com%2Fuploads%2Farticles%2Fnmdouut8kq0d6kloenbn.png" alt="Restricción del acceso con orígenes de la VPC" width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Listas de prefijos administradas por AWS
&lt;/h3&gt;

&lt;p&gt;Cuando en múltiples grupos de seguridad necesitas permitir acceso a un mismo conjunto de direcciones IP, en lugar de agregar manualmente cada dirección IP en todos los grupos, puedes crear una &lt;em&gt;prefix list&lt;/em&gt;. En este caso, hablamos de una lista de prefijos administrada por el cliente, es decir, por nosotros, y sería nuestra responsabilidad mantener actualizada dicha lista de direcciones IP.&lt;/p&gt;

&lt;p&gt;Por otro lado, una necesidad común al trabajar con recursos dentro de una VPC es limitar el tráfico entrante o saliente únicamente a ciertos servicios de AWS. Aunque es posible obtener el listado de direcciones IP públicas de cada servicio, estas cambian constantemente, y mantenerlas actualizadas manualmente sería una tarea compleja y propensa a errores. Para ello, AWS ofrece las &lt;strong&gt;AWS-managed prefix lists&lt;/strong&gt;, listas de prefijos administradas y actualizadas automáticamente por AWS, que permiten filtrar las direcciones IP de varios servicios como Amazon CloudFront, Amazon DynamoDB, Amazon S3, entre otros.&lt;/p&gt;

&lt;p&gt;Como se mencionó en la sección anterior, si deseamos permitir tráfico hacia nuestros recursos en una VPC únicamente desde las direcciones IP de CloudFront, podemos aprovechar la &lt;em&gt;AWS-managed prefix list&lt;/em&gt; correspondiente a Amazon CloudFront. Para ello, basta con especificar la &lt;em&gt;Prefix List (pl)&lt;/em&gt; como origen o destino en las reglas del grupo de seguridad.&lt;/p&gt;

&lt;p&gt;Esta funcionalidad resulta sumamente útil al trabajar con orígenes dentro de una VPC. Sin embargo, si el origen se encuentra &lt;em&gt;On-Premises&lt;/em&gt;, ya sea con conectividad híbrida a AWS mediante una &lt;em&gt;Site-to-Site VPN&lt;/em&gt; o &lt;em&gt;AWS Direct Connect&lt;/em&gt;, o incluso totalmente desconectado de AWS y accesible mediante una dirección IP pública, en ese caso no es posible utilizar &lt;em&gt;prefix lists&lt;/em&gt;. Para dichos escenarios, revisa la siguiente sección.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ffhf5xsbkz6n27pcf7svt.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.amazonaws.com%2Fuploads%2Farticles%2Ffhf5xsbkz6n27pcf7svt.png" alt="Listas de prefijos administradas por AWS" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Rangos de direcciones IP de AWS
&lt;/h3&gt;

&lt;p&gt;Como se mencionó en la sección anterior, sí es posible obtener el listado de direcciones IP públicas de cada servicio de AWS. Y si bien, cuando nos encontramos en una VPC podemos aprovechar las &lt;em&gt;prefix lists&lt;/em&gt;, cuando trabajamos en entornos &lt;em&gt;On-Premises&lt;/em&gt; fuera de AWS nos vemos obligados a utilizar el listado de direcciones IP públicas de AWS.&lt;/p&gt;

&lt;p&gt;Para esto, AWS mantiene su listado de direcciones IP públicas actualizado en formato JSON en el archivo &lt;strong&gt;&lt;a href="https://ip-ranges.amazonaws.com/ip-ranges.json" rel="noopener noreferrer"&gt;ip-ranges.json&lt;/a&gt;&lt;/strong&gt;. Usando las direcciones IP de este listado puedes configurar tu firewall &lt;em&gt;On-Premises&lt;/em&gt;. Pero quizá ahora te estés preguntando: ¿cómo mantendré mi firewall actualizado si las direcciones IP de Amazon cambian constantemente?&lt;/p&gt;

&lt;p&gt;No te preocupes, Amazon pensó en eso y creó un &lt;em&gt;topic&lt;/em&gt; de SNS al cual puedes suscribirte para recibir notificaciones sobre actualizaciones en el archivo &lt;em&gt;ip-ranges.json&lt;/em&gt;. El ARN del &lt;em&gt;topic&lt;/em&gt; es: &lt;code&gt;arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged&lt;/code&gt;. Solo debes suscribirte al &lt;em&gt;topic&lt;/em&gt; y desarrollar una pequeña automatización local que procese las notificaciones y actualice las reglas de tu firewall &lt;em&gt;On-Premises&lt;/em&gt; según corresponda.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwzz3nfleuqdu2ucd865f.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.amazonaws.com%2Fuploads%2Farticles%2Fwzz3nfleuqdu2ucd865f.png" alt="Rangos de direcciones IP de AWS" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restricción de la distribución geográfica
&lt;/h3&gt;

&lt;p&gt;Esta sección es simple. Puedes mejorar la seguridad de tu origen configurando &lt;strong&gt;restricciones geográficas&lt;/strong&gt; en tu distribución, siempre y cuando se adapten a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Para ello, CloudFront te permite implementar una &lt;em&gt;allow list&lt;/em&gt; o &lt;em&gt;block list&lt;/em&gt; en tu distribución y especificar todos los países que necesites permitir o bloquear.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fsybe00qn3408e7uzz78o.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.amazonaws.com%2Fuploads%2Farticles%2Fsybe00qn3408e7uzz78o.png" alt="Restricción de la distribución geográfica" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cifrado a nivel de campo
&lt;/h3&gt;

&lt;p&gt;Esta sección aborda un caso de uso particular que ocurre cuando, dentro de la solicitud que realiza el cliente a CloudFront, se incluye un &lt;em&gt;payload&lt;/em&gt; con múltiples campos, de los cuales algunos contienen datos sensibles. Los campos con datos sensibles deben ser visibles únicamente para el destino final, mientras que cualquier recurso de red o cómputo intermedio debería ver dichos campos cifrados. Sin embargo, no podemos cifrar toda la solicitud, ya que este caso de uso requiere que los recursos intermedios puedan visualizar sin problemas todos los demás campos con datos no sensibles.&lt;/p&gt;

&lt;p&gt;Aquí es donde entra el cifrado a nivel de campo. Supongamos que el cliente envía una solicitud cuyo &lt;em&gt;payload&lt;/em&gt; contiene tanto campos con datos no sensibles como campos con datos sensibles, tales como &lt;em&gt;PII&lt;/em&gt;, &lt;em&gt;PHI&lt;/em&gt;, información confidencial, credenciales, entre otros. Entre CloudFront y el destino final existen múltiples recursos intermedios, y ninguno de ellos debería ser capaz de ver los datos sensibles, aunque sí necesitan poder procesar los campos no sensibles. En este escenario, implementamos el &lt;strong&gt;cifrado a nivel de campo&lt;/strong&gt; proporcionado por CloudFront.&lt;/p&gt;

&lt;p&gt;Para implementar el cifrado a nivel de campo, simplemente debemos crear un &lt;em&gt;encryption profile&lt;/em&gt; en CloudFront, el cual debe especificar los campos de datos a cifrar y la clave pública que se utilizará para dicho cifrado, previamente almacenada en CloudFront. Por otro lado, el destino final, por ejemplo, un servidor de aplicaciones, debe contar con la clave privada correspondiente y estar configurado para descifrar los campos cifrados. Solo el servidor final posee la clave privada, por lo que, de este modo, se protege la confidencialidad de los datos sensibles frente a los recursos intermedios, sin limitar el procesamiento de los datos no sensibles en una misma solicitud.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ft7syei5030s9czsgfexh.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.amazonaws.com%2Fuploads%2Farticles%2Ft7syei5030s9czsgfexh.png" alt="Cifrado a nivel de campo" width="800" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Origin Shield
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Origin Shield&lt;/strong&gt; es una capa adicional de caché que puede ayudar a reducir la carga en tu origen y, con ello, proteger su disponibilidad. Los principales casos de uso incluyen escenarios con usuarios en distintas regiones geográficas o cuando se trabaja con múltiples CDN.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Origin Shield&lt;/em&gt; mejora la tasa de aciertos en caché, disminuye la carga en el origen y optimiza el rendimiento de la red. El flujo de una solicitud en CloudFront sin &lt;em&gt;Origin Shield&lt;/em&gt; pasa por las &lt;em&gt;Edge Locations&lt;/em&gt;, luego por los &lt;em&gt;Regional Edge Caches&lt;/em&gt; y, finalmente, llega al origen. En este caso, múltiples regiones podrían estar consultando el origen de forma innecesaria. Para evitarlo, al activar &lt;em&gt;Origin Shield&lt;/em&gt;, se coloca una capa adicional entre los &lt;em&gt;Regional Edge Caches&lt;/em&gt; y el origen, de modo que únicamente &lt;em&gt;Origin Shield&lt;/em&gt; enviará solicitudes al origen, reduciendo así su carga.&lt;/p&gt;

&lt;p&gt;Para usar &lt;em&gt;Origin Shield&lt;/em&gt;, dentro de tu distribución selecciona el origen, activa &lt;em&gt;Origin Shield&lt;/em&gt; y elige la región de AWS donde deseas desplegarlo.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ff7lebzs1fklttxelyaiy.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.amazonaws.com%2Fuploads%2Farticles%2Ff7lebzs1fklttxelyaiy.png" alt="CloudFront Origin Shield" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS WAF Core Protections
&lt;/h3&gt;

&lt;p&gt;CloudFront tiene una integración directa con &lt;strong&gt;AWS WAF&lt;/strong&gt; y permite añadir una capa de seguridad básica con un solo clic, lo cual crea en segundo plano un &lt;em&gt;Web ACL&lt;/em&gt; con la protección predeterminada que tu aplicación necesita.&lt;/p&gt;

&lt;p&gt;La protección predeterminada de WAF para CloudFront incluye defensa frente a vulnerabilidades comunes como las del &lt;em&gt;OWASP Top 10&lt;/em&gt;, &lt;em&gt;SQL Injection&lt;/em&gt;, &lt;em&gt;Rate Limiting&lt;/em&gt; y bloqueo de tráfico proveniente de direcciones IP maliciosas basadas en la inteligencia de amenazas de Amazon. Sin embargo, si lo consideras necesario —y de hecho es lo recomendable—, personaliza tu &lt;em&gt;Web ACL&lt;/em&gt; según tus requerimientos y añade las reglas adicionales que estimes convenientes para fortalecer la seguridad de tu origen.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fym3ppj96pnn06zrwxmu8.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.amazonaws.com%2Fuploads%2Farticles%2Fym3ppj96pnn06zrwxmu8.png" alt="AWS WAF Core Protections" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Origin Groups
&lt;/h3&gt;

&lt;p&gt;Esta funcionalidad, técnicamente, no constituye una medida de seguridad, sino de resiliencia, pero quiero mencionarla porque la he probado y me parece particularmente interesante.&lt;/p&gt;

&lt;p&gt;Como sabrás, CloudFront es un servicio global, pero los orígenes probablemente no lo sean. Es decir, en el evento de una caída regional o de una zona de disponibilidad, la aplicación podría dejar de responder, incluso si la distribución de CloudFront en sí misma no se ve afectada.&lt;/p&gt;

&lt;p&gt;Para manejar este tipo de situaciones, &lt;strong&gt;CloudFront Origin Groups&lt;/strong&gt; nos permite configurar una solución de &lt;em&gt;failover&lt;/em&gt; de manera sencilla. Solo debemos crear un &lt;em&gt;Origin Group&lt;/em&gt; en el cual se especifiquen múltiples orígenes y el criterio de conmutación por error, es decir, los &lt;em&gt;HTTP Status Codes&lt;/em&gt; que debe recibir CloudFront para activar el &lt;em&gt;failover&lt;/em&gt; hacia otro origen ubicado en una región distinta.&lt;/p&gt;

&lt;p&gt;De este modo, &lt;em&gt;CloudFront Origin Groups&lt;/em&gt; nos permite mantener una alta disponibilidad ante una falla regional: la misma distribución global sigue activa, simplemente redirigiendo las solicitudes hacia otro origen dentro del grupo, pero ubicado en una región diferente.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fi8up1dzz0mg89p4hkx3g.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.amazonaws.com%2Fuploads%2Farticles%2Fi8up1dzz0mg89p4hkx3g.png" alt="CloudFront Origin Groups" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Lecciones Aprendidas
&lt;/h2&gt;

&lt;p&gt;Nunca olvides restringir el acceso a los orígenes. En la mayoría de los casos, cuando implementas CloudFront, la distribución debería ser la única con acceso al origen. Por ello, es común implementar todos los mecanismos de defensa en la distribución de CloudFront; sin embargo, si no restringes el acceso al origen, este quedará vulnerable a amenazas que probablemente no habías considerado por haberte enfocado únicamente en proteger la distribución. 😶&lt;/p&gt;

&lt;p&gt;Si necesitas implementar AWS WAF para tu aplicación, casi siempre deberías adjuntar el &lt;em&gt;Web ACL&lt;/em&gt; a la distribución de CloudFront, en lugar de, por ejemplo, al origen ALB. Siempre tendrá más sentido aplicar WAF a nivel de la distribución, de modo que el tráfico sea filtrado lo más arriba posible, reduciendo así la carga y el costo del procesamiento de datos en el ALB. 😎&lt;/p&gt;

&lt;p&gt;Te recomiendo utilizar la georrestricción siempre que sea posible y, por supuesto, cuando aplique a tu caso de uso. En mi experiencia, dependiendo de la región en la que te encuentres, la georrestricción puede ser una de las formas más sencillas de evitar tráfico no deseado de bots de scraping, dado que este tipo de tráfico suele provenir de países específicos. 🤖&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;Amazon CloudFront cuenta con múltiples funcionalidades de seguridad integradas que nos permiten proteger los orígenes, abarcando desde &lt;em&gt;failover&lt;/em&gt;, &lt;em&gt;firewall&lt;/em&gt;, &lt;em&gt;georrestricción&lt;/em&gt;, &lt;em&gt;capas adicionales de caché&lt;/em&gt;, &lt;em&gt;cifrado a nivel de campo&lt;/em&gt; y, principalmente, la &lt;em&gt;restricción del acceso al origen&lt;/em&gt;. Todo esto nos permite consolidar diversos mecanismos de protección a nivel perimetral en la distribución de CloudFront, reforzando así la postura de seguridad de nuestras aplicaciones mediante una estrategia de &lt;strong&gt;defensa en profundidad&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué sigue
&lt;/h2&gt;

&lt;p&gt;En la siguiente sección encontrarás los recursos y documentos oficiales de AWS para las funcionalidades de seguridad integradas de Amazon CloudFront mencionadas en este artículo, por si deseas seguir aprendiendo o profundizar para evaluar si realmente aplican a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Te invito también a realizar la implementación de estas funcionalidades de seguridad integradas de CloudFront en tu propia cuenta de AWS. Cuéntame en los comentarios qué te pareció este artículo o si descubriste algo interesante sobre alguna característica de Amazon CloudFront durante tu implementación. ✍🏻&lt;/p&gt;

&lt;p&gt;Y para mí, un próximo paso será probar la integración de &lt;em&gt;AWS Shield Advanced&lt;/em&gt; con CloudFront en un futuro, ya que hasta ahora no he tenido la oportunidad de ver en acción la lógica de mitigación DDoS de AWS Shield aplicada a CloudFront.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos oficiales
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/restrict-access-to-load-balancer.html" rel="noopener noreferrer"&gt;Restricción del acceso a Application Load Balancer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html" rel="noopener noreferrer"&gt;Restricción del acceso a un origen de Amazon S3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/private-content-vpc-origins.html" rel="noopener noreferrer"&gt;Restricción del acceso con orígenes de la VPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/userguide/working-with-aws-managed-prefix-lists.html" rel="noopener noreferrer"&gt;Listas de prefijos administradas por AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/userguide/aws-ip-ranges.html" rel="noopener noreferrer"&gt;Rangos de direcciones IP de AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html" rel="noopener noreferrer"&gt;Restricción de la distribución geográfica de su contenido&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html" rel="noopener noreferrer"&gt;Uso del cifrado a nivel de campo para ayudar a proteger la información confidencial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html" rel="noopener noreferrer"&gt;Uso de Amazon CloudFront Origin Shield&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/waf/latest/developerguide/cloudfront-features.html" rel="noopener noreferrer"&gt;Uso de AWS WAF con Amazon CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html" rel="noopener noreferrer"&gt;Optimización de alta disponibilidad con conmutación por error de origen de CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/waf/latest/developerguide/ddos-event-mitigation-logic-continuous-inspection.html" rel="noopener noreferrer"&gt;Lógica de mitigación de AWS Shield para CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>aws</category>
      <category>networking</category>
      <category>cdn</category>
    </item>
    <item>
      <title>Protect Amazon CloudFront Origins with Built-in Security Features: AWS Best Practices</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Sat, 25 Oct 2025 19:48:47 +0000</pubDate>
      <link>https://dev.to/cbecerra/protect-amazon-cloudfront-origins-with-built-in-security-features-aws-best-practices-4pln</link>
      <guid>https://dev.to/cbecerra/protect-amazon-cloudfront-origins-with-built-in-security-features-aws-best-practices-4pln</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; In this article, I will show you how and why you should protect Amazon CloudFront origins using multiple built-in security features that I have personally implemented, along with the use case and benefits of each, to achieve a protected and resilient origin, all aligned with the Security and Reliability pillars of the AWS Well-Architected Framework. 🌐&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Estimated reading time:&lt;/strong&gt; 15 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spanish version:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/protege-los-origenes-de-amazon-cloudfront-con-funcionalidades-de-seguridad-integradas-mejores-57ll"&gt;Protege los orígenes de Amazon CloudFront con funcionalidades de seguridad integradas: Mejores prácticas de AWS&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Table of Contents:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why Protect Amazon CloudFront Origins&lt;/li&gt;
&lt;li&gt;
Built-in CloudFront Security Features

&lt;ul&gt;
&lt;li&gt;Restrict Access to Application Load Balancers&lt;/li&gt;
&lt;li&gt;Restrict Access to an Amazon S3 Origin&lt;/li&gt;
&lt;li&gt;Restrict Access with VPC Origins&lt;/li&gt;
&lt;li&gt;AWS-Managed Prefix Lists&lt;/li&gt;
&lt;li&gt;AWS IP Address Ranges&lt;/li&gt;
&lt;li&gt;CloudFront Geographic Restrictions&lt;/li&gt;
&lt;li&gt;CloudFront Field-Level Encryption&lt;/li&gt;
&lt;li&gt;CloudFront Origin Shield&lt;/li&gt;
&lt;li&gt;AWS WAF Core Protections&lt;/li&gt;
&lt;li&gt;CloudFront Origin Groups&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lessons Learned&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;What's Next&lt;/li&gt;

&lt;li&gt;Official Resources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you’ve heard of &lt;strong&gt;Amazon CloudFront&lt;/strong&gt;, you know it is a &lt;em&gt;Content Delivery Network (CDN)&lt;/em&gt; service that helps us distribute static and dynamic content quickly and reliably. CloudFront delivers content to our users through a global network of data centers known as edge locations. When a user requests content you’re serving via CloudFront, the request is routed to the edge location closest to the user—or the one that provides the lowest latency—so that the content is delivered with the best possible performance.&lt;/p&gt;

&lt;p&gt;If your content is static, CloudFront allows you to cache it so that requests are served directly from the cache and do not reach the origin, thus reducing the load on it. On the other hand, if your content is dynamic, it should not be cached, but CloudFront enables routing the user’s request to the origin through AWS’s global network infrastructure, optimizing latency and performance. 🤩&lt;/p&gt;

&lt;p&gt;When we start getting familiar with Amazon CloudFront, it’s common not to know the recommended security best practices and inadvertently skip them, leaving our origins unprotected or vulnerable. A frequent mistake is not restricting access to origins exclusively to CloudFront, which can allow direct access to the origin through uncontrolled routes, leading to undesired behavior or security breaches. To prevent these issues, in this article I will explain why it’s important to protect Amazon CloudFront origins, as well as present multiple built-in security features that I have implemented and that align with AWS best practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Protect Amazon CloudFront Origins
&lt;/h2&gt;

&lt;p&gt;In today’s world, technology advances at a rapid pace, and with it, cybersecurity threats grow exponentially. For this reason, security has become a fundamental priority.&lt;/p&gt;

&lt;p&gt;Amazon CloudFront allows us to add an extra layer of protection between our users and the origins, which can be load balancers, servers, containers, among others. Instead of directing users straight to the origins, we redirect them through CloudFront, which acts as an intermediary to retrieve the requested content and then deliver it to the user.&lt;/p&gt;

&lt;p&gt;By using CloudFront to create a distribution, we are adding an additional layer to our system. Even if the initial goal was only to improve performance and speed, we are incorporating a new component into our architecture that also needs protection. CloudFront offers a set of built-in security features that help protect our origins. It provides additional defense against multiple types of attacks, including DDoS attacks, and integrates directly with &lt;em&gt;AWS WAF&lt;/em&gt; and &lt;em&gt;AWS Shield&lt;/em&gt;. 🛡️&lt;/p&gt;

&lt;p&gt;However, implementing multiple security measures on the CloudFront distribution is of little use if our origins are not protected or if communication to them is not restricted exclusively to CloudFront. This would leave our origins exposed to threats and vulnerabilities that could go unnoticed under the false perception that all traffic passes solely through CloudFront. For these reasons, protecting Amazon CloudFront origins is an essential step to ensure the security and integrity of our applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  Built-in CloudFront Security Features
&lt;/h2&gt;

&lt;p&gt;In the following sections, I will present various built-in security features that I have personally implemented, which are aligned with AWS best practices and that I believe you will find very useful to know. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In the official resources section at the end, you will find all the corresponding AWS documentation for each of the features mentioned below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Restrict Access to Application Load Balancers
&lt;/h3&gt;

&lt;p&gt;When you use a public load balancer (ALB) as the origin of an Amazon CloudFront distribution, it remains accessible from the Internet by default, not just through CloudFront. To restrict access to the public load balancer so that it is only possible via the CloudFront distribution, you can use a &lt;strong&gt;custom HTTP header&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the CloudFront distribution, for the specific origin you want to protect, add a custom HTTP header with a secret value, which must not be publicly exposed. This way, CloudFront will include this header in all requests it sends to the origin (ALB).&lt;/p&gt;

&lt;p&gt;Then, configure the Application Load Balancer listener to only forward requests to its targets when they contain the custom HTTP header with the specified secret value. This ensures that the ALB will discard any request that does not contain this header, guaranteeing that only traffic coming from CloudFront is accepted.&lt;/p&gt;

&lt;p&gt;It is recommended to renew the secret value of the custom HTTP header at least once a year as a precaution against potential security leaks.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F5z4af3xes2xxmilirzdi.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.amazonaws.com%2Fuploads%2Farticles%2F5z4af3xes2xxmilirzdi.png" alt="Restrict Access to Application Load Balancers" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restrict Access to an Amazon S3 Origin
&lt;/h3&gt;

&lt;p&gt;When you use an Amazon S3 bucket as the origin of an Amazon CloudFront distribution, it remains accessible from the Internet by default, not just through CloudFront. To restrict access to the bucket objects so that it is only possible via the CloudFront distribution, you can use &lt;strong&gt;Origin Access Control (OAC)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Origin Access Control (OAC) allows us to protect S3 origins and, unlike its predecessor Origin Access Identity (OAI), it is compatible with all S3 buckets in all AWS regions. Additionally, it supports encryption via AWS KMS and allows dynamic requests (such as &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt;) to Amazon S3.&lt;/p&gt;

&lt;p&gt;To implement Origin Access Control (OAC), for the specific origin you want to protect, simply create a new origin access control instead of using a public access origin, and update the bucket policy of the S3 bucket by adding the statement provided by CloudFront, which has the following structure:&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2008-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PolicyForCloudFrontPrivateContent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AllowCloudFrontServicePrincipal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cloudfront.amazonaws.com"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::&amp;lt;Bucket Name&amp;gt;/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"StringEquals"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"AWS:SourceArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:cloudfront::&amp;lt;Account ID&amp;gt;:distribution/&amp;lt;Distribution ID&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&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.amazonaws.com%2Fuploads%2Farticles%2F804ngg3bg9lrcf3sxbom.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.amazonaws.com%2Fuploads%2Farticles%2F804ngg3bg9lrcf3sxbom.png" alt="Restrict Access to an Amazon S3 Origin" width="800" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restrict Access with VPC Origins
&lt;/h3&gt;

&lt;p&gt;Until recently, CloudFront only allowed configuring public origins. That is, if you wanted to place a load balancer or an EC2 instance behind a CloudFront distribution, these had to have a DNS resolvable to a public IP address.&lt;/p&gt;

&lt;p&gt;At the end of 2024, AWS introduced &lt;strong&gt;CloudFront Virtual Private Cloud (VPC) Origins&lt;/strong&gt;, a feature that allows assigning private load balancers or private EC2 instances located in private subnets within a VPC as origins. They no longer need to be public!&lt;/p&gt;

&lt;p&gt;To implement VPC Origins, simply create a new VPC Origin in CloudFront, specifying the ARN of the private ELB or the private EC2 instance. The security group associated with these private resources must continue to allow access from CloudFront IP addresses.&lt;/p&gt;

&lt;p&gt;Although you could allow incoming access from the Internet —since it is not a public resource— if you want to prevent other private resources within the same VPC from accessing the origin and ensure that only CloudFront has access, it is highly recommended to use prefix lists. See the following section for guidance.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fnmdouut8kq0d6kloenbn.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.amazonaws.com%2Fuploads%2Farticles%2Fnmdouut8kq0d6kloenbn.png" alt="Restrict Access with VPC Origins" width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS-Managed Prefix Lists
&lt;/h3&gt;

&lt;p&gt;When you need to allow access to the same set of IP addresses across multiple security groups, instead of manually adding each IP address to all groups, you can create a prefix list. In this case, we are talking about a customer-managed prefix list, meaning it is our responsibility to keep the list of IP addresses up to date.&lt;/p&gt;

&lt;p&gt;On the other hand, a common need when working with resources inside a VPC is to limit incoming or outgoing traffic only to certain AWS services. Although it is possible to obtain the list of public IP addresses for each service, these change constantly, and maintaining them manually would be complex and error-prone. For this purpose, AWS offers &lt;strong&gt;AWS-managed prefix lists&lt;/strong&gt;, which are automatically maintained and updated by AWS, allowing you to filter IP addresses for various services such as Amazon CloudFront, Amazon DynamoDB, Amazon S3, among others.&lt;/p&gt;

&lt;p&gt;As mentioned in the previous section, if we want to allow traffic to our resources in a VPC only from CloudFront IP addresses, we can leverage the AWS-managed prefix list corresponding to Amazon CloudFront. To do this, simply specify the &lt;em&gt;Prefix List (pl)&lt;/em&gt; as the source or destination in the security group rules.&lt;/p&gt;

&lt;p&gt;This feature is extremely useful when working with origins inside a VPC. However, if the origin is On-Premises, whether with hybrid connectivity to AWS via a Site-to-Site VPN or AWS Direct Connect, or even fully disconnected from AWS and accessible via a public IP address, it is not possible to use prefix lists. For these scenarios, see the following section.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ffhf5xsbkz6n27pcf7svt.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.amazonaws.com%2Fuploads%2Farticles%2Ffhf5xsbkz6n27pcf7svt.png" alt="AWS-Managed Prefix Lists" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS IP Address Ranges
&lt;/h3&gt;

&lt;p&gt;As mentioned in the previous section, it is indeed possible to obtain the list of public IP addresses for each AWS service. While in a VPC we can leverage prefix lists, when working in On-Premises environments outside of AWS, we are required to use the list of AWS public IP addresses.&lt;/p&gt;

&lt;p&gt;For this, AWS maintains its list of public IP addresses updated in JSON format in the &lt;strong&gt;&lt;a href="https://ip-ranges.amazonaws.com/ip-ranges.json" rel="noopener noreferrer"&gt;ip-ranges.json&lt;/a&gt;&lt;/strong&gt; file. Using the IP addresses from this list, you can configure your On-Premises firewall. But you might now be wondering: how will I keep my firewall updated if Amazon’s IP addresses change constantly?&lt;/p&gt;

&lt;p&gt;Don’t worry, Amazon thought of that and created an SNS topic you can subscribe to in order to receive notifications about updates to the ip-ranges.json file. The ARN of the topic is: &lt;code&gt;arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged&lt;/code&gt;. You just need to subscribe to the topic and develop a small local automation that processes the notifications and updates your On-Premises firewall rules as needed.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwzz3nfleuqdu2ucd865f.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.amazonaws.com%2Fuploads%2Farticles%2Fwzz3nfleuqdu2ucd865f.png" alt="AWS IP Address Ranges" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Geographic Restrictions
&lt;/h3&gt;

&lt;p&gt;This section is simple. You can enhance the security of your origin by configuring &lt;strong&gt;geographic restrictions&lt;/strong&gt; on your distribution, as long as they fit your use case.&lt;/p&gt;

&lt;p&gt;To do this, CloudFront allows you to implement an &lt;em&gt;allow list&lt;/em&gt; or &lt;em&gt;block list&lt;/em&gt; on your distribution and specify all the countries you need to allow or block.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fsybe00qn3408e7uzz78o.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.amazonaws.com%2Fuploads%2Farticles%2Fsybe00qn3408e7uzz78o.png" alt="CloudFront Geographic Restrictions" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Field-Level Encryption
&lt;/h3&gt;

&lt;p&gt;This section covers a specific use case that occurs when, within the request made by the client to CloudFront, a payload is included containing multiple fields, some of which hold sensitive data. Fields with sensitive data should only be visible to the final destination, while any intermediate network or compute resources should see these fields encrypted. However, we cannot encrypt the entire request, as this use case requires that intermediate resources can still view all other non-sensitive fields without issues.&lt;/p&gt;

&lt;p&gt;This is where field-level encryption comes into play. Suppose the client sends a request whose payload contains both non-sensitive fields and sensitive fields, such as PII, PHI, confidential information, credentials, among others. Between CloudFront and the final destination, there are multiple intermediate resources, none of which should be able to see the sensitive data, although they still need to process the non-sensitive fields. In this scenario, we implement &lt;strong&gt;field-level encryption&lt;/strong&gt; provided by CloudFront.&lt;/p&gt;

&lt;p&gt;To implement field-level encryption, we simply need to create an &lt;em&gt;encryption profile&lt;/em&gt; in CloudFront, which should specify the data fields to encrypt and the public key that will be used for such encryption, previously stored in CloudFront. On the other hand, the final destination, for example, an application server, must have the corresponding private key and be configured to decrypt the encrypted fields. Only the final server possesses the private key, thus protecting the confidentiality of sensitive data from intermediate resources without limiting the processing of non-sensitive data in the same request.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ft7syei5030s9czsgfexh.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.amazonaws.com%2Fuploads%2Farticles%2Ft7syei5030s9czsgfexh.png" alt="CloudFront Field-Level Encryption" width="800" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Origin Shield
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Origin Shield&lt;/strong&gt; is an additional cache layer that can help reduce the load on your origin and, thereby, protect its availability. Primary use cases include scenarios with users across different geographic regions or when working with multiple CDNs.&lt;/p&gt;

&lt;p&gt;Origin Shield improves cache hit rates, decreases origin load, and optimizes network performance. The flow of a request in CloudFront without Origin Shield passes through the Edge Locations, then the Regional Edge Caches, and finally reaches the origin. In this case, multiple regions might be querying the origin unnecessarily. To avoid this, by enabling Origin Shield, an additional layer is placed between the Regional Edge Caches and the origin, so that only Origin Shield sends requests to the origin, thus reducing its load.&lt;/p&gt;

&lt;p&gt;To use Origin Shield, within your distribution select the origin, enable Origin Shield, and choose the AWS region where you want it deployed.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ff7lebzs1fklttxelyaiy.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.amazonaws.com%2Fuploads%2Farticles%2Ff7lebzs1fklttxelyaiy.png" alt="CloudFront Origin Shield" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS WAF Core Protections
&lt;/h3&gt;

&lt;p&gt;CloudFront has direct integration with &lt;strong&gt;AWS WAF&lt;/strong&gt; and allows you to add a basic security layer with a single click, which in the background creates a Web ACL with the default protection your application needs.&lt;/p&gt;

&lt;p&gt;The default WAF protection for CloudFront includes defense against common vulnerabilities such as those in the OWASP Top 10, SQL injections, rate limiting, and blocking traffic from malicious IP addresses based on Amazon’s threat intelligence. However, if you consider it necessary —and in fact it is recommended— customize your Web ACL according to your requirements and add additional rules you deem appropriate to strengthen your origin’s security.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fym3ppj96pnn06zrwxmu8.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.amazonaws.com%2Fuploads%2Farticles%2Fym3ppj96pnn06zrwxmu8.png" alt="AWS WAF Core Protections" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront Origin Groups
&lt;/h3&gt;

&lt;p&gt;This feature, technically, is not a security measure, but one of resilience, yet I want to mention it because I have tested it and find it particularly interesting.&lt;/p&gt;

&lt;p&gt;As you know, CloudFront is a global service, but the origins probably are not. That is, in the event of a regional outage or an availability zone failure, the application could stop responding, even if the CloudFront distribution itself is unaffected.&lt;/p&gt;

&lt;p&gt;To handle these situations, &lt;strong&gt;CloudFront Origin Groups&lt;/strong&gt; allows us to configure a failover solution easily. We only need to create an Origin Group specifying multiple origins and the failover criteria, i.e., the HTTP Status Codes that CloudFront must receive to trigger failover to another origin located in a different region.&lt;/p&gt;

&lt;p&gt;In this way, CloudFront Origin Groups allows us to maintain high availability in the event of a regional failure: the same global distribution remains active, simply redirecting requests to another origin within the group, but located in a different region.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fi8up1dzz0mg89p4hkx3g.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.amazonaws.com%2Fuploads%2Farticles%2Fi8up1dzz0mg89p4hkx3g.png" alt="CloudFront Origin Groups" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Never forget to restrict access to origins. In most cases, when you implement CloudFront, the distribution should be the only one with access to the origin. For this reason, it is common to implement all defense mechanisms on the CloudFront distribution; however, if you do not restrict access to the origin, it will remain vulnerable to threats that you probably had not considered because you focused solely on protecting the distribution. 😶&lt;/p&gt;

&lt;p&gt;If you need to implement AWS WAF for your application, you should almost always attach the Web ACL to the CloudFront distribution, rather than, for example, to the ALB origin. It always makes more sense to apply WAF at the distribution level so that traffic is filtered as high up as possible, thus reducing the load and cost of data processing on the ALB. 😎&lt;/p&gt;

&lt;p&gt;I recommend using georestriction whenever possible and, of course, when it applies to your use case. In my experience, depending on your region, georestriction can be one of the simplest ways to prevent undesired traffic from scraping bots, since this type of traffic usually originates from specific countries. 🤖&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Amazon CloudFront includes multiple built-in security features that allow us to protect origins, covering &lt;em&gt;failover&lt;/em&gt;, &lt;em&gt;firewall&lt;/em&gt;, &lt;em&gt;georestriction&lt;/em&gt;, &lt;em&gt;additional caching layers&lt;/em&gt;, &lt;em&gt;field-level encryption&lt;/em&gt;, and most importantly, &lt;em&gt;origin access restriction&lt;/em&gt;. All of this allows us to consolidate various perimeter-level protection mechanisms in the CloudFront distribution, thereby strengthening the security posture of our applications through a &lt;strong&gt;defense-in-depth&lt;/strong&gt; strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;p&gt;In the next section, you will find official AWS resources and documentation for the built-in security features of Amazon CloudFront mentioned in this article, in case you want to continue learning or dive deeper to evaluate if they really apply to your use case.&lt;/p&gt;

&lt;p&gt;I also invite you to implement these built-in CloudFront security features in your own AWS account. Share in the comments what you thought of this article or if you discovered something interesting about any Amazon CloudFront feature during your implementation. ✍🏻&lt;/p&gt;

&lt;p&gt;For me, a next step will be to test the integration of &lt;em&gt;AWS Shield Advanced&lt;/em&gt; with CloudFront in the future, as I have not yet had the opportunity to see AWS Shield’s DDoS mitigation logic applied to CloudFront in action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/restrict-access-to-load-balancer.html" rel="noopener noreferrer"&gt;Restrict access to Application Load Balancers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html" rel="noopener noreferrer"&gt;Restrict access to an Amazon S3 origin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-vpc-origins.html" rel="noopener noreferrer"&gt;Restrict access with VPC origins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/working-with-aws-managed-prefix-lists.html" rel="noopener noreferrer"&gt;AWS-managed prefix lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/aws-ip-ranges.html" rel="noopener noreferrer"&gt;AWS IP address ranges&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html" rel="noopener noreferrer"&gt;Restrict the geographic distribution of your content&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html" rel="noopener noreferrer"&gt;Use field-level encryption to help protect sensitive data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html" rel="noopener noreferrer"&gt;Use Amazon CloudFront Origin Shield&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/cloudfront-features.html" rel="noopener noreferrer"&gt;Using AWS WAF with Amazon CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html" rel="noopener noreferrer"&gt;Optimize high availability with CloudFront origin failover&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/ddos-event-mitigation-logic-continuous-inspection.html" rel="noopener noreferrer"&gt;AWS Shield mitigation logic for CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>english</category>
      <category>aws</category>
      <category>networking</category>
      <category>cdn</category>
    </item>
    <item>
      <title>Protege tu aplicación web On-Premises con AWS WAF: Guía paso a paso</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Fri, 24 Oct 2025 03:15:24 +0000</pubDate>
      <link>https://dev.to/cbecerra/protege-tu-aplicacion-web-on-premises-con-aws-waf-guia-paso-a-paso-11pj</link>
      <guid>https://dev.to/cbecerra/protege-tu-aplicacion-web-on-premises-con-aws-waf-guia-paso-a-paso-11pj</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Este artículo te guiará en la implementación de AWS WAF para tus aplicaciones web alojadas en servidores On-Premises. Mostraré paso a paso cómo crear los certificados SSL/TLS, desplegar una distribución de CloudFront protegida por WAF y configurar el enrutamiento DNS necesario para esta implementación, todo ello alineado con el pilar de Seguridad del AWS Well-Architected Framework. 🧱&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tiempo estimado de lectura:&lt;/strong&gt; 15 minutos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nivel:&lt;/strong&gt; 300&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versión en inglés:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/protect-your-on-premises-web-application-with-aws-waf-a-step-by-step-guide-50om"&gt;Protect Your On-Premises Web Application with AWS WAF: A Step-by-Step Guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tabla de Contenidos:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introducción&lt;/li&gt;
&lt;li&gt;Por qué implementar AWS WAF en una aplicación web On-Premises&lt;/li&gt;
&lt;li&gt;Qué vas a implementar&lt;/li&gt;
&lt;li&gt;Prerrequisitos&lt;/li&gt;
&lt;li&gt;
Pasos de Implementación

&lt;ul&gt;
&lt;li&gt;Crea los certificados SSL/TLS&lt;/li&gt;
&lt;li&gt;Crea la distribución de CloudFront&lt;/li&gt;
&lt;li&gt;Configura el enrutamiento DNS&lt;/li&gt;
&lt;li&gt;Restringe el acceso al servidor On-Premises&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Estructura de costos

&lt;ul&gt;
&lt;li&gt;Estimación de costos mensual&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lecciones aprendidas&lt;/li&gt;

&lt;li&gt;Conclusión&lt;/li&gt;

&lt;li&gt;Qué sigue&lt;/li&gt;

&lt;li&gt;Recursos oficiales&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;Si has oído hablar de &lt;strong&gt;AWS WAF&lt;/strong&gt;, probablemente sepas que es un servicio de firewall de capa 7 que permite asociar un &lt;em&gt;Web Application Firewall&lt;/em&gt; directamente a recursos de AWS como &lt;em&gt;Application Load Balancer&lt;/em&gt;, &lt;em&gt;API Gateway&lt;/em&gt;, &lt;em&gt;CloudFront Distributions&lt;/em&gt;, entre otros. Sin embargo, no puede asociarse directamente a una instancia EC2, a direcciones IP específicas o a una interfaz de red ENI en particular; únicamente puede vincularse a determinados servicios de AWS.&lt;/p&gt;

&lt;p&gt;Un día recibí la solicitud de un cliente que deseaba implementar AWS WAF para una aplicación web alojada en un servidor &lt;em&gt;On-Premises&lt;/em&gt; expuesto mediante una dirección IP pública. El cliente aclaró que no planeaban migrar el servidor a la nube; el servidor permanecería &lt;em&gt;On-Premises&lt;/em&gt;, pero necesitaban contar con la protección de WAF y querían saber si era posible hacerlo desde AWS. 🤔&lt;/p&gt;

&lt;p&gt;Con un poco de creatividad, se me ocurrió una solución: desplegar una distribución de CloudFront protegida con AWS WAF, cuyo origen sería el servidor &lt;em&gt;On-Premises&lt;/em&gt;. Tras generar algunos certificados SSL/TLS, modificar un par de registros DNS y ajustar ligeramente la configuración de la aplicación local, logré implementar esta solución con excelentes resultados y un cliente completamente satisfecho. 😎&lt;/p&gt;

&lt;p&gt;En este artículo te explicaré por qué deberías implementar AWS WAF en tu aplicación web &lt;em&gt;On-Premises&lt;/em&gt;, cómo lo hice yo y cómo podrías hacerlo tú.&lt;/p&gt;

&lt;h2&gt;
  
  
  Por qué implementar AWS WAF en una aplicación web On-Premises
&lt;/h2&gt;

&lt;p&gt;Si tienes una aplicación web &lt;em&gt;On-Premises&lt;/em&gt; y necesitas protegerla con un &lt;em&gt;Web Application Firewall (WAF)&lt;/em&gt;, pero no deseas desplegar y administrar manualmente una solución WAF local, una excelente alternativa es implementar AWS WAF.&lt;/p&gt;

&lt;p&gt;AWS WAF es un servicio completamente gestionado por Amazon Web Services, lo que significa que tú solo necesitas definir qué reglas aplicar y a qué recurso proteger. El servicio incluye &lt;em&gt;managed rules&lt;/em&gt; que analizan el tráfico en busca de patrones de vulnerabilidades comunes, y AWS se encarga de mantener y actualizar dichas reglas por ti. Además, puedes crear reglas personalizadas, ya sean &lt;em&gt;stateful&lt;/em&gt; o &lt;em&gt;stateless&lt;/em&gt;, permitir o bloquear conjuntos de direcciones IP, aplicar restricciones geográficas, crear reglas basadas en expresiones regulares (&lt;em&gt;regex&lt;/em&gt;), entre muchas otras opciones. 🤩&lt;/p&gt;

&lt;p&gt;Con AWS WAF, puedes ofrecer a tu aplicación web &lt;em&gt;On-Premises&lt;/em&gt; la protección de un firewall moderno sin necesidad de aprovisionar ni administrar manualmente una infraestructura WAF local. Y si el tiempo es un factor crítico, la configuración de AWS WAF probablemente sea mucho más rápida que cualquier otra alternativa tradicional. 😏&lt;/p&gt;

&lt;p&gt;Ya sea que busques fortalecer la seguridad de tus aplicaciones web o cumplir con requisitos de compliance, es importante que sepas cómo implementar AWS WAF en una aplicación web &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué vas a implementar
&lt;/h2&gt;

&lt;p&gt;Esta guía asume que cuentas con un servidor &lt;em&gt;On-Premises&lt;/em&gt; que aloja una aplicación web expuesta en el puerto &lt;code&gt;443&lt;/code&gt;, con una dirección IP pública protegida por HTTPS mediante un certificado SSL/TLS, y accesible desde un dominio (por ejemplo, &lt;code&gt;www&lt;/code&gt;) a través de un registro DNS tipo &lt;code&gt;A&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Partiendo de este punto de inicio, realizaremos lo siguiente:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crear dos certificados SSL/TLS: uno para configurar en CloudFront y otro para instalar en el servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Instalar el certificado SSL/TLS correspondiente en el servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Crear una distribución CloudFront, configurada con su certificado SSL/TLS correspondiente, cuyo origen será un dominio que apunte al servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Configurar un registro DNS tipo &lt;code&gt;CNAME&lt;/code&gt; para dirigir todo el tráfico del dominio hacia CloudFront.&lt;/li&gt;
&lt;li&gt;Configurar un registro DNS tipo &lt;code&gt;A&lt;/code&gt; para dirigir el tráfico desde CloudFront hacia el servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Configurar la aplicación &lt;em&gt;On-Premises&lt;/em&gt; para aceptar únicamente tráfico proveniente de CloudFront.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Al finalizar esta implementación, contaremos con una cadena de resolución y redirección similar al siguiente flujo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dominio: &lt;code&gt;www.midominio.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;DNS de la distribución de CloudFront&lt;/li&gt;
&lt;li&gt;Distribución CloudFront protegida por AWS WAF&lt;/li&gt;
&lt;li&gt;Dominio: &lt;code&gt;origen.midominio.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Dirección IP pública del servidor &lt;em&gt;On-Premises&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F6oqfedlow95k568vwuh2.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.amazonaws.com%2Fuploads%2Farticles%2F6oqfedlow95k568vwuh2.png" alt="Architecture" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerrequisitos
&lt;/h2&gt;

&lt;p&gt;Para esta implementación de AWS WAF, se requiere contar con los siguientes prerrequisitos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Acceso a una cuenta de AWS.&lt;/li&gt;
&lt;li&gt;Permisos IAM en la cuenta de AWS para utilizar los servicios &lt;em&gt;Amazon CloudFront&lt;/em&gt;, &lt;em&gt;AWS WAF&lt;/em&gt;, &lt;em&gt;Amazon Route 53&lt;/em&gt; y &lt;em&gt;AWS ACM&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Acceso administrativo al &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; (Cloudflare o Amazon Route 53).&lt;/li&gt;
&lt;li&gt;Acceso a un servidor &lt;em&gt;On-Premises&lt;/em&gt; que aloje una aplicación web expuesta en el puerto &lt;code&gt;443&lt;/code&gt;, con una dirección IP pública.

&lt;ul&gt;
&lt;li&gt;Acceso para la creación de certificados SSL/TLS emitidos por una &lt;em&gt;Certificate Authority (CA)&lt;/em&gt; pública, por ejemplo, la misma CA que emitió el certificado actualmente instalado en el servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Permisos para instalar el certificado en el servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Permisos para editar la configuración de la aplicación &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Pasos de Implementación
&lt;/h2&gt;

&lt;p&gt;Las siguientes secciones ofrecen una guía paso a paso para la implementación de AWS WAF en un servidor &lt;em&gt;On-Premises&lt;/em&gt;, mostrando cómo se integran cada uno de los componentes, tales como los certificados SSL/TLS de ACM y de una CA pública, los registros DNS de Amazon Route 53, la distribución de CloudFront y la ACL web de AWS WAF, con el fin de implementar WAF en nuestra aplicación web &lt;em&gt;On-Premises&lt;/em&gt; y garantizar que todo el tráfico sea enrutado de forma segura a través de AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crea los certificados SSL/TLS
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Crea e instala el certificado para el servidor On-Premises
&lt;/h4&gt;

&lt;p&gt;Para iniciar con esta implementación, necesitamos crear un nuevo certificado para el servidor &lt;em&gt;On-Premises&lt;/em&gt;. Como se mencionó anteriormente, se asume que la comunicación hacia tu servidor ya estaba protegida mediante HTTPS, utilizando un certificado SSL/TLS instalado previamente para el &lt;em&gt;hostname&lt;/em&gt; principal, por ejemplo, &lt;code&gt;www.midominio.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Siguiendo el mismo método que utilizaste originalmente para generar el certificado previo con una CA pública, adquiere ahora un certificado válido para &lt;code&gt;origen.midominio.com&lt;/code&gt;, ya sea con la misma CA pública o con otra de tu preferencia.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Luego, realiza la instalación del nuevo certificado SSL/TLS en la misma ruta donde se encontraba el certificado previo. Asegúrate de que la instalación se haya completado correctamente.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Para validar que la instalación del certificado sea correcta, puedes utilizar herramientas en línea como &lt;a href="https://www.sslshopper.com/ssl-checker.html" rel="noopener noreferrer"&gt;sslshopper.com&lt;/a&gt; o &lt;a href="https://www.sslchecker.com/sslchecker" rel="noopener noreferrer"&gt;sslchecker.com&lt;/a&gt; para verificar el &lt;em&gt;hostname&lt;/em&gt; &lt;code&gt;origen.midominio.com&lt;/code&gt;. El certificado debe ser válido para dicho &lt;em&gt;hostname&lt;/em&gt; y no estar expirado.&lt;/p&gt;

&lt;h4&gt;
  
  
  Crea el certificado para CloudFront
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; En la consola de AWS, navega al servicio AWS Certificate Manager y haz clic en el botón &lt;strong&gt;Request a Certificate&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkbje86oyajc752ud459t.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.amazonaws.com%2Fuploads%2Farticles%2Fkbje86oyajc752ud459t.png" alt="AWS Certificate Manager" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En la sección &lt;em&gt;Certificate Type&lt;/em&gt;, asegúrate de que &lt;strong&gt;Request a public certificate&lt;/strong&gt; esté seleccionado y haz clic en &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fqyntmayfx4fur0z34n98.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.amazonaws.com%2Fuploads%2Farticles%2Fqyntmayfx4fur0z34n98.png" alt="Certificate type" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; En la sección &lt;em&gt;Domain names&lt;/em&gt;, ingresa tu dominio principal, por ejemplo, &lt;code&gt;www.midominio.com&lt;/code&gt;. En la sección &lt;em&gt;Validation method&lt;/em&gt;, asegúrate de que &lt;strong&gt;DNS validation&lt;/strong&gt; esté seleccionado y haz clic en &lt;strong&gt;Request&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F4yb4m73lgt7w0pe5pj0c.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.amazonaws.com%2Fuploads%2Farticles%2F4yb4m73lgt7w0pe5pj0c.png" alt="Domain names" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nota: ¿viste la sección &lt;strong&gt;Allow export&lt;/strong&gt;? Es una funcionalidad relativamente nueva en AWS, y permite exportar certificados públicos emitidos por Amazon, incluyendo su llave privada, para que puedas instalarlos donde desees, por ejemplo, en un servidor &lt;em&gt;On-Premises&lt;/em&gt;. Es decir, en el paso anterior, en lugar de usar otra CA pública, también podríamos haber utilizado &lt;em&gt;AWS Certificate Manager&lt;/em&gt; para obtener el certificado destinado a nuestro servidor &lt;em&gt;On-Premises&lt;/em&gt;. 😮&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; El certificado ha sido creado, pero se encuentra en un estado de validación pendiente. Para que &lt;em&gt;ACM&lt;/em&gt; pueda verificar que realmente somos los propietarios del dominio especificado en el certificado, debemos crear un registro &lt;code&gt;CNAME&lt;/code&gt; en el &lt;em&gt;Authoritative DNS Provider&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;En mi caso, estoy utilizando Amazon Route 53 para gestionar mi dominio, por lo que simplemente puedo hacer clic en el botón &lt;strong&gt;Create records in Route 53&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Si gestionas tu dominio en otro &lt;em&gt;Authoritative DNS Provider&lt;/em&gt;, entonces deberás crear manualmente el registro &lt;code&gt;CNAME&lt;/code&gt; utilizando el &lt;em&gt;CNAME name&lt;/em&gt; y el &lt;em&gt;CNAME value&lt;/em&gt; que se detallan en la sección &lt;em&gt;Domains&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F3cl12nhpi0jv7c68bi1f.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.amazonaws.com%2Fuploads%2Farticles%2F3cl12nhpi0jv7c68bi1f.png" alt="Create records" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Finalmente, el certificado de AWS Certificate Manager debería pasar del estado &lt;em&gt;Pending validation&lt;/em&gt; al estado &lt;em&gt;Issued&lt;/em&gt;. Con esto confirmamos que el certificado se ha emitido correctamente en ACM.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwrw04ar76c9xxparms7j.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.amazonaws.com%2Fuploads%2Farticles%2Fwrw04ar76c9xxparms7j.png" alt="Certificates Issued Status" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Crea la distribución de CloudFront
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; En la consola de AWS, navega al servicio Amazon CloudFront y haz clic en el botón &lt;strong&gt;Create a CloudFront distribution&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fmwz2x6ik8eduv54m197t.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.amazonaws.com%2Fuploads%2Farticles%2Fmwz2x6ik8eduv54m197t.png" alt="Amazon CloudFront" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En la sección &lt;em&gt;Distribution options&lt;/em&gt;, completa el campo &lt;strong&gt;Distribution name&lt;/strong&gt; y, para este caso de uso, asegúrate de que el &lt;strong&gt;Distribution type&lt;/strong&gt; seleccionado sea &lt;strong&gt;Single website or app&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; En la sección &lt;em&gt;Custom domain&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Si el dominio en cuestión está siendo gestionado por Amazon Route 53 dentro de la misma cuenta de AWS donde estás creando la distribución de CloudFront, añade el dominio y haz clic en &lt;strong&gt;Check Domain&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Si gestionas ese dominio en otro &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; o en Route 53 de otra cuenta AWS, no te preocupes, podrás añadir el &lt;em&gt;custom domain&lt;/em&gt; en un paso posterior.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fu0f7w6zvmmccxvz4pizh.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.amazonaws.com%2Fuploads%2Farticles%2Fu0f7w6zvmmccxvz4pizh.png" alt="Distribution options" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Haz clic en &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; En la sección &lt;em&gt;Origin type&lt;/em&gt;, dado que nuestro origen es un servidor &lt;em&gt;On-Premises&lt;/em&gt;, selecciona &lt;strong&gt;Other&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; En la sección &lt;em&gt;Origin&lt;/em&gt;, especifica &lt;code&gt;origen.midominio.com&lt;/code&gt; como &lt;strong&gt;Custom origin&lt;/strong&gt; y deja vacío el campo &lt;strong&gt;Origin path&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fii85juagv3umez8p925e.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.amazonaws.com%2Fuploads%2Farticles%2Fii85juagv3umez8p925e.png" alt="Origin type" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; En la sección &lt;em&gt;Settings&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;En &lt;em&gt;Origin settings&lt;/em&gt;, personaliza los parámetros si lo deseas o utiliza la configuración recomendada.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Cache settings&lt;/em&gt;, selecciona &lt;strong&gt;Customize cache settings&lt;/strong&gt; y, para &lt;strong&gt;Origin request policy&lt;/strong&gt;, elige &lt;strong&gt;AllViewer&lt;/strong&gt;. Si lo deseas, personaliza otros parámetros.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fo8loc3oxujxly63tl1aq.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.amazonaws.com%2Fuploads%2Farticles%2Fo8loc3oxujxly63tl1aq.png" alt="Settings" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; Haz clic en &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; En la sección &lt;em&gt;Enable Security&lt;/em&gt;, selecciona &lt;strong&gt;Enable security protections&lt;/strong&gt;. Si aplica a tu caso de uso, activa &lt;strong&gt;SQL protection&lt;/strong&gt; y &lt;strong&gt;Rate limiting&lt;/strong&gt;. Esto creará una ACL web de AWS WAF con protección básica y la asociará a la distribución de CloudFront.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F2ie9a5eycmjhi8bwqta1.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.amazonaws.com%2Fuploads%2Farticles%2F2ie9a5eycmjhi8bwqta1.png" alt="Web Application Firewall" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.&lt;/strong&gt; Haz clic en &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.&lt;/strong&gt; Como se mencionó en el paso 3, si el dominio está gestionado por Route 53 en la misma cuenta de AWS y lo especificaste previamente, en la sección &lt;em&gt;Get TLS certificate&lt;/em&gt; se intentará encontrar automáticamente un certificado de ACM válido para dicho dominio. En mi caso, se encontró exitosamente el certificado que creé anteriormente.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Si el dominio está siendo gestionado en otro &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; o en Route 53 de otra cuenta AWS, no te preocupes, podrás añadir el certificado TLS en un paso posterior.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F8gyqyq21ymcvs1hpdn86.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.amazonaws.com%2Fuploads%2Farticles%2F8gyqyq21ymcvs1hpdn86.png" alt="TLS Certificate" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12.&lt;/strong&gt; Haz clic en &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13.&lt;/strong&gt; Revisa los detalles de la distribución y haz clic en &lt;strong&gt;Create distribution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.&lt;/strong&gt; La distribución de CloudFront comenzará a desplegarse. En la columna &lt;strong&gt;Last modified&lt;/strong&gt;, podrás ver que se encuentra en estado &lt;strong&gt;Deploying&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdqxolq31tf3eu77grvh5.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.amazonaws.com%2Fuploads%2Farticles%2Fdqxolq31tf3eu77grvh5.png" alt="Deploying distribution" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15.&lt;/strong&gt; Como se mencionó en los pasos 3 y 11, si gestionas tu dominio en otro &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; o en Route 53 de otra cuenta AWS, dirígete a la sección &lt;em&gt;Settings&lt;/em&gt; y haz clic en &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16.&lt;/strong&gt; En la sección &lt;em&gt;General&lt;/em&gt;, especifica tu dominio en &lt;strong&gt;Alternate domain name (CNAME)&lt;/strong&gt; y selecciona el certificado de ACM creado previamente en &lt;strong&gt;Custom SSL certificate&lt;/strong&gt;. Luego, haz clic en &lt;strong&gt;Save changes&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F9ppauh4chmkh5gb0gq1v.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.amazonaws.com%2Fuploads%2Farticles%2F9ppauh4chmkh5gb0gq1v.png" alt="Edit settings" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17.&lt;/strong&gt; Una vez la distribución haya terminado de desplegarse, en &lt;strong&gt;Last modified&lt;/strong&gt; podrás ver el &lt;em&gt;timestamp&lt;/em&gt; completo de la última modificación. Si el &lt;em&gt;Alternate domain name&lt;/em&gt; y el &lt;em&gt;Custom SSL certificate&lt;/em&gt; están configurados correctamente, habrás completado exitosamente la creación y configuración de la distribución de CloudFront.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fgcdnb2z7ji8nniw5gphc.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.amazonaws.com%2Fuploads%2Farticles%2Fgcdnb2z7ji8nniw5gphc.png" alt="Deployed distribution" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18.&lt;/strong&gt; Copia el &lt;strong&gt;Distribution domain name&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configura el enrutamiento DNS
&lt;/h3&gt;

&lt;p&gt;En mi caso, estoy gestionando mi dominio con Amazon Route 53, pero tú puedes crear estos registros DNS en el &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; que estés utilizando.&lt;/p&gt;

&lt;h4&gt;
  
  
  Crea el registro CNAME
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Si el dominio en cuestión está siendo gestionado por Amazon Route 53 dentro de la misma cuenta de AWS donde estás creando la distribución de CloudFront, aprovecha y crea un registro DNS de tipo &lt;code&gt;Alias&lt;/code&gt;, apuntando tu dominio principal &lt;code&gt;www.midominio.com&lt;/code&gt; hacia la distribución de CloudFront.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fl81pzuwezj42pcdbxo6n.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.amazonaws.com%2Fuploads%2Farticles%2Fl81pzuwezj42pcdbxo6n.png" alt="Alias record" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Si el dominio está siendo gestionado en otro &lt;em&gt;Authoritative DNS Provider&lt;/em&gt; o en Route 53 de otra cuenta AWS, crea un registro DNS de tipo &lt;code&gt;CNAME&lt;/code&gt;, apuntando tu dominio principal &lt;code&gt;www.midominio.com&lt;/code&gt; al &lt;em&gt;Distribution domain name&lt;/em&gt; de CloudFront.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fh3jkjpktf3t9oglxk3xs.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.amazonaws.com%2Fuploads%2Farticles%2Fh3jkjpktf3t9oglxk3xs.png" alt="CNAME record" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Crea el registro A
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Crea un registro DNS de tipo &lt;code&gt;A&lt;/code&gt; apuntando tu nuevo subdominio &lt;code&gt;origen.midominio.com&lt;/code&gt; a la dirección IP pública de tu servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fxz3meygwi891db7q5upm.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.amazonaws.com%2Fuploads%2Farticles%2Fxz3meygwi891db7q5upm.png" alt="A record" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Con esto, habrás completado la configuración DNS necesaria. Sin embargo, aún no hemos terminado: si intentas acceder ahora a tu servidor mediante &lt;code&gt;www.midominio.com&lt;/code&gt; y &lt;code&gt;origen.midominio.com&lt;/code&gt;, ambos intentos serán exitosos, pero hay un detalle importante — &lt;code&gt;origen.midominio.com&lt;/code&gt; &lt;strong&gt;no está protegido por WAF&lt;/strong&gt; y, por ende, sigue siendo vulnerable. Mitigaremos este riesgo en el siguiente paso.&lt;/p&gt;

&lt;p&gt;¿Cómo puedes darte cuenta fácilmente de si &lt;code&gt;www.midominio.com&lt;/code&gt; y &lt;code&gt;origen.midominio.com&lt;/code&gt; están protegidos por WAF o no? Yo utilizo una extensión de Google Chrome llamada &lt;a href="https://chromewebstore.google.com/detail/gppongmhjkpfnbhagpmjfkannfbllamg" rel="noopener noreferrer"&gt;Wappalyzer&lt;/a&gt;, que permite identificar las tecnologías empleadas en cualquier sitio web. Por ejemplo, al probar mis dominios, Wappalyzer detectó que el dominio &lt;code&gt;www&lt;/code&gt; utiliza Amazon CloudFront como CDN y Amazon Web Services como PaaS, mientras que el dominio &lt;code&gt;origen&lt;/code&gt; no utiliza ninguno de estos servicios. Esto confirma que el tráfico hacia el dominio &lt;code&gt;origen&lt;/code&gt; no pasa por CloudFront y, por lo tanto, no es inspeccionado por AWS WAF. ⚠️&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F5nbdelxnbn14is2vuq93.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.amazonaws.com%2Fuploads%2Farticles%2F5nbdelxnbn14is2vuq93.png" alt="Wappalyzer comparison" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restringe el acceso al servidor On-Premises
&lt;/h3&gt;

&lt;p&gt;Ahora debemos restringir el acceso al servidor &lt;em&gt;On-Premises&lt;/em&gt; de tal manera que solo el tráfico que pase por CloudFront —y que haya sido inspeccionado por AWS WAF— sea aceptado por el servidor.&lt;/p&gt;

&lt;p&gt;Para ello, tenemos dos opciones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hacer que CloudFront envíe un encabezado HTTP personalizado adicional con un valor secreto al origen, y que este último solo acepte el tráfico que contenga dicho encabezado con el valor secreto correcto.&lt;/li&gt;
&lt;li&gt;Configurar el firewall del servidor &lt;em&gt;On-Premises&lt;/em&gt; para que únicamente acepte tráfico proveniente de las direcciones IP de CloudFront especificadas en el archivo &lt;a href="https://ip-ranges.amazonaws.com/ip-ranges.json" rel="noopener noreferrer"&gt;ip-ranges.json&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dado que la segunda opción potencialmente implicaría actualizar las reglas del firewall &lt;em&gt;On-Premises&lt;/em&gt; cada vez que Amazon modifique el archivo &lt;em&gt;ip-ranges.json&lt;/em&gt;, me inclino más por la primera alternativa, que de hecho es la opción recomendada por Amazon cuando se requiere restringir el acceso a un &lt;em&gt;Application Load Balancer&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; En la consola de AWS, selecciona la distribución de CloudFront. En la pestaña &lt;strong&gt;Origins&lt;/strong&gt;, selecciona el origen configurado y haz clic en &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fh4mpjblytcap09hkhf2n.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.amazonaws.com%2Fuploads%2Farticles%2Fh4mpjblytcap09hkhf2n.png" alt="Origins" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; En la sección &lt;em&gt;Settings&lt;/em&gt;, dentro de &lt;strong&gt;Add custom header&lt;/strong&gt;, haz clic en &lt;strong&gt;Add header&lt;/strong&gt; y añade un encabezado HTTP personalizado. El valor de este encabezado debe ser secreto y no debe exponerse públicamente. Guarda los cambios.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkna7yewx728uu33fa886.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.amazonaws.com%2Fuploads%2Farticles%2Fkna7yewx728uu33fa886.png" alt="Add custom header" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahora CloudFront añadirá este encabezado HTTP en todas las solicitudes que envíe al origen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Finalmente, configura el servidor web &lt;em&gt;On-Premises&lt;/em&gt; para que acepte solicitudes únicamente si contienen el encabezado HTTP personalizado de CloudFront con el valor secreto correcto.&lt;/p&gt;

&lt;p&gt;Con esto hemos completado la implementación de AWS WAF para una aplicación web &lt;em&gt;On-Premises&lt;/em&gt; mediante CloudFront, restringiendo el acceso por otros medios y garantizando que todo el tráfico hacia el servidor &lt;em&gt;On-Premises&lt;/em&gt; sea inspeccionado de forma segura. 🔍&lt;/p&gt;




&lt;h2&gt;
  
  
  Estructura de costos
&lt;/h2&gt;

&lt;p&gt;Los costos que deben considerarse en esta implementación son los siguientes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon CloudFront (distribución, Price Class “Use all edge locations”)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo por salida de datos hacia Internet (primera capa): ~ USD 0,085 por GB para Estados Unidos/México/Canadá/Europa.&lt;/li&gt;
&lt;li&gt;Costo por solicitudes HTTP/HTTPS: para USA se cita ~ USD 0,01 por cada 10 000 solicitudes (~ USD 0,000001 por solicitud) según guía reciente.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Nota&lt;/em&gt;: Hay un nivel gratuito de 1 TB de salida + 10 millones de solicitudes/mes para CloudFront.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS WAF (Web ACL asociada a CloudFront)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo de Web ACL: USD 5/mes por Web ACL.&lt;/li&gt;
&lt;li&gt;Costo por regla dentro de la Web ACL: USD 1/mes por regla.&lt;/li&gt;
&lt;li&gt;Costo por solicitudes inspeccionadas: USD 0,60 por cada millón de solicitudes.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Amazon Route 53 (Zona alojada + registros)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo por hosted zone pública: USD 0,50/mes para las primeras 25 hosted zones.&lt;/li&gt;
&lt;li&gt;Costo adicional por registros (si se tienen más de 10 000 por zona): USD 0,0015/mes por registro adicional.&lt;/li&gt;
&lt;li&gt;Costo de consultas DNS estándar: ~ USD 0,40 por millón de consultas (primer 1 B de consultas).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS Certificate Manager (ACM Certificate para FQDN)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Si es un certificado público gestionado por ACM, el uso con servicios integrados (como CloudFront) &lt;strong&gt;no tiene costo adicional&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Si fuese un certificado exportable o wildcard habría tarifas, pero en este caso un FQDN usando CloudFront → costo estimado = USD 0/mes.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Cabe mencionar que los precios indicados corresponden a octubre de 2025.💲&lt;/p&gt;

&lt;h3&gt;
  
  
  Estimación de costos mensual
&lt;/h3&gt;

&lt;p&gt;Tomando como referencia mi implementación con los siguientes supuestos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Región us-east-1&lt;/li&gt;
&lt;li&gt;Datos salientes (egress) desde CloudFront: 1 000 GB/mes&lt;/li&gt;
&lt;li&gt;Solicitudes al CloudFront: 10 millones de solicitudes/mes&lt;/li&gt;
&lt;li&gt;Una Web ACL en AWS WAF, asociada a la distribución&lt;/li&gt;
&lt;li&gt;Una hosted zone en Route 53 con un registro A + un registro CNAME&lt;/li&gt;
&lt;li&gt;Un certificado ACM para un FQDN&lt;/li&gt;
&lt;li&gt;No otras reglas avanzadas, no certificado wildcard, no consultas DNS masivas.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cálculos:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CloudFront — datos de salida&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;1 000 GB × USD 0,085/GB = USD 85,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;CloudFront — solicitudes&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;10 millones de solicitudes → (10 000 000 / 10 000) × USD 0,01 = 1 000 × USD 0,01 = USD 10,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — Web ACL&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 5,00/mes (una Web ACL)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — reglas&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Suponiendo solo 1 regla para simplificar → USD 1,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — solicitudes inspeccionadas&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;10 millones de solicitudes × (USD 0,60 por millón) = 10 × USD 0,60 = USD 6,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — hosted zone&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 0,50/mes (una zona pública)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — registros&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Solo 2 registros (A + CNAME) → ninguno adicional sobre el umbral → USD 0,00 extra&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — consultas DNS&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Suponiendo un uso modesto (por ejemplo, ~100 000 consultas) → 0,1 millones × USD 0,40 = USD 0,04 (aproximadamente). Para simplicidad redondeamos a ≈ USD 0,05/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;ACM — certificado público integrado&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 0,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Total estimado:
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Componente&lt;/th&gt;
&lt;th&gt;Costo estimado mensual (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CloudFront — datos de salida&lt;/td&gt;
&lt;td&gt;85,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CloudFront — solicitudes&lt;/td&gt;
&lt;td&gt;10,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — Web ACL&lt;/td&gt;
&lt;td&gt;5,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — reglas&lt;/td&gt;
&lt;td&gt;1,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — solicitudes inspeccionadas&lt;/td&gt;
&lt;td&gt;6,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — hosted zone&lt;/td&gt;
&lt;td&gt;0,50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — registros&lt;/td&gt;
&lt;td&gt;0,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — consultas DNS&lt;/td&gt;
&lt;td&gt;0,05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACM — certificado&lt;/td&gt;
&lt;td&gt;0,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total estimado&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~ USD 107,55&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Lecciones aprendidas
&lt;/h2&gt;

&lt;p&gt;En mi experiencia, al crear los certificados, especifica el FQDN exacto que utilizarás. No emplees &lt;em&gt;wildcard&lt;/em&gt; a menos que realmente lo necesites, ya que los certificados &lt;em&gt;wildcard&lt;/em&gt; suelen tener un costo significativamente mayor y, en la mayoría de los casos, no se aprovechan al 100%. 💰&lt;/p&gt;

&lt;p&gt;La protección de WAF que implementé para CloudFront en esta guía incluye defensa frente a vulnerabilidades comunes como las del &lt;em&gt;OWASP Top 10&lt;/em&gt;, &lt;em&gt;SQL injections&lt;/em&gt;, &lt;em&gt;rate limiting&lt;/em&gt;, y bloqueo de tráfico proveniente de direcciones IP maliciosas basadas en la inteligencia de amenazas de Amazon. Sin embargo, si lo consideras necesario —y de hecho es lo recomendado—, personaliza tu ACL web según tus requerimientos y añade las reglas adicionales que estimes convenientes para proteger tu servidor &lt;em&gt;On-Premises&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Por favor, asegúrate de restringir el acceso al servidor &lt;em&gt;On-Premises&lt;/em&gt; únicamente a través de CloudFront, ya que, de lo contrario, el servidor permanecerá expuesto, sin inspección ni protección por parte de WAF, y por tanto vulnerable a ataques por otras rutas de acceso. 🥲&lt;/p&gt;

&lt;p&gt;Te recomiendo renovar el valor secreto del encabezado HTTP personalizado de CloudFront al menos una vez al año, como medida preventiva ante posibles filtraciones de seguridad. ⏱️&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;En conclusión, aunque tengamos una aplicación web alojada en un servidor &lt;em&gt;On-Premises&lt;/em&gt; que no podamos migrar a la nube, de forma sencilla el servicio gestionado AWS WAF nos permite implementar el firewall que necesitamos en forma de una ACL web con las reglas adecuadas, ya sea utilizando reglas administradas por Amazon o creando reglas personalizadas según nuestro caso de uso.&lt;/p&gt;

&lt;p&gt;De esta manera, podemos inspeccionar y filtrar todo el tráfico entrante hacia nuestro servidor &lt;em&gt;On-Premises&lt;/em&gt;, garantizando que únicamente el tráfico analizado por AWS WAF sea procesado, fortaleciendo así la postura de seguridad de la aplicación. 🥳&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué sigue
&lt;/h2&gt;

&lt;p&gt;En la siguiente sección encontrarás los recursos y documentos oficiales de los servicios mencionados, junto con algunos puntos interesantes relacionados con los temas tratados, por si deseas seguir aprendiendo o profundizar para evaluar si realmente aplican a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Te invito también a realizar esta implementación en tu propia cuenta de AWS. Cuéntame en los comentarios qué te pareció esta guía o si descubriste algo interesante durante tu implementación. ✍🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos oficiales
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;¿Qué es Amazon CloudFront?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/cloudfront/pricing/" rel="noopener noreferrer"&gt;Precios de Amazon CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/waf/latest/developerguide/waf-chapter.html" rel="noopener noreferrer"&gt;¿Qué es AWS WAF?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/waf/pricing/" rel="noopener noreferrer"&gt;Precios de AWS WAF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/waf/latest/developerguide/cloudfront-features.html" rel="noopener noreferrer"&gt;Uso AWS WAF con Amazon CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/acm/latest/userguide/acm-overview.html" rel="noopener noreferrer"&gt;¿Qué es AWS Certificate Manager?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="[https://aws.amazon.com/es/certificate-manager/pricing/"&gt;Precios de AWS Certificate Manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/Route53/latest/DeveloperGuide/Welcome.html" rel="noopener noreferrer"&gt;¿Qué es Amazon Route 53?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/route53/pricing/" rel="noopener noreferrer"&gt;Precios de Amazon Route 53&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>aws</category>
      <category>networking</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Protect Your On-Premises Web Application with AWS WAF: A Step-by-Step Guide</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Fri, 24 Oct 2025 03:15:22 +0000</pubDate>
      <link>https://dev.to/cbecerra/protect-your-on-premises-web-application-with-aws-waf-a-step-by-step-guide-50om</link>
      <guid>https://dev.to/cbecerra/protect-your-on-premises-web-application-with-aws-waf-a-step-by-step-guide-50om</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; This article will guide you through implementing AWS WAF for your web applications hosted on On-Premises servers. I’ll show step by step how to create SSL/TLS certificates, deploy a CloudFront distribution protected by WAF, and configure the necessary DNS routing for this implementation, all aligned with the Security pillar of the AWS Well-Architected Framework. 🧱&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Estimated reading time:&lt;/strong&gt; 15 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level:&lt;/strong&gt; 300&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spanish version:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/protege-tu-aplicacion-web-on-premises-con-aws-waf-guia-paso-a-paso-11pj"&gt;Protege tu aplicación web On-Premises con AWS WAF: Guía paso a paso&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Table of Contents:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why Implement AWS WAF in an On-Premises Web Application&lt;/li&gt;
&lt;li&gt;What You Are Going to Implement&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;
Implementation Steps

&lt;ul&gt;
&lt;li&gt;Create the SSL/TLS Certificates&lt;/li&gt;
&lt;li&gt;Create the CloudFront Distribution&lt;/li&gt;
&lt;li&gt;Configure DNS Routing&lt;/li&gt;
&lt;li&gt;Restrict Access to the On-Premises Server&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Cost Structure

&lt;ul&gt;
&lt;li&gt;Monthly Cost Estimate&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lessons Learned&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;What’s Next&lt;/li&gt;

&lt;li&gt;Official Resources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you’ve heard about &lt;strong&gt;AWS WAF&lt;/strong&gt;, you probably know that it’s a layer 7 firewall service that allows you to associate a Web Application Firewall directly with AWS resources such as Application Load Balancer, API Gateway, CloudFront Distributions, among others. However, it cannot be directly associated with an EC2 instance, specific IP addresses, or a particular ENI network interface; it can only be linked to certain AWS services.&lt;/p&gt;

&lt;p&gt;One day I received a request from a client who wanted to implement AWS WAF for a web application hosted on an On-Premises server exposed through a public IP address. The client clarified that they did not plan to migrate the server to the cloud; the server would remain On-Premises, but they needed WAF protection and wanted to know if it was possible to achieve this from AWS. 🤔&lt;/p&gt;

&lt;p&gt;With a bit of creativity, I came up with a solution: deploying a CloudFront distribution protected by AWS WAF, with the origin being the On-Premises server. After generating a few SSL/TLS certificates, modifying a couple of DNS records, and slightly adjusting the configuration of the local application, I managed to implement this solution with excellent results and a completely satisfied client. 😎&lt;/p&gt;

&lt;p&gt;In this article, I’ll explain why you should implement AWS WAF for your On-Premises web application, how I did it, and how you could do it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Implement AWS WAF in an On-Premises Web Application
&lt;/h2&gt;

&lt;p&gt;If you have an On-Premises web application and need to protect it with a Web Application Firewall (WAF) but don’t want to deploy and manage a local WAF solution manually, an excellent alternative is to implement AWS WAF.&lt;/p&gt;

&lt;p&gt;AWS WAF is a fully managed service by Amazon Web Services, which means you only need to define which rules to apply and which resource to protect. The service includes managed rules that analyze traffic for patterns of common vulnerabilities, and AWS takes care of maintaining and updating those rules for you. In addition, you can create custom rules, whether &lt;em&gt;stateful&lt;/em&gt; or &lt;em&gt;stateless&lt;/em&gt;, allow or block sets of IP addresses, apply geographical restrictions, create rules based on regular expressions (&lt;em&gt;regex&lt;/em&gt;), among many other options. 🤩&lt;/p&gt;

&lt;p&gt;With AWS WAF, you can provide your On-Premises web application with the protection of a modern firewall without the need to provision or manually manage a local WAF infrastructure. And if time is a critical factor, configuring AWS WAF is likely to be much faster than any other traditional alternative. 😏&lt;/p&gt;

&lt;p&gt;Whether you’re looking to strengthen the security of your web applications or comply with regulatory requirements, it’s important to know how to implement AWS WAF in an On-Premises web application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Are Going to Implement
&lt;/h2&gt;

&lt;p&gt;This guide assumes that you have an On-Premises server hosting a web application exposed on port &lt;code&gt;443&lt;/code&gt;, with a public IP address protected by HTTPS through an SSL/TLS certificate, and accessible from a domain (for example, &lt;code&gt;www&lt;/code&gt;) via a DNS &lt;code&gt;A&lt;/code&gt; record.&lt;/p&gt;

&lt;p&gt;Starting from this point, we will perform the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create two SSL/TLS certificates: one to configure in CloudFront and another to install on the On-Premises server.&lt;/li&gt;
&lt;li&gt;Install the corresponding SSL/TLS certificate on the On-Premises server.&lt;/li&gt;
&lt;li&gt;Create a CloudFront distribution, configured with its corresponding SSL/TLS certificate, whose origin will be a domain pointing to the On-Premises server.&lt;/li&gt;
&lt;li&gt;Configure a DNS &lt;code&gt;CNAME&lt;/code&gt; record to route all domain traffic to CloudFront.&lt;/li&gt;
&lt;li&gt;Configure an DNS &lt;code&gt;A&lt;/code&gt; record to route traffic from CloudFront to the On-Premises server.&lt;/li&gt;
&lt;li&gt;Configure the On-Premises application to accept traffic only from CloudFront.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the end of this implementation, we will have a resolution and redirection chain similar to the following flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Domain: &lt;code&gt;www.mydomain.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;DNS of the CloudFront distribution&lt;/li&gt;
&lt;li&gt;CloudFront distribution protected by AWS WAF&lt;/li&gt;
&lt;li&gt;Domain: &lt;code&gt;origin.mydomain.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Public IP address of the On-Premises server&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F6oqfedlow95k568vwuh2.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.amazonaws.com%2Fuploads%2Farticles%2F6oqfedlow95k568vwuh2.png" alt="Architecture" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;For this AWS WAF implementation, the following prerequisites are required:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to an AWS account.&lt;/li&gt;
&lt;li&gt;IAM permissions in the AWS account to use &lt;em&gt;Amazon CloudFront&lt;/em&gt;, &lt;em&gt;AWS WAF&lt;/em&gt;, &lt;em&gt;Amazon Route 53&lt;/em&gt;, and &lt;em&gt;AWS ACM&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Administrative access to the Authoritative DNS Provider (Cloudflare or Amazon Route 53).&lt;/li&gt;
&lt;li&gt;Access to an On-Premises server that hosts a web application exposed on port &lt;code&gt;443&lt;/code&gt;, with a public IP address.

&lt;ul&gt;
&lt;li&gt;Access to create SSL/TLS certificates issued by a public Certificate Authority (CA), for example, the same CA that issued the certificate currently installed on the On-Premises server.&lt;/li&gt;
&lt;li&gt;Permissions to install the certificate on the On-Premises server.&lt;/li&gt;
&lt;li&gt;Permissions to edit the configuration of the On-Premises application.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Implementation Steps
&lt;/h2&gt;

&lt;p&gt;The following sections provide a step-by-step guide for implementing AWS WAF on an On-Premises server, showing how each of the components integrates, such as the SSL/TLS certificates from ACM and a public CA, the DNS records in Amazon Route 53, the CloudFront distribution and the AWS WAF web ACL, in order to implement WAF on our On-Premises web application and ensure that all traffic is routed securely through AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the SSL/TLS Certificates
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Create and install the certificate for the On-Premises server
&lt;/h4&gt;

&lt;p&gt;To begin this implementation, we need to create a new certificate for the On-Premises server. As mentioned earlier, it is assumed that communication to your server was already protected via HTTPS, using an SSL/TLS certificate previously installed for the main hostname, for example, &lt;code&gt;www.mydomain.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Following the same method you originally used to generate the previous certificate with a public CA, now obtain a valid certificate for &lt;code&gt;origin.mydomain.com&lt;/code&gt;, either with the same public CA or another one of your choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Then, install the new SSL/TLS certificate in the same path where the previous certificate was located. Make sure the installation has been completed successfully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; To validate that the certificate installation is correct, you can use online tools such as &lt;a href="https://www.sslshopper.com/ssl-checker.html" rel="noopener noreferrer"&gt;sslshopper.com&lt;/a&gt; or &lt;a href="https://www.sslchecker.com/sslchecker" rel="noopener noreferrer"&gt;sslchecker.com&lt;/a&gt; to verify the hostname &lt;code&gt;origin.mydomain.com&lt;/code&gt;. The certificate must be valid for that hostname and not expired.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the certificate for CloudFront
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In the AWS console, navigate to the AWS Certificate Manager service and click the &lt;strong&gt;Request a Certificate&lt;/strong&gt; button.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkbje86oyajc752ud459t.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.amazonaws.com%2Fuploads%2Farticles%2Fkbje86oyajc752ud459t.png" alt="AWS Certificate Manager" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the &lt;em&gt;Certificate Type&lt;/em&gt; section, make sure &lt;strong&gt;Request a public certificate&lt;/strong&gt; is selected and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fqyntmayfx4fur0z34n98.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.amazonaws.com%2Fuploads%2Farticles%2Fqyntmayfx4fur0z34n98.png" alt="Certificate type" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; In the &lt;em&gt;Domain names&lt;/em&gt; section, enter your main domain, for example, &lt;code&gt;www.mydomain.com&lt;/code&gt;. In the &lt;em&gt;Validation method&lt;/em&gt; section, make sure &lt;strong&gt;DNS validation&lt;/strong&gt; is selected and click &lt;strong&gt;Request&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F4yb4m73lgt7w0pe5pj0c.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.amazonaws.com%2Fuploads%2Farticles%2F4yb4m73lgt7w0pe5pj0c.png" alt="Domain names" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Did you see the &lt;strong&gt;Allow export&lt;/strong&gt; section? It’s a relatively new feature in AWS that allows exporting public certificates issued by Amazon, including their private key, so you can install them wherever you want — for example, on an On-Premises server. This means that in the previous step, instead of using another public CA, we could have also used &lt;em&gt;AWS Certificate Manager&lt;/em&gt; to obtain the certificate intended for our On-Premises server. 😮&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; The certificate has been created but is in a pending validation state. For &lt;em&gt;ACM&lt;/em&gt; to verify that we truly own the domain specified in the certificate, we must create a &lt;code&gt;CNAME&lt;/code&gt; record in the Authoritative DNS Provider.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In my case, I’m using Amazon Route 53 to manage my domain, so I can simply click the &lt;strong&gt;Create records in Route 53&lt;/strong&gt; button.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you manage your domain in another Authoritative DNS Provider, then you must manually create the &lt;code&gt;CNAME&lt;/code&gt; record using the &lt;em&gt;CNAME name&lt;/em&gt; and &lt;em&gt;CNAME value&lt;/em&gt; listed in the &lt;em&gt;Domains&lt;/em&gt; section.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F3cl12nhpi0jv7c68bi1f.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.amazonaws.com%2Fuploads%2Farticles%2F3cl12nhpi0jv7c68bi1f.png" alt="Create records" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Finally, the AWS Certificate Manager certificate should move from the &lt;em&gt;Pending validation&lt;/em&gt; state to the &lt;em&gt;Issued&lt;/em&gt; state. This confirms that the certificate has been successfully issued in ACM.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fwrw04ar76c9xxparms7j.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.amazonaws.com%2Fuploads%2Farticles%2Fwrw04ar76c9xxparms7j.png" alt="Certificates Issued Status" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create the CloudFront Distribution
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In the AWS console, navigate to the Amazon CloudFront service and click the &lt;strong&gt;Create a CloudFront distribution&lt;/strong&gt; button.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fmwz2x6ik8eduv54m197t.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.amazonaws.com%2Fuploads%2Farticles%2Fmwz2x6ik8eduv54m197t.png" alt="Amazon CloudFront" width="800" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the &lt;em&gt;Distribution options&lt;/em&gt; section, fill in the &lt;strong&gt;Distribution name&lt;/strong&gt; field and, for this use case, make sure the &lt;strong&gt;Distribution type&lt;/strong&gt; selected is &lt;strong&gt;Single website or app&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; In the &lt;em&gt;Custom domain&lt;/em&gt; section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the domain in question is being managed by Amazon Route 53 within the same AWS account where you are creating the CloudFront distribution, add the domain and click &lt;strong&gt;Check Domain&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you manage that domain in another Authoritative DNS Provider or in Route 53 under a different AWS account, don’t worry — you’ll be able to add the custom domain in a later step.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fu0f7w6zvmmccxvz4pizh.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.amazonaws.com%2Fuploads%2Farticles%2Fu0f7w6zvmmccxvz4pizh.png" alt="Distribution options" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; In the &lt;em&gt;Origin type&lt;/em&gt; section, since our origin is an On-Premises server, select &lt;strong&gt;Other&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; In the &lt;em&gt;Origin&lt;/em&gt; section, specify &lt;code&gt;origin.mydomain.com&lt;/code&gt; as the &lt;strong&gt;Custom origin&lt;/strong&gt; and leave the &lt;strong&gt;Origin path&lt;/strong&gt; field empty.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fii85juagv3umez8p925e.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.amazonaws.com%2Fuploads%2Farticles%2Fii85juagv3umez8p925e.png" alt="Origin type" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; In the &lt;em&gt;Settings&lt;/em&gt; section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under &lt;em&gt;Origin settings&lt;/em&gt;, customize the parameters if you wish, or use the recommended configuration.&lt;/li&gt;
&lt;li&gt;Under &lt;em&gt;Cache settings&lt;/em&gt;, select &lt;strong&gt;Customize cache settings&lt;/strong&gt;, and for &lt;strong&gt;Origin request policy&lt;/strong&gt;, choose &lt;strong&gt;AllViewer&lt;/strong&gt;. Customize other parameters if you wish.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fo8loc3oxujxly63tl1aq.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.amazonaws.com%2Fuploads%2Farticles%2Fo8loc3oxujxly63tl1aq.png" alt="Settings" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; In the &lt;em&gt;Enable Security&lt;/em&gt; section, select &lt;strong&gt;Enable security protections&lt;/strong&gt;. If it applies to your use case, enable &lt;strong&gt;SQL protection&lt;/strong&gt; and &lt;strong&gt;Rate limiting&lt;/strong&gt;. This will create an AWS WAF web ACL with basic protection and associate it with the CloudFront distribution.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F2ie9a5eycmjhi8bwqta1.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.amazonaws.com%2Fuploads%2Farticles%2F2ie9a5eycmjhi8bwqta1.png" alt="Web Application Firewall" width="800" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.&lt;/strong&gt; Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.&lt;/strong&gt; As mentioned in step 3, if the domain is managed by Route 53 in the same AWS account and you previously specified it, the &lt;em&gt;Get TLS certificate&lt;/em&gt; section will automatically attempt to find a valid ACM certificate for that domain. In my case, it successfully found the certificate I created earlier.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the domain is being managed by another Authoritative DNS Provider or in Route 53 under a different AWS account, don’t worry — you’ll be able to add the TLS certificate in a later step.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F8gyqyq21ymcvs1hpdn86.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.amazonaws.com%2Fuploads%2Farticles%2F8gyqyq21ymcvs1hpdn86.png" alt="TLS Certificate" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12.&lt;/strong&gt; Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13.&lt;/strong&gt; Review the distribution details and click &lt;strong&gt;Create distribution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.&lt;/strong&gt; The CloudFront distribution will begin deploying. In the &lt;strong&gt;Last modified&lt;/strong&gt; column, you’ll see that it’s in the &lt;strong&gt;Deploying&lt;/strong&gt; state.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fdqxolq31tf3eu77grvh5.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.amazonaws.com%2Fuploads%2Farticles%2Fdqxolq31tf3eu77grvh5.png" alt="Deploying distribution" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15.&lt;/strong&gt; As mentioned in steps 3 and 11, if you manage your domain in another Authoritative DNS Provider or in Route 53 under a different AWS account, go to the &lt;em&gt;Settings&lt;/em&gt; section and click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16.&lt;/strong&gt; In the &lt;em&gt;General&lt;/em&gt; section, specify your domain in &lt;strong&gt;Alternate domain name (CNAME)&lt;/strong&gt; and select the ACM certificate you created earlier under &lt;strong&gt;Custom SSL certificate&lt;/strong&gt;. Then click &lt;strong&gt;Save changes&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F9ppauh4chmkh5gb0gq1v.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.amazonaws.com%2Fuploads%2Farticles%2F9ppauh4chmkh5gb0gq1v.png" alt="Edit settings" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17.&lt;/strong&gt; Once the distribution has finished deploying, under &lt;strong&gt;Last modified&lt;/strong&gt; you’ll see the full timestamp of the latest modification. If the &lt;em&gt;Alternate domain name&lt;/em&gt; and &lt;em&gt;Custom SSL certificate&lt;/em&gt; are correctly configured, you’ve successfully completed the creation and setup of your CloudFront distribution.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fgcdnb2z7ji8nniw5gphc.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.amazonaws.com%2Fuploads%2Farticles%2Fgcdnb2z7ji8nniw5gphc.png" alt="Deployed distribution" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18.&lt;/strong&gt; Copy the &lt;strong&gt;Distribution domain name&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure DNS Routing
&lt;/h3&gt;

&lt;p&gt;In my case, I’m managing my domain with Amazon Route 53, but you can create these DNS records in whichever Authoritative DNS Provider you’re using.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the CNAME record
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; If the domain in question is managed by Amazon Route 53 within the same AWS account where you’re creating the CloudFront distribution, take advantage and create a DNS record of type &lt;code&gt;Alias&lt;/code&gt;, pointing your main domain &lt;code&gt;www.mydomain.com&lt;/code&gt; to the CloudFront distribution.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fl81pzuwezj42pcdbxo6n.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.amazonaws.com%2Fuploads%2Farticles%2Fl81pzuwezj42pcdbxo6n.png" alt="Alias record" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; If the domain is managed in another Authoritative DNS Provider or in Route 53 from another AWS account, create a DNS &lt;code&gt;CNAME&lt;/code&gt; record, pointing your main domain &lt;code&gt;www.mydomain.com&lt;/code&gt; to the &lt;em&gt;Distribution domain name&lt;/em&gt; of CloudFront.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fh3jkjpktf3t9oglxk3xs.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.amazonaws.com%2Fuploads%2Farticles%2Fh3jkjpktf3t9oglxk3xs.png" alt="CNAME record" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the A record
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Create a DNS &lt;code&gt;A&lt;/code&gt; record pointing your new subdomain &lt;code&gt;origin.mydomain.com&lt;/code&gt; to the public IP address of your On-Premises server.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fxz3meygwi891db7q5upm.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.amazonaws.com%2Fuploads%2Farticles%2Fxz3meygwi891db7q5upm.png" alt="A record" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, you’ll have completed the necessary DNS configuration. However, we’re not done yet: if you try to access your server now via &lt;code&gt;www.mydomain.com&lt;/code&gt; and &lt;code&gt;origin.mydomain.com&lt;/code&gt;, both attempts will succeed, but there’s an important detail — &lt;code&gt;origin.mydomain.com&lt;/code&gt; &lt;strong&gt;is not protected by WAF&lt;/strong&gt; and therefore remains vulnerable. We’ll mitigate this risk in the next step.&lt;/p&gt;

&lt;p&gt;How can you easily tell whether &lt;code&gt;www.mydomain.com&lt;/code&gt; and &lt;code&gt;origin.mydomain.com&lt;/code&gt; are protected by WAF or not? I use a Google Chrome extension called &lt;a href="https://chromewebstore.google.com/detail/gppongmhjkpfnbhagpmjfkannfbllamg" rel="noopener noreferrer"&gt;Wappalyzer&lt;/a&gt;, which allows you to identify the technologies used on any website. For example, when testing my domains, Wappalyzer detected that the &lt;code&gt;www&lt;/code&gt; domain uses Amazon CloudFront as a CDN and Amazon Web Services as PaaS, while the &lt;code&gt;origin&lt;/code&gt; domain uses neither of these services. This confirms that traffic to the &lt;code&gt;origin&lt;/code&gt; domain does not pass through CloudFront and therefore is not inspected by AWS WAF. ⚠️&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F5nbdelxnbn14is2vuq93.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.amazonaws.com%2Fuploads%2Farticles%2F5nbdelxnbn14is2vuq93.png" alt="Wappalyzer comparison" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Restrict Access to the On-Premises Server
&lt;/h3&gt;

&lt;p&gt;Now we need to restrict access to the On-Premises server so that only traffic that passes through CloudFront — and has been inspected by AWS WAF — is accepted by the server.&lt;/p&gt;

&lt;p&gt;To achieve this, we have two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have CloudFront send an additional custom HTTP header with a secret value to the origin, and configure the origin to only accept traffic that contains this header with the correct secret value.&lt;/li&gt;
&lt;li&gt;Configure the On-Premises server firewall to accept traffic only from CloudFront IP ranges specified in the &lt;a href="https://ip-ranges.amazonaws.com/ip-ranges.json" rel="noopener noreferrer"&gt;ip-ranges.json&lt;/a&gt; file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since the second option would potentially require updating the On-Premises firewall rules every time Amazon modifies the &lt;em&gt;ip-ranges.json&lt;/em&gt; file, I lean toward the first alternative, which is actually Amazon’s recommended option when you need to restrict access to an Application Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; In the AWS console, select the CloudFront distribution. In the &lt;strong&gt;Origins&lt;/strong&gt; tab, select the configured origin and click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fh4mpjblytcap09hkhf2n.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.amazonaws.com%2Fuploads%2Farticles%2Fh4mpjblytcap09hkhf2n.png" alt="Origins" width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the &lt;em&gt;Settings&lt;/em&gt; section, under &lt;strong&gt;Add custom header&lt;/strong&gt;, click &lt;strong&gt;Add header&lt;/strong&gt; and add a custom HTTP header. The value of this header must be secret and not publicly exposed. Save the changes.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkna7yewx728uu33fa886.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.amazonaws.com%2Fuploads%2Farticles%2Fkna7yewx728uu33fa886.png" alt="Add custom header" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now CloudFront will add this HTTP header to all requests it sends to the origin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Finally, configure the On-Premises web server to only accept requests that contain the custom HTTP header from CloudFront with the correct secret value.&lt;/p&gt;

&lt;p&gt;With this, we’ve completed the implementation of AWS WAF for an On-Premises web application through CloudFront, restricting access through other means and ensuring that all traffic to the On-Premises server is securely inspected. 🔍&lt;/p&gt;




&lt;h2&gt;
  
  
  Cost Structure
&lt;/h2&gt;

&lt;p&gt;The costs to consider in this implementation are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon CloudFront (distribution, Price Class “Use all edge locations”)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Data transfer out to the Internet (first tier): ~ USD 0.085 per GB for United States/Mexico/Canada/Europe.&lt;/li&gt;
&lt;li&gt;HTTP/HTTPS request cost: for the USA it’s quoted at ~ USD 0.01 per 10,000 requests (~ USD 0.000001 per request) according to a recent guide.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Note&lt;/em&gt;: There’s a free tier of 1 TB of data transfer out + 10 million requests/month for CloudFront.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS WAF (Web ACL associated with CloudFront)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Web ACL cost: USD 5/month per Web ACL.&lt;/li&gt;
&lt;li&gt;Cost per rule inside the Web ACL: USD 1/month per rule.&lt;/li&gt;
&lt;li&gt;Cost per inspected request: USD 0.60 per million requests.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Amazon Route 53 (Hosted Zone + records)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Cost per public hosted zone: USD 0.50/month for the first 25 hosted zones.&lt;/li&gt;
&lt;li&gt;Additional cost per record (if you have more than 10,000 per zone): USD 0.0015/month per additional record.&lt;/li&gt;
&lt;li&gt;Standard DNS query cost: ~ USD 0.40 per million queries (first 1B queries).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS Certificate Manager (ACM Certificate for FQDN)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If it’s a public certificate managed by ACM, usage with integrated services (such as CloudFront) &lt;strong&gt;has no additional cost&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If it were an exportable or wildcard certificate, there would be fees, but in this case a single FQDN using CloudFront → estimated cost = USD 0/month.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;It’s worth mentioning that the prices listed correspond to October 2025. 💲&lt;/p&gt;

&lt;h3&gt;
  
  
  Monthly Cost Estimate
&lt;/h3&gt;

&lt;p&gt;Using my implementation as a reference with the following assumptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Region us-east-1&lt;/li&gt;
&lt;li&gt;Outbound data (egress) from CloudFront: 1,000 GB/month&lt;/li&gt;
&lt;li&gt;Requests to CloudFront: 10 million requests/month&lt;/li&gt;
&lt;li&gt;One Web ACL in AWS WAF associated with the distribution&lt;/li&gt;
&lt;li&gt;One hosted zone in Route 53 with one A record + one CNAME record&lt;/li&gt;
&lt;li&gt;One ACM certificate for one FQDN&lt;/li&gt;
&lt;li&gt;No advanced rules, no wildcard certificate, no massive DNS queries.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Calculations:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CloudFront — data transfer out&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;1,000 GB × USD 0.085/GB = USD 85.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;CloudFront — requests&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;10 million requests → (10,000,000 / 10,000) × USD 0.01 = 1,000 × USD 0.01 = USD 10.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — Web ACL&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 5.00/month (one Web ACL)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — rules&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Assuming only 1 rule for simplicity → USD 1.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;WAF — inspected requests&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;10 million requests × (USD 0.60 per million) = 10 × USD 0.60 = USD 6.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — hosted zone&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 0.50/month (one public zone)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — records&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Only 2 records (A + CNAME) → none above threshold → USD 0.00 extra&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Route 53 — DNS queries&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Assuming modest use (for example, ~100,000 queries) → 0.1 million × USD 0.40 = USD 0.04 (approximately). For simplicity, rounded to ≈ USD 0.05/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;ACM — integrated public certificate&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;USD 0.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Estimated Total:
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Estimated Monthly Cost (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CloudFront — data transfer out&lt;/td&gt;
&lt;td&gt;85.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CloudFront — requests&lt;/td&gt;
&lt;td&gt;10.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — Web ACL&lt;/td&gt;
&lt;td&gt;5.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — rules&lt;/td&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WAF — inspected requests&lt;/td&gt;
&lt;td&gt;6.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — hosted zone&lt;/td&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — records&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Route 53 — DNS queries&lt;/td&gt;
&lt;td&gt;0.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACM — certificate&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Estimated Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~ USD 107.55&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;In my experience, when creating certificates, specify the exact FQDN you will use. Do not use &lt;em&gt;wildcards&lt;/em&gt; unless you truly need them, as &lt;em&gt;wildcard&lt;/em&gt; certificates tend to be significantly more expensive and, in most cases, are not fully utilized. 💰&lt;/p&gt;

&lt;p&gt;The WAF protection I implemented for CloudFront in this guide includes defense against common vulnerabilities such as those listed in the &lt;em&gt;OWASP Top 10&lt;/em&gt;, SQL injections, rate limiting, and blocking traffic from malicious IP addresses based on Amazon’s threat intelligence. However, if you deem it necessary—and in fact, it is recommended—customize your web ACL according to your requirements and add any additional rules you consider appropriate to protect your On-Premises server.&lt;/p&gt;

&lt;p&gt;Please make sure to restrict access to the On-Premises server exclusively through CloudFront; otherwise, the server will remain exposed, without inspection or protection by WAF, and therefore vulnerable to attacks through other access paths. 🥲&lt;/p&gt;

&lt;p&gt;I recommend renewing the secret value of the custom CloudFront HTTP header at least once a year as a preventive measure against potential security leaks. ⏱️&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, even if we have a web application hosted on an On-Premises server that we cannot migrate to the cloud, the managed service AWS WAF allows us to easily implement the firewall we need in the form of a web ACL with the appropriate rules, whether by using managed rules provided by Amazon or by creating custom rules tailored to our use case.&lt;/p&gt;

&lt;p&gt;This way, we can inspect and filter all incoming traffic to our On-Premises server, ensuring that only traffic analyzed by AWS WAF is processed, thus strengthening the security posture of the application. 🥳&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;p&gt;In the following section, you will find the official resources and documentation for the mentioned services, along with some interesting points related to the discussed topics, in case you want to continue learning or explore further to determine if they apply to your use case.&lt;/p&gt;

&lt;p&gt;I also invite you to implement this solution in your own AWS account. Let me know in the comments what you thought of this guide or if you discovered something interesting during your implementation. ✍🏻&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;What is Amazon CloudFront?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/cloudfront/pricing/" rel="noopener noreferrer"&gt;Amazon CloudFront Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html" rel="noopener noreferrer"&gt;What is AWS WAF?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/waf/pricing/" rel="noopener noreferrer"&gt;AWS WAF Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/cloudfront-features.html" rel="noopener noreferrer"&gt;Using AWS WAF with Amazon CloudFront&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html" rel="noopener noreferrer"&gt;What is AWS Certificate Manager?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/certificate-manager/pricing/" rel="noopener noreferrer"&gt;AWS Certificate Manager Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html" rel="noopener noreferrer"&gt;What is Amazon Route 53?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/route53/pricing/" rel="noopener noreferrer"&gt;Amazon Route 53 Pricing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>english</category>
      <category>aws</category>
      <category>networking</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Cómo implementar AWS Network Firewall en una arquitectura multicuenta utilizando Transit Gateway</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Mon, 13 Oct 2025 23:15:50 +0000</pubDate>
      <link>https://dev.to/cbecerra/como-implementar-aws-network-firewall-en-una-arquitectura-multicuenta-utilizando-transit-gateway-g1c</link>
      <guid>https://dev.to/cbecerra/como-implementar-aws-network-firewall-en-una-arquitectura-multicuenta-utilizando-transit-gateway-g1c</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Este artículo te guiará en la implementación de AWS Network Firewall dentro de una arquitectura multicuenta de alta disponibilidad, que abarca tres zonas de disponibilidad, en conjunto con un Transit Gateway para conectar VPCs a través de diferentes cuentas dentro de una estructura de AWS Organizations. La arquitectura sigue un patrón Hub &amp;amp; Spoke, donde la cuenta Hub corresponde a la cuenta de Networking y las cuentas Spoke incluyen los entornos de Desarrollo, QA, Producción y DevOps. 🛡️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tiempo estimado de lectura:&lt;/strong&gt; 20 minutos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nivel:&lt;/strong&gt; 300&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versión en inglés:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/how-to-implement-aws-network-firewall-in-a-multi-account-architecture-using-transit-gateway-2nam"&gt;How to Implement AWS Network Firewall in a Multi-Account Architecture Using Transit Gateway&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tabla de Contenidos:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introducción&lt;/li&gt;
&lt;li&gt;Por qué implementar AWS Network Firewall&lt;/li&gt;
&lt;li&gt;Qué vas a construir&lt;/li&gt;
&lt;li&gt;Prerrequisitos&lt;/li&gt;
&lt;li&gt;
Pasos de Implementación

&lt;ul&gt;
&lt;li&gt;Configura el Transit Gateway&lt;/li&gt;
&lt;li&gt;Construye la VPC de Ingreso&lt;/li&gt;
&lt;li&gt;Construye la VPC de Inspección&lt;/li&gt;
&lt;li&gt;Construye la VPC de Egreso&lt;/li&gt;
&lt;li&gt;Construye las VPCs de Carga de Trabajo&lt;/li&gt;
&lt;li&gt;Configura AWS Network Firewall&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Revisa la Arquitectura Final

&lt;ul&gt;
&lt;li&gt;Valida Conectividad e Inspección de Tráfico&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Bonus: Attachment de Transit Gateway de Network Firewall&lt;/li&gt;

&lt;li&gt;

Estructura de costos

&lt;ul&gt;
&lt;li&gt;Estimación de costos mensual&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lecciones Aprendidas&lt;/li&gt;

&lt;li&gt;Conclusión&lt;/li&gt;

&lt;li&gt;Qué sigue&lt;/li&gt;

&lt;li&gt;Recursos oficiales&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;Cuando en el trabajo me tocó implementar por primera vez &lt;strong&gt;AWS Network Firewall&lt;/strong&gt;, honestamente tenía un poco de temor; pensaba que sería más complejo. Sin embargo, la implementación resulta relativamente sencilla si uno se maneja bien con redes y enrutamiento.&lt;/p&gt;

&lt;p&gt;Aun así, mis primeras configuraciones de red para implementar Network Firewall no fueron las mejores ni las más ordenadas, pero eventualmente lo logré: una implementación correcta y organizada de AWS Network Firewall, alineada con las mejores prácticas recomendadas por AWS. 🥳&lt;/p&gt;

&lt;p&gt;Y, sinceramente, me gustaría que otros pudieran evitar esos errores al intentar configurar AWS Network Firewall por primera vez, especialmente en lo que respecta al enrutamiento, que para mí fue la parte más compleja, y que así pierdan el temor al servicio y a las redes. Por ello estoy escribiendo este artículo: para compartir cómo debería configurarse correctamente la red y el enrutamiento, o, al menos, la manera en que yo lo hice.&lt;/p&gt;

&lt;p&gt;Para dar un poco de contexto, en un entorno multicuenta, AWS Network Firewall cumple un rol importante al proporcionar protección de red centralizada, permitiendo controles de seguridad consistentes e inspección de tráfico a través de todas las cuentas.&lt;/p&gt;

&lt;p&gt;Esta implementación adopta un modelo de &lt;em&gt;ingreso centralizado&lt;/em&gt;, &lt;em&gt;egreso centralizado&lt;/em&gt; e &lt;em&gt;inspección centralizada&lt;/em&gt;, asegurando que el tráfico entrante, saliente y entre VPCs sea enrutado de forma segura a través de una única capa de inspección gestionada por la cuenta de &lt;em&gt;Networking&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Por qué implementar AWS Network Firewall
&lt;/h2&gt;

&lt;p&gt;Probablemente ya conozcas varios tipos de firewalls en AWS, como los &lt;em&gt;Grupos de Seguridad (SG)&lt;/em&gt;, las &lt;em&gt;Listas de Control de Acceso de Red (NACL)&lt;/em&gt; y el &lt;em&gt;Firewall de Aplicaciones Web (WAF)&lt;/em&gt;, y te estés preguntando: ¿por qué necesito otro servicio de firewall más?&lt;/p&gt;

&lt;p&gt;Bueno, AWS Network Firewall es un servicio más robusto que surge para resolver un caso de uso distinto. Empecemos por aclarar que AWS WAF solo puede implementarse en servicios específicos de AWS como &lt;em&gt;ALB&lt;/em&gt;, &lt;em&gt;API Gateway&lt;/em&gt; y &lt;em&gt;CloudFront&lt;/em&gt;, pero no de forma abierta en cualquier &lt;em&gt;Elastic Network Interface (ENI)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Por otro lado, los grupos de seguridad y las Network ACLs existen de manera independiente en cada VPC, cada uno con sus propias reglas de seguridad descentralizadas, lo cual puede volverse complicado de gestionar con el tiempo.&lt;/p&gt;

&lt;p&gt;Imagina que tienes múltiples VPCs o incluso varias cuentas de AWS, y en todas necesitas aplicar las mismas reglas de firewall, tanto &lt;em&gt;stateless&lt;/em&gt; como &lt;em&gt;stateful&lt;/em&gt;. No tendría mucho sentido implementar una y otra vez los mismos SG, NACL y WAF en cada VPC o cuenta, ¿cierto? Y aunque lo hicieras, mantener y administrar esas configuraciones sería un caos. 😵&lt;/p&gt;

&lt;p&gt;Además, tanto los SG como las NACLs tienen un límite relativamente pequeño en la cantidad de reglas que soportan, y como mencionamos antes, WAF solo funciona con ciertos servicios. Entonces, ¿cómo resolvemos esto?&lt;/p&gt;

&lt;p&gt;Aquí es donde entra &lt;strong&gt;AWS Network Firewall&lt;/strong&gt;. Este servicio permite desplegar un firewall en forma de servicio virtual, con sus propias &lt;em&gt;ENIs&lt;/em&gt;, hacia las cuales podemos enrutar todo el tráfico entrante y saliente para que sea inspeccionado antes de llegar a su destino final. De este modo, obtenemos todos los beneficios de los firewalls &lt;em&gt;stateless&lt;/em&gt; y &lt;em&gt;stateful&lt;/em&gt;, desde la capa 3 hasta la capa 7. 🤩&lt;/p&gt;

&lt;p&gt;Y si bien como alternativa podrías desplegar tu propio &lt;em&gt;appliance&lt;/em&gt; de seguridad —o uno de terceros— detrás de un &lt;em&gt;Gateway Load Balancer&lt;/em&gt; para realizar la inspección, la diferencia es que, en ese caso, tú serías responsable de gestionarlo completamente, mientras que AWS Network Firewall es un servicio totalmente gestionado por AWS y ofrece muchas funcionalidades interesantes.&lt;/p&gt;

&lt;p&gt;En resumen, los grupos de seguridad y las NACLs pueden ser suficientes a pequeña escala, con un par de VPCs, pero a medida que creces y comienzas a manejar múltiples VPCs y cuentas AWS, querrás —o incluso necesitarás— centralizar la inspección de red. Y es precisamente por eso que deberías aprender a implementar AWS Network Firewall.&lt;/p&gt;

&lt;p&gt;Aquí te dejo una tabla comparativa entre los distintos tipos de firewalls en AWS, para que puedas entender mejor las diferencias entre ellos.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Security Group&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Network ACL&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;WAF&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;AWS Network Firewall&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Protección en&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Nivel de instancia EC2&lt;/td&gt;
&lt;td&gt;Nivel de subred&lt;/td&gt;
&lt;td&gt;Nivel de endpoint (ALB, CloudFront, etc.)&lt;/td&gt;
&lt;td&gt;Nivel de VPC, basado en rutas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Con estado o sin estado&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Con estado&lt;/td&gt;
&lt;td&gt;Sin estado&lt;/td&gt;
&lt;td&gt;Sin estado&lt;/td&gt;
&lt;td&gt;Ambos&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Capa OSI&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Capa 3/4&lt;/td&gt;
&lt;td&gt;Capa 3/4&lt;/td&gt;
&lt;td&gt;Capa 7&lt;/td&gt;
&lt;td&gt;Capas 3–7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Características&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Filtrado por IP, puerto y protocolo&lt;/td&gt;
&lt;td&gt;Filtrado por IP, puerto y protocolo&lt;/td&gt;
&lt;td&gt;Filtrado a nivel de aplicación&lt;/td&gt;
&lt;td&gt;Reglas sin estado/ACL de Capa 3, reglas con estado de Capa 4, IPS/IDS en Capa 7, filtrado FQDN, detección de protocolo, listas grandes de IP permitidas/bloqueadas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flujos&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Todo el tráfico de entrada/salida a nivel de instancia&lt;/td&gt;
&lt;td&gt;Todo el tráfico de entrada/salida a nivel de subred&lt;/td&gt;
&lt;td&gt;Solo tráfico de entrada desde internet hacia API Gateway, ALB o CloudFront&lt;/td&gt;
&lt;td&gt;Todo el tráfico de entrada/salida en el perímetro de la VPC (por ejemplo, IGW, VGW, DX, VPN, VPC–VPC)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Qué vas a construir
&lt;/h2&gt;

&lt;p&gt;Como mencioné antes, la implementación no es particularmente complicada, pero sí requiere una buena base en redes y enrutamiento. Cuando esta guía dice “Crea un Transit Gateway”, se asume que ya sabes cómo hacerlo. Y si bien esta guía no incluye infraestructura como código lista para desplegar, sí ofrece un listado paso a paso adecuado para este nivel. Lo más importante es que incluye la configuración de enrutamiento, que en mi experiencia es la parte más complicada. 😉&lt;/p&gt;

&lt;p&gt;Esta implementación consta de cinco componentes que vas a construir:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Transit Gateway&lt;/strong&gt; compartido mediante AWS RAM y conectado a todas las VPC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPC de ingreso&lt;/strong&gt; con Internet Gateway para la conectividad de entrada centralizada.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPC de inspección&lt;/strong&gt; con AWS Network Firewall desplegado en alta disponibilidad, usando el tipo de &lt;em&gt;attachment&lt;/em&gt; VPC o TGW para la inspección centralizada.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPC de egreso&lt;/strong&gt; con NAT Gateways en alta disponibilidad para la conectividad de salida centralizada.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPCs de carga de trabajo&lt;/strong&gt; para los entornos de &lt;em&gt;Desarrollo&lt;/em&gt;, &lt;em&gt;QA&lt;/em&gt;, &lt;em&gt;Producción&lt;/em&gt; y &lt;em&gt;DevOps&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No te preocupes si por ahora aún no puedes visualizar la solución completa. En la sección de pasos de implementación encontrarás diagramas de arquitectura para cada uno de estos cinco componentes, además del diagrama final de la solución completa.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerrequisitos
&lt;/h2&gt;

&lt;p&gt;Para esta implementación, se recomienda contar con múltiples cuentas de AWS y con los permisos adecuados en cada una de ellas.&lt;/p&gt;

&lt;p&gt;Si aún no dispones de múltiples cuentas, puedes crearlas mediante AWS Organizations y acceder a ellas utilizando IAM Identity Center, en lugar de usuarios individuales de IAM, si lo prefieres.&lt;/p&gt;

&lt;p&gt;En caso de no tener acceso a varias cuentas de AWS, puedes realizar el despliegue de todas las VPC dentro de una misma cuenta; en ese caso, simplemente deberás omitir el paso de compartir el Transit Gateway mediante AWS RAM.&lt;/p&gt;

&lt;p&gt;Necesitarás permisos sobre &lt;em&gt;Amazon VPC&lt;/em&gt;, &lt;em&gt;AWS Transit Gateway&lt;/em&gt;, &lt;em&gt;AWS RAM&lt;/em&gt;, &lt;em&gt;AWS Network Firewall&lt;/em&gt; y, de forma opcional, sobre &lt;em&gt;CloudWatch Logs&lt;/em&gt;, &lt;em&gt;EC2&lt;/em&gt; y &lt;em&gt;Session Manager&lt;/em&gt;, entre otros, para poder ejecutar las acciones descritas en esta guía.&lt;/p&gt;

&lt;p&gt;El despliegue lo realizaré en la región &lt;em&gt;N. Virginia (us-east-1)&lt;/em&gt;, y el siguiente diagrama refleja cómo luce mi estructura multicuenta al inicio: una cuenta destinada a los recursos de red (&lt;em&gt;Hub&lt;/em&gt;) y cuatro cuentas para las cargas de trabajo (&lt;em&gt;Spoke&lt;/em&gt;).&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fswzfp9hj7mhkvdtj2ayz.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.amazonaws.com%2Fuploads%2Farticles%2Fswzfp9hj7mhkvdtj2ayz.png" alt="AWS Organization Accounts" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Pasos de Implementación
&lt;/h2&gt;

&lt;p&gt;Las siguientes secciones proporcionan un recorrido paso a paso del proceso de configuración de la red, mostrando cómo cada componente, incluyendo el Transit Gateway, VPCs compartidas, VPCs de carga de trabajo y AWS Network Firewall, se integra para crear una base segura y escalable para la conectividad y la inspección entre cuentas.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configura el Transit Gateway
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Crea un Transit Gateway con configuración predeterminada.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Crea dos tablas de enrutamiento de Transit Gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modifica el Transit Gateway y asigna:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tgw-default-association-rtb&lt;/code&gt; como la Tabla de Enrutamiento de Asociación Predeterminada&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt; como la Tabla de Enrutamiento de Propagación Predeterminada&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;En AWS RAM, crea un Resource Share con:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;El Transit Gateway recién creado como el &lt;em&gt;Shared resource&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Las cuentas &lt;em&gt;Spoke&lt;/em&gt; como los &lt;em&gt;Shared principals&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;(Opcional)&lt;/em&gt; Crea un TGW Flow Log para el Transit Gateway para monitorear y registrar el tráfico que fluye a través de él.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fx3vm7i1yqtx8cso8l0ge.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.amazonaws.com%2Fuploads%2Farticles%2Fx3vm7i1yqtx8cso8l0ge.png" alt="Transit Gateway" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notas para la Creación de Subred y Selección de Zona de Disponibilidad:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creación de Subred de Conectividad:&lt;/strong&gt; Cuando creas una VPC que tendrá conectividad con el Transit Gateway (TGW), se recomienda crear una subred &lt;code&gt;/28&lt;/code&gt; exclusivamente para alojar las Interfaces de Red Elásticas (ENIs) desplegadas por TGW. Esto sigue las mejores prácticas para una gestión eficiente de recursos.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selección de AZ:&lt;/strong&gt; Elige el mismo ID de Zona de Disponibilidad (AZ), en lugar del nombre de AZ, para evitar cargos por tráfico entre zonas. Por ejemplo, en este caso, estamos usando &lt;code&gt;use1-az1&lt;/code&gt;, &lt;code&gt;use1-az2&lt;/code&gt;, &lt;code&gt;use1-az4&lt;/code&gt;. Es importante notar que &lt;code&gt;us-east-1a&lt;/code&gt; y &lt;code&gt;us-east-1b&lt;/code&gt; son alias únicos para cada cuenta de AWS. Para asegurarte de que despliegas tus recursos en la misma AZ, usa IDs de AZ en lugar de alias.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Soporte de Network Firewall:&lt;/strong&gt; AWS Network Firewall no es soportado en &lt;code&gt;us1-az3&lt;/code&gt;, por lo que elegimos usar &lt;code&gt;use1-az4&lt;/code&gt; en su lugar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Identificación de AZ:&lt;/strong&gt; Se recomienda añadir el ID de AZ en la etiqueta de nombre de la subred, tabla de enrutamiento y cualquier &lt;em&gt;network appliance&lt;/em&gt; asociada para una fácil identificación y gestión.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Construye la VPC de Ingreso
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Crea una VPC (por ejemplo, nombrada &lt;em&gt;VPC de ingreso&lt;/em&gt;, CIDR &lt;code&gt;10.20.0.0/20&lt;/code&gt;) con:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 subredes públicas (por ejemplo, &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 subredes privadas para conectividad TGW (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;1 Internet Gateway&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Crea un Transit Gateway attachment entre el Transit Gateway y la &lt;em&gt;VPC de Ingreso&lt;/em&gt;, seleccionando los IDs de Subred de las 3 subredes de conectividad TGW.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred de Conectividad TGW&lt;/em&gt; (esta tabla de enrutamiento solo tendrá una ruta local):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ingress-vpc-tgw-connectivity-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Ingreso&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred Pública&lt;/em&gt; (esta tabla de enrutamiento necesita una ruta &lt;code&gt;0.0.0.0/0&lt;/code&gt; al Internet Gateway y rutas a los CIDRs de las VPCs Spoke para ir a través del attachment TGW):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ingress-vpc-public-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Ingreso&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Desarrollo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de QA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Producción&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;igw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Acceso a Internet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Opcional:&lt;/em&gt; Crea un VPC Flow Log para la VPC para monitorear y registrar el tráfico que fluye a través de la &lt;em&gt;VPC de Ingreso&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fuvkudyw8g39peetzs8cg.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.amazonaws.com%2Fuploads%2Farticles%2Fuvkudyw8g39peetzs8cg.png" alt="VPC de Ingreso" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Construye la VPC de Inspección
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Crea una VPC (por ejemplo, nombrada &lt;em&gt;VPC de inspección&lt;/em&gt;, CIDR &lt;code&gt;10.20.16.0/20&lt;/code&gt;) con:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 subredes privadas para Network Firewall (por ejemplo, &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 subredes privadas para conectividad TGW (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Crea un Transit Gateway attachment entre el Transit Gateway y la &lt;em&gt;VPC de Inspección&lt;/em&gt;, seleccionando los IDs de Subred de las 3 subredes de conectividad TGW. Habilita &lt;em&gt;Appliance Mode Support&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Nota:&lt;/strong&gt; Habilitar &lt;em&gt;Appliance Mode&lt;/em&gt; en el attachment del Transit Gateway asegura que todo el tráfico de una sesión fluya a través del mismo firewall en la misma Zona de Disponibilidad, previniendo que el tráfico entre AZ sea inspeccionado por el firewall. Esta configuración es importante para mantener una inspección de tráfico consistente y mejorar el rendimiento en arquitecturas multi-AZ.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edita manualmente las Tablas de Enrutamiento del Transit Gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remueve la propagación del attachment de la &lt;em&gt;VPC de Inspección&lt;/em&gt; en la Tabla de Enrutamiento de Propagación Predeterminada del TGW.&lt;/li&gt;
&lt;li&gt;Remueve la asociación del attachment de la &lt;em&gt;VPC de Inspección&lt;/em&gt; en la Tabla de Enrutamiento de Asociación Predeterminada del TGW.&lt;/li&gt;
&lt;li&gt;Asocia la &lt;em&gt;Tabla de Enrutamiento de Propagación Predeterminada del TGW&lt;/em&gt; con el &lt;em&gt;Attachment de la VPC de Inspección&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;En la &lt;em&gt;Tabla de Enrutamiento de Asociación Predeterminada del TGW&lt;/em&gt;, crea una ruta estática a &lt;code&gt;0.0.0.0/0&lt;/code&gt; hacia el &lt;em&gt;Attachment de la VPC de Inspección&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;En la consola de AWS Network Firewall:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Elige &lt;strong&gt;Crear firewall&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Describir firewall:&lt;/em&gt; Añade un nombre y (opcionalmente) una descripción.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Tipo de asociación:&lt;/em&gt; Elige &lt;strong&gt;VPC&lt;/strong&gt; y selecciona la &lt;em&gt;VPC de Inspección&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Subredes del Firewall:&lt;/em&gt; Selecciona las 3 subredes privadas (no las subredes de conectividad).&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Asociar Política de Firewall:&lt;/em&gt; Elige &lt;strong&gt;Crear y asociar una política de firewall vacía&lt;/strong&gt; y especifica un nuevo nombre de política de firewall.&lt;/li&gt;
&lt;li&gt;Crea el firewall; esto tomará unos minutos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura las &lt;em&gt;Tablas de Enrutamiento de Subred de Conectividad TGW&lt;/em&gt; (una por AZ). En cada tabla de enrutamiento, añade una ruta a su correspondiente endpoint de VPC de AWS Network Firewall (de tipo &lt;em&gt;Gateway Load Balancer Endpoint&lt;/em&gt;) por AZ:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az1&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Inspección&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Endpoint de firewall para use1-az1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az2&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Inspección&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Endpoint de firewall para use1-az2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az4&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Inspección&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Endpoint de firewall para use1-az4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred Privada&lt;/em&gt; (esta tabla de enrutamiento necesita una ruta &lt;code&gt;0.0.0.0/0&lt;/code&gt; al attachment del Transit Gateway):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-private-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Inspección&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transit Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Opcional:&lt;/em&gt; Crea un VPC Flow Log para la VPC para monitorear y registrar el tráfico que fluye a través de la &lt;em&gt;VPC de Inspección&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ftj3e14gdqwo8s94iiqur.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.amazonaws.com%2Fuploads%2Farticles%2Ftj3e14gdqwo8s94iiqur.png" alt="VPC de Inspección" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Después de haber implementado en múltiples ocasiones la &lt;em&gt;VPC de Inspección&lt;/em&gt;, AWS finalmente lanzó una nueva funcionalidad para AWS Network Firewall: el &lt;strong&gt;Transit Gateway Firewall Attachment&lt;/strong&gt;. Con esta característica, el firewall se conecta directamente al Transit Gateway, eliminando la necesidad de contar con una VPC de inspección. ¿Te interesa? Revisa la sección &lt;em&gt;Bonus&lt;/em&gt; más abajo. 😀&lt;/p&gt;




&lt;h3&gt;
  
  
  Construye la VPC de Egreso
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Crea una VPC (por ejemplo, nombrada &lt;em&gt;VPC de egreso&lt;/em&gt;, CIDR &lt;code&gt;10.20.32.0/20&lt;/code&gt;) con:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 subredes públicas (por ejemplo, &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 subredes privadas para conectividad TGW (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;1 Internet Gateway&lt;/li&gt;
&lt;li&gt;1 NAT Gateway por AZ para alta disponibilidad&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Crea un Transit Gateway attachment entre el Transit Gateway y la &lt;em&gt;VPC de Egreso&lt;/em&gt;, seleccionando los IDs de Subred de las 3 subredes de conectividad TGW.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edita manualmente las Tablas de Enrutamiento del Transit Gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;En la &lt;em&gt;Tabla de Enrutamiento de Propagación Predeterminada del TGW&lt;/em&gt;, crea una ruta estática a &lt;code&gt;0.0.0.0/0&lt;/code&gt; hacia el &lt;em&gt;Attachment de la VPC de Egreso&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura las &lt;em&gt;Tablas de Enrutamiento de Subred de Conectividad TGW&lt;/em&gt; (crea una tabla de enrutamiento por AZ, y en cada tabla añade una ruta &lt;code&gt;0.0.0.0/0&lt;/code&gt; a su correspondiente NAT Gateway):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az1&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT para use1-az1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az2&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT para use1-az2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az4&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT para use1-az4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred Pública&lt;/em&gt; (esta tabla de enrutamiento necesita una ruta &lt;code&gt;0.0.0.0/0&lt;/code&gt; al Internet Gateway y rutas a los CIDRs de las VPCs Spoke para ir a través del attachment TGW):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-public-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Desarrollo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de QA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Producción&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de DevOps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;igw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Acceso a Internet&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Opcional:&lt;/em&gt; Crea un VPC Flow Log para la VPC para monitorear y registrar el tráfico que fluye a través de la &lt;em&gt;VPC de Egreso&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F467p6yeh7yq477ccbhdf.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.amazonaws.com%2Fuploads%2Farticles%2F467p6yeh7yq477ccbhdf.png" alt="VPC de Egreso" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Construye las VPCs de Carga de Trabajo
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Crea una VPC (por ejemplo, nombrada &lt;em&gt;VPC de desarrollo&lt;/em&gt;, CIDR &lt;code&gt;10.21.0.0/16&lt;/code&gt;) con:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 subredes privadas para cargas de trabajo (por ejemplo, &lt;code&gt;/20&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 subredes privadas para conectividad TGW (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Crea un Transit Gateway attachment entre el Transit Gateway y la VPC, seleccionando los IDs de Subred de las 3 subredes de conectividad TGW.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred de Conectividad TGW&lt;/em&gt; — esta tabla de enrutamiento solo tendrá una ruta local:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;development-vpc-tgw-connectivity-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Desarrollo&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configura la &lt;em&gt;Tabla de Enrutamiento de Subred Privada&lt;/em&gt; — añade una ruta &lt;code&gt;0.0.0.0/0&lt;/code&gt; al attachment del Transit Gateway:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;development-vpc-private-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destino&lt;/th&gt;
&lt;th&gt;Objetivo&lt;/th&gt;
&lt;th&gt;Descripción&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Desarrollo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transit Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Opcional:&lt;/em&gt; Crea un VPC Flow Log para la VPC para monitorear y registrar el tráfico que fluye a través de la &lt;em&gt;VPC de Carga de Trabajo&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkag7m4gjb13v9ok9dar0.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.amazonaws.com%2Fuploads%2Farticles%2Fkag7m4gjb13v9ok9dar0.png" alt="VPC de Carga de Trabajo" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Este es el diagrama correspondiente a la &lt;em&gt;VPC de Desarrollo&lt;/em&gt;, pero, como mencioné anteriormente, cuento con cuatro cuentas destinadas a cargas de trabajo. Por ello, repetí este mismo paso para la &lt;em&gt;VPC de QA&lt;/em&gt; (CIDR &lt;code&gt;10.22.0.0/16&lt;/code&gt;), la &lt;em&gt;VPC de Producción&lt;/em&gt; (CIDR &lt;code&gt;10.23.0.0/16&lt;/code&gt;) y la &lt;em&gt;VPC de DevOps&lt;/em&gt; (CIDR &lt;code&gt;10.24.0.0/16&lt;/code&gt;).&lt;/p&gt;




&lt;h3&gt;
  
  
  Configura AWS Network Firewall
&lt;/h3&gt;

&lt;p&gt;Este artículo se enfoca principalmente en configurar la &lt;em&gt;Arquitectura base de red&lt;/em&gt; y el enrutamiento necesario para usar &lt;em&gt;Network Firewall&lt;/em&gt;. Pero a un alto nivel, AWS Network Firewall es un servicio gestionado que te permite proteger tu red filtrando el tráfico hacia y desde tus VPCs. Proporciona un firewall stateful y un sistema de detección y prevención de intrusiones que puede ser desplegado en línea con tu tráfico de red, inspeccionando y filtrando paquetes en tiempo real.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;En el Firewall, habilita el registro de &lt;em&gt;Alerta&lt;/em&gt; y &lt;em&gt;Flujo&lt;/em&gt;, y configura CloudWatch como el destino de los logs creando los grupos de logs necesarios.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Opcional:&lt;/em&gt; Edita la &lt;em&gt;Política de Firewall&lt;/em&gt; previamente creada para:

&lt;ul&gt;
&lt;li&gt;Añadir grupos de reglas gestionados por AWS&lt;/li&gt;
&lt;li&gt;Crear y añadir grupos de reglas stateless&lt;/li&gt;
&lt;li&gt;Crear y añadir grupos de reglas stateful&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Revisa la Arquitectura Final
&lt;/h2&gt;

&lt;p&gt;La arquitectura desplegada sigue un &lt;em&gt;modelo de inspección centralizada&lt;/em&gt; usando AWS Transit Gateway y AWS Network Firewall para controlar y monitorear el tráfico entre VPCs compartidas y de carga de trabajo.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;La &lt;em&gt;Tabla de Enrutamiento de Asociación Predeterminada del Transit Gateway&lt;/em&gt; debería verse así:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Tipo de Recurso&lt;/th&gt;
&lt;th&gt;Tipo de Ruta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;AWS Network Firewall&lt;/td&gt;
&lt;td&gt;Firewall&lt;/td&gt;
&lt;td&gt;Estático&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;La &lt;em&gt;Tabla de Enrutamiento de Propagación Predeterminada del Transit Gateway&lt;/em&gt; debería verse así:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Tipo de Recurso&lt;/th&gt;
&lt;th&gt;Tipo de Ruta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Desarrollo&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de QA&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Producción&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de DevOps&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Ingreso&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;VPC de Egreso&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Estático&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Si las tablas de enrutamiento no aparecen como se esperaba, desasocia y remueve cualquier asociación o propagación incorrecta, luego reasocia y repropaga los attachments con las tablas de enrutamiento apropiadas hasta que las tablas reflejen la configuración correcta.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;El siguiente diagrama de arquitectura ilustra la configuración multicuenta final, donde el tráfico de las cuentas &lt;em&gt;spoke&lt;/em&gt; (&lt;em&gt;Desarrollo&lt;/em&gt;, &lt;em&gt;QA&lt;/em&gt;, &lt;em&gt;Producción&lt;/em&gt; y &lt;em&gt;DevOps&lt;/em&gt;) es enrutado a través de la capa de inspección centralizada en la cuenta &lt;em&gt;Networking&lt;/em&gt;.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fpgn2v4y2ij9wg98i9fnj.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.amazonaws.com%2Fuploads%2Farticles%2Fpgn2v4y2ij9wg98i9fnj.jpeg" alt="Arquitectura Desplegada" width="800" height="1017"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;¿El diagrama no se ve con buena resolución? No te preocupes, puedes &lt;a href="https://drive.google.com/uc?export=download&amp;amp;id=1yJeT_0a7F1-F7qukGJvHz48F8bpol8mE" rel="noopener noreferrer"&gt;descargar el diagrama de arquitectura en formato PDF&lt;/a&gt; para verlo en mayor detalle. 🔍&lt;/p&gt;




&lt;h3&gt;
  
  
  Valida Conectividad e Inspección de Tráfico
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Opcionalmente&lt;/em&gt;, despliega instancias EC2 en las &lt;em&gt;VPCs de Carga de Trabajo&lt;/em&gt; en subredes privadas de carga de trabajo a través de diferentes cuentas.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conecta usando &lt;em&gt;Session Manager&lt;/em&gt; e intenta hacer ping entre las IPs privadas de las instancias.&lt;/li&gt;
&lt;li&gt;Asegúrate de que los grupos de seguridad permitan &lt;code&gt;ICMP&lt;/code&gt; entrante y &lt;code&gt;HTTPS&lt;/code&gt; saliente (&lt;code&gt;443&lt;/code&gt;) a Internet (para Session Manager).&lt;/li&gt;
&lt;li&gt;Los pings deberían ser exitosos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Opcionalmente&lt;/em&gt;, despliega una VPN de cliente como &lt;em&gt;OpenVPN&lt;/em&gt; o &lt;em&gt;WireGuard&lt;/em&gt; en una instancia EC2 en una subred pública en la &lt;em&gt;VPC de Ingreso&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conecta a través de la VPN e intenta hacer ping a las IPs privadas de las instancias EC2 en las &lt;em&gt;VPCs de Carga de Trabajo&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Asegúrate de que los grupos de seguridad permitan &lt;code&gt;ICMP&lt;/code&gt; entrante.&lt;/li&gt;
&lt;li&gt;Los pings deberían ser exitosos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Revisa los &lt;em&gt;Grupos de Logs de CloudWatch&lt;/em&gt; para verificar los logs de Firewall de tipo &lt;em&gt;Flujo&lt;/em&gt;. Deberías ver que todo el tráfico de prueba está pasando exitosamente a través del Network Firewall.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;El Grupo de Logs de tipo &lt;em&gt;Alerta&lt;/em&gt; debería estar vacío por ahora, ya que la Política de Firewall no ha sido configurada aún o el tráfico de prueba no coincide con ninguna regla de alerta.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Bonus: Attachment de Transit Gateway de Network Firewall
&lt;/h2&gt;

&lt;p&gt;Durante re:Inforce 2025, AWS anunció la nueva característica de &lt;em&gt;Attachment de Transit Gateway de Network Firewall&lt;/em&gt;, que reemplaza el patrón tradicional de “VPC de Inspección”, simplificando la implementación y mejorando la visibilidad del tráfico.&lt;/p&gt;

&lt;p&gt;En lugar del paso &lt;strong&gt;"4. Crear VPC de Inspección"&lt;/strong&gt;, harías &lt;strong&gt;"4. Crear Attachment de Transit Gateway de Network Firewall"&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;En la consola de AWS Network Firewall:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Selecciona &lt;strong&gt;Crear firewall&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Describir firewall&lt;/em&gt;: Añade un nombre y descripción para el firewall (opcional).&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Tipo de Attachment&lt;/em&gt;: Elige &lt;strong&gt;Transit Gateway&lt;/strong&gt; y selecciona el Transit Gateway.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Zonas de Disponibilidad&lt;/em&gt;: Selecciona las 3 Zonas de Disponibilidad con las que has estado trabajando.&lt;/li&gt;
&lt;li&gt;En &lt;em&gt;Asociar Política de Firewall&lt;/em&gt;: Selecciona &lt;strong&gt;Crear y asociar una política de firewall vacía&lt;/strong&gt; y especifica un nuevo nombre para la política de firewall.&lt;/li&gt;
&lt;li&gt;Crea el Firewall; tardará unos minutos.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Edita manualmente las Tablas de Enrutamiento de Transit Gateway:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Remueve la propagación del attachment de Network Firewall TGW en la Tabla de Enrutamiento de Propagación Predeterminada del TGW.&lt;/li&gt;
&lt;li&gt;Remueve la asociación del attachment de Network Firewall TGW en la Tabla de Enrutamiento de Asociación Predeterminada del TGW.&lt;/li&gt;
&lt;li&gt;Asocia la Tabla de Enrutamiento de Propagación Predeterminada del TGW con el attachment de Network Firewall TGW.&lt;/li&gt;
&lt;li&gt;En la Tabla de Enrutamiento de Asociación Predeterminada del TGW, crea una ruta estática a &lt;code&gt;0.0.0.0/0&lt;/code&gt; hacia el nuevo attachment de Network Firewall TGW.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;La Tabla de Enrutamiento de Asociación Predeterminada del Transit Gateway se verá así:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Tipo de Recurso&lt;/th&gt;
&lt;th&gt;Tipo de Ruta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;AWS Network Firewall&lt;/td&gt;
&lt;td&gt;Firewall&lt;/td&gt;
&lt;td&gt;Estático&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;La Tabla de Enrutamiento de Propagación Predeterminada del Transit Gateway permanecerá sin cambios en este escenario.&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fg1qy9iibfgz1htncfcxk.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.amazonaws.com%2Fuploads%2Farticles%2Fg1qy9iibfgz1htncfcxk.png" alt="Attachment de Transit Gateway de Network Firewall" width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Estructura de costos
&lt;/h2&gt;

&lt;p&gt;Los costos que deben considerarse en esta implementación son los siguientes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Transit Gateway (TGW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo por hora por &lt;em&gt;attachment&lt;/em&gt; de VPC: ~ USD 0,05 por hora por cada attachment.&lt;/li&gt;
&lt;li&gt;Costo por procesamiento de datos: ~ USD 0,02 por GB procesado.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS Network Firewall (NFW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo por hora por endpoint (activo): ~ USD 0,395 por hora en EE. UU.&lt;/li&gt;
&lt;li&gt;Costo por procesamiento de datos: ~ USD 0,065 por GB de tráfico inspeccionado.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateway (NATGW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Costo por hora: ~ USD 0,045 por NAT Gateway&lt;/li&gt;
&lt;li&gt;Costo por GB procesado: ~ USD 0,045 por GB de datos que pasa por el NAT Gateway&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Transferencia de datos (Data Transfer / egress / inter-AZ / inter-región, etc.)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Salida hacia Internet: tasas estándar de egress (~ USD 0,09/GB para los primeros volúmenes etc.)&lt;/li&gt;
&lt;li&gt;Transferencia cruzada de zona de disponibilidad (cross-AZ): ~ USD 0,01/GB&lt;/li&gt;
&lt;li&gt;Otras tarifas de transferencia aplican según origen-destino.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Cabe mencionar que los precios indicados corresponden a octubre de 2025.💲&lt;/p&gt;

&lt;h3&gt;
  
  
  Estimación de costos mensual
&lt;/h3&gt;

&lt;p&gt;Tomando como referencia mi implementación y considerando un tráfico mínimo, la estructura de costos incluiría los siguientes componentes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;7 Transit Gateway attachments&lt;/li&gt;
&lt;li&gt;3 NAT Gateways para alta disponibilidad&lt;/li&gt;
&lt;li&gt;3 endpoints de Network Firewall para alta disponibilidad&lt;/li&gt;
&lt;li&gt;Tráfico de inspección y salida modesta, digamos 500 GB/mes (como punto de partida)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cálculos:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transit Gateway — attachments&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;7 attachments × USD 0,05/hora = USD 0,35/hora&lt;/li&gt;
&lt;li&gt;Horas mes (~ 24 × 30 = 720 h) → 0,35 × 720 = USD 252/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Transit Gateway — procesamiento de datos&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Supongamos que de esos 500 GB, todo pasa por TGW: 500 × 0,02 = USD 10/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Network Firewall — endpoints&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;3 endpoints × USD 0,395/hora = USD 1,185/hora&lt;/li&gt;
&lt;li&gt;1,185 × 720 horas = USD 853,20/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Network Firewall — procesamiento de datos&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;500 GB × USD 0,065 = USD 32,50/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateways — horas&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;3 NATGWs × USD 0,045/hora = USD 0,135/hora&lt;/li&gt;
&lt;li&gt;0,135 × 720 = USD 97,20/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateways — procesamiento de datos&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Si asumimos que de esos 500 GB, por ejemplo, 200 GB salen hacia Internet&lt;/li&gt;
&lt;li&gt;200 GB × USD 0,045 = USD 9,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Transferencia de datos (egress etc.)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Si asumimos que de esos 500 GB, por ejemplo, 200 GB salen hacia Internet&lt;/li&gt;
&lt;li&gt;200 × USD 0,09 = USD 18,00/mes&lt;/li&gt;
&lt;li&gt;Además, supón 100 GB cross-AZ → 100 × USD 0,01 = USD 1,00/mes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Total estimado:
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Componente&lt;/th&gt;
&lt;th&gt;Costo estimado mensual (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TGW — attachments&lt;/td&gt;
&lt;td&gt;252,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TGW — procesamiento datos&lt;/td&gt;
&lt;td&gt;10,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NFW — endpoints&lt;/td&gt;
&lt;td&gt;853,20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NFW — procesamiento datos&lt;/td&gt;
&lt;td&gt;32,50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT — horas&lt;/td&gt;
&lt;td&gt;97,20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT — procesamiento de datos&lt;/td&gt;
&lt;td&gt;9,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transferencia de datos (egress + cross-AZ)&lt;/td&gt;
&lt;td&gt;19,00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total estimado&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~ USD 1,272,90&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Lecciones Aprendidas
&lt;/h2&gt;

&lt;p&gt;Probablemente acabas de ver el estimado de costos y te hayas asustado un poco, ¿cierto? Tranquilo, esto también se debe al costo de la alta disponibilidad. En mi ejemplo utilicé 3 AZs, pero quizá tu caso de uso no requiera tanta disponibilidad para AWS Network Firewall y podrías desplegarlo en solo 1 o 2 AZs, ya que, de todos modos, la caída de una AZ es bastante improbable. 😎&lt;/p&gt;

&lt;p&gt;Si decides reducir la cantidad de AZs, debes tener en cuenta dos consideraciones importantes. La primera es el &lt;em&gt;Appliance Mode&lt;/em&gt;, mencionado anteriormente, que resulta especialmente relevante para evitar tráfico asimétrico si los recursos no estuvieran distribuidos uniformemente en todas las AZs. Además, debes comprender claramente los conceptos de &lt;em&gt;Fail Open&lt;/em&gt; y &lt;em&gt;Fail Closed&lt;/em&gt;, que básicamente definen la acción predeterminada si se cayeran todas las AZs donde está desplegado Network Firewall (lo cual es improbable, pero podría ocurrir si decides usar una sola AZ). &lt;em&gt;Fail Open&lt;/em&gt; indica que, si Network Firewall falla, todo el tráfico no inspeccionado pasará libremente; mientras que &lt;em&gt;Fail Closed&lt;/em&gt; indica que, si falla, ningún tráfico podrá pasar. Es importante evaluar el &lt;em&gt;trade-off&lt;/em&gt; entre seguridad y disponibilidad ante estos escenarios y tomar la decisión adecuada.&lt;/p&gt;

&lt;p&gt;Por otro lado, otra forma de controlar los costos de Network Firewall es activar únicamente las reglas necesarias. Puede parecer tentador añadir todos los &lt;em&gt;AWS Managed Rule Groups&lt;/em&gt;, pero recuerda que cada uno tiene un costo, consume unidades de capacidad y quizá no todas apliquen realmente a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Recuerda que la parte más importante al implementar AWS Network Firewall, además de bloquear tráfico, es que te proporcione información y &lt;em&gt;insights&lt;/em&gt; accionables. Es decir, los hallazgos, métricas y logs no deben quedarse como información sin uso. Integra Network Firewall con AWS Security Hub para obtener &lt;em&gt;insights&lt;/em&gt; de alto valor y poder realizar remediaciones, o incluso automatizarlas mediante un enfoque basado en eventos con Amazon EventBridge, AWS Lambda u otros servicios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;En conclusión, implementar AWS Network Firewall en una arquitectura multicuenta con Transit Gateway proporciona una infraestructura de red robusta, escalable y segura. Siguiendo los pasos descritos en este artículo, puedes implementar y configurar efectivamente Network Firewall para proteger tus VPCs a través de diferentes cuentas dentro de una estructura de AWS Organizations. El patrón Hub &amp;amp; Spoke, combinado con la alta disponibilidad de 3 Zonas de Disponibilidad, asegura que tu red sea resiliente y capaz de manejar varios patrones de tráfico y requisitos de seguridad. Además, el uso de VPC Flow Logs y el registro de Network Firewall permite un monitoreo y análisis detallado del tráfico de red, permitiéndote identificar y responder a posibles amenazas de seguridad con prontitud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué sigue
&lt;/h2&gt;

&lt;p&gt;En la siguiente sección encontrarás los recursos y documentos oficiales de los servicios mencionados, junto con algunos puntos interesantes relacionados con los temas tratados, por si deseas seguir aprendiendo o profundizar para evaluar si realmente aplican a tu caso de uso.&lt;/p&gt;

&lt;p&gt;Te invito también a realizar esta implementación en tu propia cuenta de AWS. Recuerda que, si no dispones de múltiples cuentas, puedes desplegar todas las VPC en una sola y experimentar igualmente con AWS Network Firewall. Cuéntame en los comentarios qué te pareció esta guía o si descubriste algo interesante durante tu implementación. ✍🏻&lt;/p&gt;

&lt;p&gt;Si bien no lo había mencionado antes, implementé toda esta arquitectura multicuenta utilizando &lt;em&gt;Terraform&lt;/em&gt;. Sin embargo, el código de infraestructura como código está actualmente muy adaptado a las necesidades específicas del cliente para el cual fue desplegado. Más adelante estaré modularizando y generalizando este código para distintos escenarios, con el objetivo de poder compartirlo con la comunidad.&lt;/p&gt;

&lt;p&gt;Antes de irme, quiero destacar el gran potencial de esta arquitectura centralizada basada en AWS Transit Gateway. A partir de este diseño, podríamos ampliarlo añadiendo una conexión VPN hacia un data center corporativo on-premises; en las &lt;em&gt;VPC de carga de trabajo&lt;/em&gt;, desplegar una aplicación en una instancia EC2 expuesta internamente mediante un Network Load Balancer (NLB); y en la &lt;em&gt;VPC de Ingreso&lt;/em&gt;, colocar un Application Load Balancer (ALB) público que apunte a las direcciones IP privadas del NLB, permitiendo que los clientes accedan al servicio a través del DNS público del ALB. El siguiente diagrama ilustra, de manera sencilla y resumida, esta posible extensión del diseño.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F1k6dc4hwgvd7z0hrlmth.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.amazonaws.com%2Fuploads%2Farticles%2F1k6dc4hwgvd7z0hrlmth.png" alt="Extensión del diseño de Transit Gateway" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos oficiales
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/vpc/pricing/" rel="noopener noreferrer"&gt;Precios de Amazon VPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/tgw/what-is-transit-gateway.html" rel="noopener noreferrer"&gt;¿Qué es AWS Transit Gateway?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/tgw/tgw-best-design-practices.html" rel="noopener noreferrer"&gt;Mejores prácticas de diseño de AWS Transit Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/transit-gateway/pricing/" rel="noopener noreferrer"&gt;Precios de AWS Transit Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/network-firewall/latest/developerguide/what-is-aws-network-firewall.html" rel="noopener noreferrer"&gt;¿Qué es AWS Network Firewall?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/blogs/networking-and-content-delivery/deployment-models-for-aws-network-firewall/" rel="noopener noreferrer"&gt;Modelos de implementación para AWS Network Firewall&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/network-firewall/pricing/" rel="noopener noreferrer"&gt;Precios de AWS Network Firewall&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>aws</category>
      <category>networking</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>How to Implement AWS Network Firewall in a Multi-Account Architecture Using Transit Gateway</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Mon, 13 Oct 2025 23:15:46 +0000</pubDate>
      <link>https://dev.to/cbecerra/how-to-implement-aws-network-firewall-in-a-multi-account-architecture-using-transit-gateway-2nam</link>
      <guid>https://dev.to/cbecerra/how-to-implement-aws-network-firewall-in-a-multi-account-architecture-using-transit-gateway-2nam</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; This article will guide you through the implementation of AWS Network Firewall in a multi-account, highly available architecture (spanning 3 Availability Zones) in conjunction with a Transit Gateway to connect VPCs across different accounts within an AWS Organizations structure. The architecture follows a Hub &amp;amp; Spoke pattern, where the Hub Account is the Networking account, and the Spoke accounts include Development, QA, Production, and DevOps. 🛡️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Estimated reading time:&lt;/strong&gt; 20 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level:&lt;/strong&gt; 300&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spanish version:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/como-implementar-aws-network-firewall-en-una-arquitectura-multicuenta-utilizando-transit-gateway-g1c"&gt;Cómo implementar AWS Network Firewall en una arquitectura multicuenta utilizando Transit Gateway&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Table of Contents:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why Implement AWS Network Firewall&lt;/li&gt;
&lt;li&gt;What You're Going to Build&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;
Implementation Steps

&lt;ul&gt;
&lt;li&gt;Set Up the Transit Gateway&lt;/li&gt;
&lt;li&gt;Build the Ingress VPC&lt;/li&gt;
&lt;li&gt;Build the Inspection VPC&lt;/li&gt;
&lt;li&gt;Build the Egress VPC&lt;/li&gt;
&lt;li&gt;Build the Workload VPCs&lt;/li&gt;
&lt;li&gt;Configure the AWS Network Firewall&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Review the Final Architecture

&lt;ul&gt;
&lt;li&gt;Validate Connectivity and Traffic Inspection&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Bonus: Network Firewall Transit Gateway Attachment&lt;/li&gt;

&lt;li&gt;

Cost Structure

&lt;ul&gt;
&lt;li&gt;Monthly Cost Estimate&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lessons Learned&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;What's Next&lt;/li&gt;

&lt;li&gt;Official Resources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When I had to implement &lt;strong&gt;AWS Network Firewall&lt;/strong&gt; for the first time at work, I’ll be honest — I was a bit nervous. I thought it would be more complex. However, the implementation turned out to be relatively straightforward if you’re comfortable with networking and routing.&lt;/p&gt;

&lt;p&gt;Even so, my initial network configurations for deploying Network Firewall were neither the best nor the most organized, but eventually, I got there — a proper and well-structured implementation of AWS Network Firewall, aligned with AWS’s recommended best practices. 🥳&lt;/p&gt;

&lt;p&gt;And honestly, I’d like others to avoid making the same mistakes when setting up AWS Network Firewall for the first time — especially when it comes to routing, which was the most challenging part for me — and to lose the fear of the service and networking in general. That’s why I’m writing this article: to share how to properly configure the network and routing, or at least, how I did it myself.&lt;/p&gt;

&lt;p&gt;To give a bit of context, in a multi-account environment, AWS Network Firewall plays an important role by providing centralized network protection, enabling consistent security controls and traffic inspection across all accounts.&lt;/p&gt;

&lt;p&gt;This implementation follows a model of &lt;em&gt;centralized ingress&lt;/em&gt;, &lt;em&gt;centralized egress&lt;/em&gt;, and &lt;em&gt;centralized inspection&lt;/em&gt;, ensuring that inbound, outbound, and inter-VPC traffic is securely routed through a single inspection layer managed by the &lt;em&gt;Networking&lt;/em&gt; account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Implement AWS Network Firewall
&lt;/h2&gt;

&lt;p&gt;You probably already know about several types of firewalls in AWS, such as &lt;em&gt;Security Groups (SGs)&lt;/em&gt;, &lt;em&gt;Network Access Control Lists (NACLs)&lt;/em&gt;, and the &lt;em&gt;Web Application Firewall (WAF)&lt;/em&gt; — and you might be wondering: why do I need yet another firewall service?&lt;/p&gt;

&lt;p&gt;Well, AWS Network Firewall is a more robust service designed to solve a different use case. Let’s start by clarifying that AWS WAF can only be deployed on specific AWS services like &lt;em&gt;ALB&lt;/em&gt;, &lt;em&gt;API Gateway&lt;/em&gt;, and &lt;em&gt;CloudFront&lt;/em&gt;, but not openly on any Elastic Network Interface (ENI).&lt;/p&gt;

&lt;p&gt;On the other hand, Security Groups and Network ACLs exist independently within each VPC, each with its own decentralized security rules, which can become increasingly difficult to manage over time.&lt;/p&gt;

&lt;p&gt;Imagine you have multiple VPCs, or even several AWS accounts, and you need to apply the same stateless and stateful firewall rules across all of them. It wouldn’t make much sense to repeatedly deploy the same SGs, NACLs, and WAFs in every VPC or account, right? And even if you did, maintaining and managing those configurations would quickly become chaotic. 😵&lt;/p&gt;

&lt;p&gt;Moreover, both SGs and NACLs have a relatively small limit on the number of rules they support, and as mentioned earlier, WAF only works with specific services. So, how do we solve this?&lt;/p&gt;

&lt;p&gt;That’s where &lt;strong&gt;AWS Network Firewall&lt;/strong&gt; comes in. This service allows you to deploy a firewall in the form of a virtual service, with its own &lt;em&gt;ENIs&lt;/em&gt;, where you can route all inbound and outbound traffic to be inspected before reaching its final destination. This gives you all the benefits of stateless and stateful firewalls, from Layer 3 to Layer 7. 🤩&lt;/p&gt;

&lt;p&gt;And while, as an alternative, you could deploy your own security appliance —or a third-party one— behind a Gateway Load Balancer for inspection, the difference is that, in that case, you would be fully responsible for managing it, whereas AWS Network Firewall is a fully managed AWS service that offers many valuable features.&lt;/p&gt;

&lt;p&gt;In summary, Security Groups and NACLs may be sufficient at a small scale, with just a few VPCs, but as your environment grows and you start managing multiple VPCs and AWS accounts, you’ll want —or even need— to centralize your network inspection. And that’s exactly why you should learn how to implement AWS Network Firewall.&lt;/p&gt;

&lt;p&gt;Here’s a comparison table between the different types of firewalls in AWS, to help you better understand the differences among them.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Security Group&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Network ACL&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;WAF&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;AWS Network Firewall&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Protection at&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;EC2 instance level&lt;/td&gt;
&lt;td&gt;Subnet level&lt;/td&gt;
&lt;td&gt;Endpoint level (ALB, CloudFront, etc.)&lt;/td&gt;
&lt;td&gt;VPC level based on routes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Stateful or Stateless&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stateful&lt;/td&gt;
&lt;td&gt;Stateless&lt;/td&gt;
&lt;td&gt;Stateless&lt;/td&gt;
&lt;td&gt;Both&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OSI layer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Layer 3/4&lt;/td&gt;
&lt;td&gt;Layer 3/4&lt;/td&gt;
&lt;td&gt;Layer 7&lt;/td&gt;
&lt;td&gt;Layer 3–7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;IP, Port, Protocol filtering&lt;/td&gt;
&lt;td&gt;IP, Port, Protocol filtering&lt;/td&gt;
&lt;td&gt;Application layer filtering&lt;/td&gt;
&lt;td&gt;Stateless/ACL L3 rules, stateful/L4 rules, IPS–IDS/L7 rules, FQDN filtering, Protocol detection, Large IP lists&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flows&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;All ingress/egress flows at instance level&lt;/td&gt;
&lt;td&gt;All ingress/egress flows at subnet level&lt;/td&gt;
&lt;td&gt;Ingress only from internet to API Gateway, ALB, CloudFront&lt;/td&gt;
&lt;td&gt;All ingress/egress flows at perimeter of VPC (e.g., IGW, VGW, DX, VPN, VPC–VPC)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What You’re Going to Build
&lt;/h2&gt;

&lt;p&gt;As I mentioned earlier, the implementation is not particularly complex, but it does require a solid foundation in networking and routing. When this guide says “Create a Transit Gateway,” it assumes you already know how to do that. And while this guide does not include ready-to-deploy Infrastructure as Code, it does provide a detailed step-by-step list appropriate for this level. Most importantly, it covers the routing configuration — which, in my experience, is the most challenging part. 😉&lt;/p&gt;

&lt;p&gt;This implementation consists of five components you’ll be building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Transit Gateway&lt;/strong&gt; shared through AWS RAM and connected to all VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ingress VPC&lt;/strong&gt; with an Internet Gateway for centralized inbound connectivity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inspection VPC&lt;/strong&gt; with AWS Network Firewall deployed in high availability, using the VPC or TGW attachment type for centralized inspection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egress VPC&lt;/strong&gt; with NAT Gateways in high availability for centralized outbound connectivity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workload VPCs&lt;/strong&gt; for &lt;em&gt;Development&lt;/em&gt;, &lt;em&gt;QA&lt;/em&gt;, &lt;em&gt;Production&lt;/em&gt;, and &lt;em&gt;DevOps&lt;/em&gt; environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don’t worry if you can’t fully visualize the solution yet. In the implementation steps section, you’ll find architecture diagrams for each of these five components, as well as the final diagram of the complete solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;For this implementation, it’s recommended to have multiple AWS accounts and the appropriate permissions in each of them.&lt;/p&gt;

&lt;p&gt;If you don’t yet have multiple accounts, you can create them using AWS Organizations and access them through IAM Identity Center instead of individual IAM users, if you prefer.&lt;/p&gt;

&lt;p&gt;If you don’t have access to multiple AWS accounts, you can deploy all the VPCs within a single account; in that case, you should simply skip the step of sharing the Transit Gateway through AWS RAM.&lt;/p&gt;

&lt;p&gt;You’ll need permissions for &lt;em&gt;Amazon VPC&lt;/em&gt;, &lt;em&gt;AWS Transit Gateway&lt;/em&gt;, &lt;em&gt;AWS RAM&lt;/em&gt;, &lt;em&gt;AWS Network Firewall&lt;/em&gt;, and optionally &lt;em&gt;CloudWatch Logs&lt;/em&gt;, &lt;em&gt;EC2&lt;/em&gt;, and &lt;em&gt;Session Manager&lt;/em&gt;, among others, to perform the actions described in this guide.&lt;/p&gt;

&lt;p&gt;I’ll be deploying in the &lt;em&gt;N. Virginia (us-east-1)&lt;/em&gt; region, and the following diagram shows what my multi-account structure looks like at the beginning: one account dedicated to network resources (&lt;em&gt;Hub&lt;/em&gt;) and four accounts for workloads (&lt;em&gt;Spoke&lt;/em&gt;).&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fswzfp9hj7mhkvdtj2ayz.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.amazonaws.com%2Fuploads%2Farticles%2Fswzfp9hj7mhkvdtj2ayz.png" alt="AWS Organization Accounts" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Implementation Steps
&lt;/h2&gt;

&lt;p&gt;The following sections provide a step-by-step walkthrough of the network setup process, showing how each component, including the Transit Gateway, shared VPCs, workload VPCs, and AWS Network Firewall, integrates to create a secure and scalable foundation for inter-account connectivity and inspection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Up the Transit Gateway
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a Transit Gateway with default settings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create two transit gateway route tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modify the Transit Gateway and assign:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tgw-default-association-rtb&lt;/code&gt; as the Default Association Route Table&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt; as the Default Propagation Route Table&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In AWS RAM, create a Resource Share with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The newly created Transit Gateway as the &lt;em&gt;Shared resource&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;The Spoke accounts as the &lt;em&gt;Shared principals&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;(Optional)&lt;/em&gt; Create a TGW Flow Log for the Transit Gateway to monitor and log the traffic flowing through it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fx3vm7i1yqtx8cso8l0ge.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.amazonaws.com%2Fuploads%2Farticles%2Fx3vm7i1yqtx8cso8l0ge.png" alt="Transit Gateway" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes for Subnet Creation and Availability Zone Selection:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Connectivity Subnet Creation:&lt;/strong&gt; When creating a VPC that will have connectivity with the Transit Gateway (TGW), it is recommended to create a &lt;code&gt;/28&lt;/code&gt; subnet exclusively to host the Elastic Network Interfaces (ENIs) deployed by TGW. This follows best practices for efficient resource management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AZ Selection:&lt;/strong&gt; Choose the same Availability Zone (AZ) ID, rather than the AZ name, to avoid charges for inter-zone traffic. For example, in this case, we are using &lt;code&gt;use1-az1&lt;/code&gt;, &lt;code&gt;use1-az2&lt;/code&gt;, &lt;code&gt;use1-az4&lt;/code&gt;. It's important to note that &lt;code&gt;us-east-1a&lt;/code&gt; and &lt;code&gt;us-east-1b&lt;/code&gt; are unique aliases for each AWS account. To ensure that you deploy your resources in the same AZ, use AZ IDs instead of aliases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Firewall Support:&lt;/strong&gt; AWS Network Firewall is not supported in &lt;code&gt;us1-az3&lt;/code&gt;, which is why we chose to use &lt;code&gt;use1-az4&lt;/code&gt; instead. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AZ Identification:&lt;/strong&gt; It is recommended to add the AZ ID in the name tag of the subnet and associated route table, and any associated network appliances for easy identification and management. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Build the Ingress VPC
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a VPC (e.g., named &lt;em&gt;ingress VPC&lt;/em&gt;, CIDR &lt;code&gt;10.20.0.0/20&lt;/code&gt;) with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 public subnets (e.g., &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 private subnets for TGW connectivity (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;1 Internet Gateway&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Transit Gateway attachment between the Transit Gateway and the &lt;em&gt;Ingress VPC&lt;/em&gt;, selecting the Subnet IDs of the 3 TGW connectivity subnets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;TGW Connectivity Subnet Route Table&lt;/em&gt; (this route table will only have a local route):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ingress-vpc-tgw-connectivity-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ingress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;Public Subnet Route Table&lt;/em&gt; (this route table needs a &lt;code&gt;0.0.0.0/0&lt;/code&gt; route to the Internet Gateway and routes to the CIDRs of the Spoke VPCs to go through the TGW attachment):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;ingress-vpc-public-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ingress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Development VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;QA VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;DevOps VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;igw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Internet access&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Optional:&lt;/em&gt; Create a VPC Flow Log for the VPC to monitor and log the traffic flowing through the &lt;em&gt;Ingress VPC&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fuvkudyw8g39peetzs8cg.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.amazonaws.com%2Fuploads%2Farticles%2Fuvkudyw8g39peetzs8cg.png" alt="Ingress VPC" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Build the Inspection VPC
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a VPC (e.g., named &lt;em&gt;inspection VPC&lt;/em&gt;, CIDR &lt;code&gt;10.20.16.0/20&lt;/code&gt;) with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 private subnets for Network Firewall (e.g., &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 private subnets for TGW connectivity (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a Transit Gateway attachment between the Transit Gateway and the &lt;em&gt;Inspection VPC&lt;/em&gt;, selecting the Subnet IDs of the 3 TGW connectivity subnets. Enable &lt;em&gt;Appliance Mode Support&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Enabling Appliance Mode on the Transit Gateway attachment ensures that all traffic from a session flows through the same firewall in the same Availability Zone, preventing inter-AZ traffic from being inspected by the firewall. This setting is important to maintain consistent traffic inspection and improve performance in multi-AZ architectures.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Manually edit the Transit Gateway Route Tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove the propagation of the &lt;em&gt;Inspection VPC&lt;/em&gt; attachment in the TGW Default Propagation Route Table.&lt;/li&gt;
&lt;li&gt;Remove the association of the &lt;em&gt;Inspection VPC&lt;/em&gt; attachment in the TGW Default Association Route Table.&lt;/li&gt;
&lt;li&gt;Associate the &lt;em&gt;TGW Default Propagation Route Table&lt;/em&gt; with the &lt;em&gt;Inspection VPC Attachment&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;em&gt;TGW Default Association Route Table&lt;/em&gt;, create a static route to &lt;code&gt;0.0.0.0/0&lt;/code&gt; towards the &lt;em&gt;Inspection VPC Attachment&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the AWS Network Firewall console:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose &lt;strong&gt;Create firewall&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Describe firewall:&lt;/em&gt; Add a name and (optionally) a description.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Attachment Type:&lt;/em&gt; Choose &lt;strong&gt;VPC&lt;/strong&gt; and select the &lt;em&gt;Inspection VPC&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Firewall subnets:&lt;/em&gt; Select the 3 private subnets (not the connectivity subnets).&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Associate Firewall Policy:&lt;/em&gt; Choose &lt;strong&gt;Create and associate an empty firewall policy&lt;/strong&gt; and specify a new firewall policy name.&lt;/li&gt;
&lt;li&gt;Create the firewall; this will take a few minutes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;TGW Connectivity Subnet Route Tables&lt;/em&gt; (one per AZ). In each route table, add a route to its corresponding AWS Network Firewall VPC endpoint (of type &lt;em&gt;Gateway Load Balancer Endpoint&lt;/em&gt;) per AZ:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az1&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspection VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Firewall endpoint for use1-az1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az2&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspection VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Firewall endpoint for use1-az2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-tgw-connectivity-rtb-use1-az4&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspection VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nfw-use1-az4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Firewall endpoint for use1-az4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;Private Subnet Route Table&lt;/em&gt; (this route table needs a &lt;code&gt;0.0.0.0/0&lt;/code&gt; route to the Transit Gateway attachment):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;inspection-vpc-private-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.16.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspection VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transit Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Optional:&lt;/em&gt; Create a VPC Flow Log for the VPC to monitor and log the traffic flowing through the &lt;em&gt;Inspection VPC&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Ftj3e14gdqwo8s94iiqur.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.amazonaws.com%2Fuploads%2Farticles%2Ftj3e14gdqwo8s94iiqur.png" alt="Inspection VPC" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After having implemented the &lt;em&gt;Inspection VPC&lt;/em&gt; multiple times, AWS finally released a new feature for AWS Network Firewall: the &lt;strong&gt;Transit Gateway Firewall Attachment&lt;/strong&gt;. With this feature, the firewall connects directly to the Transit Gateway, removing the need for an Inspection VPC. Interested? Check out the &lt;em&gt;Bonus&lt;/em&gt; section below. 😀&lt;/p&gt;




&lt;h3&gt;
  
  
  Build the Egress VPC
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a VPC (e.g., named &lt;em&gt;egress VPC&lt;/em&gt;, CIDR &lt;code&gt;10.20.32.0/20&lt;/code&gt;) with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 public subnets (e.g., &lt;code&gt;/22&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 private subnets for TGW connectivity (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;1 Internet Gateway&lt;/li&gt;
&lt;li&gt;1 NAT Gateway per AZ for high availability&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Transit Gateway attachment between the Transit Gateway and the &lt;em&gt;Egress VPC&lt;/em&gt;, selecting the Subnet IDs of the 3 TGW connectivity subnets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Manually edit the Transit Gateway Route Tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;em&gt;TGW Default Propagation Route Table&lt;/em&gt;, create a static route to &lt;code&gt;0.0.0.0/0&lt;/code&gt; towards the &lt;em&gt;Egress VPC Attachment&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;TGW Connectivity Subnet Route Tables&lt;/em&gt; (create one route table per AZ, and in each table add a &lt;code&gt;0.0.0.0/0&lt;/code&gt; route to its corresponding NAT Gateway):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az1&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT for use1-az1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az2&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT for use1-az2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-tgw-connectivity-rtb-use1-az4&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;natgw-use1-az4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;NAT for use1-az4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;Public Subnet Route Table&lt;/em&gt; (this route table needs a &lt;code&gt;0.0.0.0/0&lt;/code&gt; route to the Internet Gateway and routes to the CIDRs of the Spoke VPCs to go through the TGW attachment):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;egress-vpc-public-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Development VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;QA VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;DevOps VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;igw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Internet access&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Optional:&lt;/em&gt; Create a VPC Flow Log for the VPC to monitor and log the traffic flowing through the &lt;em&gt;Egress VPC&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F467p6yeh7yq477ccbhdf.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.amazonaws.com%2Fuploads%2Farticles%2F467p6yeh7yq477ccbhdf.png" alt="Egress VPC" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Build the Workload VPCs
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a VPC (e.g., named &lt;em&gt;development VPC&lt;/em&gt;, CIDR &lt;code&gt;10.21.0.0/16&lt;/code&gt;) with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 private subnets for workloads (e.g., &lt;code&gt;/20&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 private subnets for TGW connectivity (&lt;code&gt;/28&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Transit Gateway attachment between the Transit Gateway and the VPC, selecting the Subnet IDs of the 3 TGW connectivity subnets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;TGW Connectivity Subnet Route Table&lt;/em&gt; — this route table will only have a local route:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;development-vpc-tgw-connectivity-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Development VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;em&gt;Private Subnet Route Table&lt;/em&gt; — add a &lt;code&gt;0.0.0.0/0&lt;/code&gt; route to the Transit Gateway attachment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;development-vpc-private-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Development VPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tgw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transit Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Optional:&lt;/em&gt; Create a VPC Flow Log for the VPC to monitor and log the traffic flowing through the &lt;em&gt;Workload VPC&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fkag7m4gjb13v9ok9dar0.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.amazonaws.com%2Fuploads%2Farticles%2Fkag7m4gjb13v9ok9dar0.png" alt="Workload VPC" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the diagram corresponding to the &lt;em&gt;Development VPC&lt;/em&gt;, but as I mentioned earlier, I have four accounts dedicated to workloads. Therefore, I repeated this same step for the &lt;em&gt;QA VPC&lt;/em&gt; (CIDR &lt;code&gt;10.22.0.0/16&lt;/code&gt;), the &lt;em&gt;Production VPC&lt;/em&gt; (CIDR &lt;code&gt;10.23.0.0/16&lt;/code&gt;), and the &lt;em&gt;DevOps VPC&lt;/em&gt; (CIDR &lt;code&gt;10.24.0.0/16&lt;/code&gt;).&lt;/p&gt;




&lt;h3&gt;
  
  
  Configure the AWS Network Firewall
&lt;/h3&gt;

&lt;p&gt;This article primarily focuses on configuring the &lt;em&gt;base network architecture&lt;/em&gt; and the routing required to use &lt;em&gt;Network Firewall&lt;/em&gt;. But at a high level, AWS Network Firewall is a managed service that allows you to protect your network by filtering traffic to and from your VPCs. It provides a stateful firewall and intrusion detection and prevention system that can be deployed inline with your network traffic, inspecting and filtering packets in real time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Firewall, enable &lt;em&gt;Alert&lt;/em&gt; and &lt;em&gt;Flow&lt;/em&gt; logging, and configure CloudWatch as the log destination by creating the necessary log groups.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Optional:&lt;/em&gt; Edit the previously created empty &lt;em&gt;Firewall Policy&lt;/em&gt; to:

&lt;ul&gt;
&lt;li&gt;Add AWS Managed rule groups&lt;/li&gt;
&lt;li&gt;Create and add Stateless rule groups&lt;/li&gt;
&lt;li&gt;Create and add Stateful rule groups&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Review the Final Architecture
&lt;/h2&gt;

&lt;p&gt;The deployed architecture follows a &lt;em&gt;centralized inspection model&lt;/em&gt; using AWS Transit Gateway and AWS Network Firewall to control and monitor traffic between shared and workload VPCs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The &lt;em&gt;Transit Gateway Default Association Route Table&lt;/em&gt; should look like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Resource Type&lt;/th&gt;
&lt;th&gt;Route Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inspection VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Static&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;em&gt;Transit Gateway Default Propagation Route Table&lt;/em&gt; should look like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-propagation-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Resource Type&lt;/th&gt;
&lt;th&gt;Route Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.21.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Development VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.22.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;QA VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.23.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Production VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.24.0.0/16&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;DevOps VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.0.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ingress VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;10.20.32.0/20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Propagated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Egress VPC&lt;/td&gt;
&lt;td&gt;VPC&lt;/td&gt;
&lt;td&gt;Static&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the route tables do not appear as expected, detach and remove any incorrect associations or propagations, then re-associate and re-propagate the attachments with the appropriate route tables until the tables reflect the correct configuration.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following architecture diagram illustrates the final multi-account setup, where traffic from the spoke accounts (&lt;em&gt;Development&lt;/em&gt;, &lt;em&gt;QA&lt;/em&gt;, &lt;em&gt;Production&lt;/em&gt;, and &lt;em&gt;DevOps&lt;/em&gt;) is routed through the centralized inspection layer in the &lt;em&gt;Networking&lt;/em&gt; account.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fpgn2v4y2ij9wg98i9fnj.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.amazonaws.com%2Fuploads%2Farticles%2Fpgn2v4y2ij9wg98i9fnj.jpeg" alt="Deployed Architecture" width="800" height="1017"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is the diagram not displaying in high resolution? No worries — you can &lt;a href="https://drive.google.com/uc?export=download&amp;amp;id=1yJeT_0a7F1-F7qukGJvHz48F8bpol8mE" rel="noopener noreferrer"&gt;download the architecture diagram in PDF format&lt;/a&gt; to view it in more detail. 🔍&lt;/p&gt;




&lt;h3&gt;
  
  
  Validate Connectivity and Traffic Inspection
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Optionally&lt;/em&gt;, deploy EC2 instances in the &lt;em&gt;Workload VPCs&lt;/em&gt; in private workload subnets across different accounts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect using &lt;em&gt;Session Manager&lt;/em&gt; and try to ping between the private IPs of the instances.&lt;/li&gt;
&lt;li&gt;Ensure the security groups allow inbound &lt;code&gt;ICMP&lt;/code&gt; and outbound &lt;code&gt;HTTPS&lt;/code&gt; (&lt;code&gt;443&lt;/code&gt;) to the internet (for Session Manager).&lt;/li&gt;
&lt;li&gt;The pings should be successful.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Optionally&lt;/em&gt;, deploy a client VPN such as &lt;em&gt;OpenVPN&lt;/em&gt; or &lt;em&gt;WireGuard&lt;/em&gt; on an EC2 instance in a public subnet in the &lt;em&gt;Ingress VPC&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect through the VPN and try to ping the private IPs of the EC2 instances in the &lt;em&gt;Workload VPCs&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Ensure the security groups allow inbound &lt;code&gt;ICMP&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The pings should be successful.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check the &lt;em&gt;CloudWatch Log Groups&lt;/em&gt; to verify the &lt;em&gt;Flow&lt;/em&gt; type Firewall logs. You should see that all test traffic is successfully passing through the Network Firewall.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;em&gt;Alert&lt;/em&gt; type Log Group should be empty for now, since the Firewall Policy has not been configured yet or the test traffic does not match any alert rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Bonus: Network Firewall Transit Gateway Attachment
&lt;/h2&gt;

&lt;p&gt;During re:Inforce 2025, AWS announced the new &lt;em&gt;Network Firewall Transit Gateway Attachment&lt;/em&gt; feature, which replaces the traditional “Inspection VPC” pattern, simplifying deployment and improving traffic visibility.&lt;/p&gt;

&lt;p&gt;Instead of step &lt;strong&gt;"4. Create Inspection VPC"&lt;/strong&gt;, you would do &lt;strong&gt;"4. Create Network Firewall Transit Gateway Attachment"&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the AWS Network Firewall console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Create firewall&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Describe firewall&lt;/em&gt;: Add a Firewall name and description (optional).&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Attachment Type&lt;/em&gt;: Choose &lt;strong&gt;Transit Gateway&lt;/strong&gt; and select the Transit Gateway.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Availability Zones&lt;/em&gt;: Select the 3 Availability Zones you have been working with.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Associate Firewall Policy&lt;/em&gt;: Select &lt;strong&gt;Create and associate an empty firewall policy&lt;/strong&gt; and specify a new firewall policy name.&lt;/li&gt;
&lt;li&gt;Create the Firewall; it will take a few minutes.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Manually edit the Transit Gateway Route Tables:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Remove the propagation of the Network Firewall TGW attachment in the TGW Default Propagation Route Table.&lt;/li&gt;
&lt;li&gt;Remove the association of the Network Firewall TGW attachment in the TGW Default Association Route Table.&lt;/li&gt;
&lt;li&gt;Associate the TGW Default Propagation Route Table with the Network Firewall TGW Attachment.&lt;/li&gt;
&lt;li&gt;In the TGW Default Association Route Table, create a static route to &lt;code&gt;0.0.0.0/0&lt;/code&gt; towards the new Network Firewall TGW Attachment.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;The Transit Gateway Default Association Route Table will look as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;tgw-default-association-rtb&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Attachment&lt;/th&gt;
&lt;th&gt;Resource Type&lt;/th&gt;
&lt;th&gt;Route Type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.0.0.0/0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;AWS Network Firewall&lt;/td&gt;
&lt;td&gt;Firewall&lt;/td&gt;
&lt;td&gt;Static&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The Transit Gateway Default Propagation Route Table will remain unchanged in this scenario.&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fg1qy9iibfgz1htncfcxk.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.amazonaws.com%2Fuploads%2Farticles%2Fg1qy9iibfgz1htncfcxk.png" alt="Network Firewall Transit Gateway Attachment" width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Cost Structure
&lt;/h2&gt;

&lt;p&gt;The costs to consider in this implementation are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS Transit Gateway (TGW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Hourly cost per VPC &lt;em&gt;attachment&lt;/em&gt;: ~ USD 0.05 per hour for each attachment.&lt;/li&gt;
&lt;li&gt;Data processing cost: ~ USD 0.02 per GB processed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;AWS Network Firewall (NFW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Hourly cost per endpoint (active): ~ USD 0.395 per hour in the U.S.&lt;/li&gt;
&lt;li&gt;Data processing cost: ~ USD 0.065 per GB of inspected traffic.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateway (NATGW)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Hourly cost: ~ USD 0.045 per NAT Gateway&lt;/li&gt;
&lt;li&gt;Data processing cost: ~ USD 0.045 per GB of data passing through the NAT Gateway&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data Transfer (egress / inter-AZ / inter-region, etc.)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Internet egress: standard egress rates (~ USD 0.09/GB for the first volumes, etc.)&lt;/li&gt;
&lt;li&gt;Cross-Availability Zone transfer (cross-AZ): ~ USD 0.01/GB&lt;/li&gt;
&lt;li&gt;Other transfer charges apply depending on source and destination.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;It’s worth mentioning that the prices listed correspond to October 2025.💲&lt;/p&gt;

&lt;h3&gt;
  
  
  Monthly Cost Estimate
&lt;/h3&gt;

&lt;p&gt;Based on my implementation and assuming minimal traffic, the cost structure would include the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;7 Transit Gateway attachments&lt;/li&gt;
&lt;li&gt;3 NAT Gateways for high availability&lt;/li&gt;
&lt;li&gt;3 Network Firewall endpoints for high availability&lt;/li&gt;
&lt;li&gt;Modest inspection and outbound traffic, say 500 GB/month (as a starting point)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Calculations:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transit Gateway — attachments&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;7 attachments × USD 0.05/hour = USD 0.35/hour&lt;/li&gt;
&lt;li&gt;Monthly hours (~ 24 × 30 = 720 h) → 0.35 × 720 = USD 252/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Transit Gateway — data processing&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Assuming all 500 GB go through TGW: 500 × 0.02 = USD 10/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Network Firewall — endpoints&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;3 endpoints × USD 0.395/hour = USD 1.185/hour&lt;/li&gt;
&lt;li&gt;1.185 × 720 hours = USD 853.20/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Network Firewall — data processing&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;500 GB × USD 0.065 = USD 32.50/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateways — hourly&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;3 NATGWs × USD 0.045/hour = USD 0.135/hour&lt;/li&gt;
&lt;li&gt;0.135 × 720 = USD 97.20/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;NAT Gateways — data processing&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Assuming 200 GB out of the 500 GB go to the Internet&lt;/li&gt;
&lt;li&gt;200 GB × USD 0.045 = USD 9.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Data transfer (egress, etc.)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Assuming 200 GB go to the Internet&lt;/li&gt;
&lt;li&gt;200 × USD 0.09 = USD 18.00/month&lt;/li&gt;
&lt;li&gt;Also, assume 100 GB cross-AZ → 100 × USD 0.01 = USD 1.00/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Estimated Total:
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Estimated Monthly Cost (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TGW — attachments&lt;/td&gt;
&lt;td&gt;252.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TGW — data processing&lt;/td&gt;
&lt;td&gt;10.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NFW — endpoints&lt;/td&gt;
&lt;td&gt;853.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NFW — data processing&lt;/td&gt;
&lt;td&gt;32.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT — hourly&lt;/td&gt;
&lt;td&gt;97.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NAT — data processing&lt;/td&gt;
&lt;td&gt;9.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data transfer (egress + cross-AZ)&lt;/td&gt;
&lt;td&gt;19.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Estimated Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~ USD 1,272.90&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;You probably just saw the cost estimate and got a little scared, right? Don’t worry — this is also due to the cost of high availability. In my example, I used 3 AZs, but your use case might not require that much availability for AWS Network Firewall, and you could deploy it in just 1 or 2 AZs since, in any case, an AZ failure is quite unlikely. 😎&lt;/p&gt;

&lt;p&gt;If you decide to reduce the number of AZs, you should keep two important considerations in mind. The first is the &lt;em&gt;Appliance Mode&lt;/em&gt;, mentioned earlier, which becomes especially relevant to avoid asymmetric traffic if resources are not evenly distributed across all AZs. Additionally, you should clearly understand the concepts of &lt;em&gt;Fail Open&lt;/em&gt; and &lt;em&gt;Fail Closed&lt;/em&gt;, which basically define the default action if all AZs where Network Firewall is deployed were to fail (which is unlikely, but could happen if you use only one AZ). &lt;em&gt;Fail Open&lt;/em&gt; means that if Network Firewall fails, all uninspected traffic will pass freely, whereas &lt;em&gt;Fail Closed&lt;/em&gt; means that if it fails, no traffic will pass. It’s important to evaluate the trade-off between security and availability in these scenarios and make the right decision.&lt;/p&gt;

&lt;p&gt;On the other hand, another way to control Network Firewall costs is to enable only the necessary rules. It might be tempting to add all &lt;em&gt;AWS Managed Rule Groups&lt;/em&gt;, but remember that each one has a cost, consumes capacity units, and not all may actually apply to your use case.&lt;/p&gt;

&lt;p&gt;Keep in mind that the most important part of implementing AWS Network Firewall — besides blocking traffic — is that it provides actionable information and insights. In other words, the findings, metrics, and logs shouldn’t remain unused. Integrate Network Firewall with AWS Security Hub to gain high-value insights and perform remediations, or even automate them through an event-driven approach using Amazon EventBridge, AWS Lambda, or other services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, implementing AWS Network Firewall in a multi-account architecture with Transit Gateway provides a robust, scalable, and secure network infrastructure. By following the steps outlined in this article, you can effectively deploy and configure Network Firewall to protect your VPCs across different accounts within an AWS Organizations structure. The Hub &amp;amp; Spoke pattern, combined with the high availability of 3 Availability Zones, ensures that your network is resilient and capable of handling various traffic patterns and security requirements. Additionally, the use of VPC Flow Logs and Network Firewall logging allows for detailed monitoring and analysis of network traffic, enabling you to identify and respond to potential security threats promptly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;p&gt;In the next section, you’ll find official resources and documentation for the services mentioned, along with some interesting points related to the topics covered — in case you want to keep learning or dive deeper to evaluate whether they truly apply to your use case.&lt;/p&gt;

&lt;p&gt;I also invite you to try this implementation in your own AWS account. Remember that if you don’t have multiple accounts, you can deploy all the VPCs within a single account and still experiment with AWS Network Firewall. Let me know in the comments what you thought of this guide or if you discovered something interesting during your implementation. ✍🏻&lt;/p&gt;

&lt;p&gt;Although I hadn’t mentioned it before, I implemented this entire multi-account architecture using &lt;em&gt;Terraform&lt;/em&gt;. However, the infrastructure-as-code is currently highly customized to the specific needs of the client for whom it was deployed. Later on, I’ll be modularizing and generalizing this code for different scenarios, with the goal of being able to share it with the community.&lt;/p&gt;

&lt;p&gt;Before I go, I want to highlight the great potential of this centralized architecture based on AWS Transit Gateway. Building upon this design, we could extend it by adding a VPN connection to an on-premises corporate data center; deploying an application in a &lt;em&gt;workload VPC&lt;/em&gt; on an EC2 instance internally exposed through a Network Load Balancer (NLB); and placing a public Application Load Balancer (ALB) in the &lt;em&gt;Ingress VPC&lt;/em&gt;, which points to the private IP addresses of the NLB, allowing clients to access the service through the ALB’s public DNS. The following diagram illustrates, in a simple and summarized way, this possible design extension.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F1k6dc4hwgvd7z0hrlmth.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.amazonaws.com%2Fuploads%2Farticles%2F1k6dc4hwgvd7z0hrlmth.png" alt="Transit Gateway design extension" width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/vpc/pricing/" rel="noopener noreferrer"&gt;Amazon VPC Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html" rel="noopener noreferrer"&gt;What is AWS Transit Gateway?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-best-design-practices.html" rel="noopener noreferrer"&gt;AWS Transit Gateway Best Design Practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/transit-gateway/pricing/" rel="noopener noreferrer"&gt;AWS Transit Gateway Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/network-firewall/latest/developerguide/what-is-aws-network-firewall.html" rel="noopener noreferrer"&gt;What is AWS Network Firewall?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/networking-and-content-delivery/deployment-models-for-aws-network-firewall/" rel="noopener noreferrer"&gt;Deployment Models for AWS Network Firewall&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/network-firewall/pricing/" rel="noopener noreferrer"&gt;AWS Network Firewall Pricing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>english</category>
      <category>aws</category>
      <category>networking</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Opciones de conectividad privada de Amazon VPC: VPC Peering vs Transit Gateway vs PrivateLink</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Sun, 12 Oct 2025 23:51:45 +0000</pubDate>
      <link>https://dev.to/cbecerra/opciones-de-conectividad-privada-de-amazon-vpc-vpc-peering-vs-transit-gateway-vs-privatelink-573b</link>
      <guid>https://dev.to/cbecerra/opciones-de-conectividad-privada-de-amazon-vpc-vpc-peering-vs-transit-gateway-vs-privatelink-573b</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; En el mundo de la computación en la nube, garantizar una comunicación segura y eficiente entre varios recursos es primordial. Amazon Web Services (AWS) ofrece varias opciones para la conectividad privada dentro y entre Nubes Privadas Virtuales (VPCs). Este artículo explora tres métodos principales: VPC Peering, AWS Transit Gateway y AWS PrivateLink. Cada método tiene sus características únicas, beneficios y casos de uso, por lo que es esencial comprender sus diferencias para elegir la solución adecuada para tus necesidades. 🙌🏻 &lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tiempo estimado de lectura:&lt;/strong&gt; 15 minutos&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nivel:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versión en inglés:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/amazon-vpc-private-connectivity-options-vpc-peering-vs-transit-gateway-vs-privatelink-2b25"&gt;Amazon VPC private connectivity options: VPC Peering vs Transit Gateway vs PrivateLink&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tabla de Contenidos:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introducción&lt;/li&gt;
&lt;li&gt;Por qué importa conocer las opciones de conectividad privada de Amazon VPC&lt;/li&gt;
&lt;li&gt;
VPC Peering

&lt;ul&gt;
&lt;li&gt;Características clave de VPC Peering&lt;/li&gt;
&lt;li&gt;Limitaciones de VPC Peering&lt;/li&gt;
&lt;li&gt;Escenarios no válidos para VPC Peering&lt;/li&gt;
&lt;li&gt;Conexión VPC Peering con múltiples VPCs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

AWS Transit Gateway

&lt;ul&gt;
&lt;li&gt;Características clave de Transit Gateway&lt;/li&gt;
&lt;li&gt;Por qué usar Transit Gateway&lt;/li&gt;
&lt;li&gt;Transit Gateway con múltiples VPCs&lt;/li&gt;
&lt;li&gt;Transit Gateway con conexión local&lt;/li&gt;
&lt;li&gt;Emparejamiento de Transit Gateway entre regiones de AWS&lt;/li&gt;
&lt;li&gt;Consideraciones importantes para Transit Gateway&lt;/li&gt;
&lt;li&gt;VPC Peering vs Transit Gateway&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

AWS PrivateLink

&lt;ul&gt;
&lt;li&gt;Por qué usar VPC Endpoints&lt;/li&gt;
&lt;li&gt;Descripción general de VPC Endpoints y PrivateLink&lt;/li&gt;
&lt;li&gt;VPC Endpoints impulsados por PrivateLink&lt;/li&gt;
&lt;li&gt;Consideraciones importantes para VPC PrivateLink&lt;/li&gt;
&lt;li&gt;AWS PrivateLink vs VPC Peering&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lecciones Aprendidas&lt;/li&gt;

&lt;li&gt;Conclusión&lt;/li&gt;

&lt;li&gt;Qué sigue&lt;/li&gt;

&lt;li&gt;Recursos oficiales&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introducción
&lt;/h2&gt;

&lt;p&gt;Si tienes dos instancias EC2 en distintas Amazon VPC, probablemente no deberían estar comunicándose mediante direcciones IP públicas. En ese caso, deberías usar &lt;em&gt;VPC Peering&lt;/em&gt; para establecer una comunicación privada entre las VPC.&lt;/p&gt;

&lt;p&gt;Eventualmente, cuando tu infraestructura crezca y tengas muchas VPC con la necesidad de conectarlas entre sí, la cantidad de conexiones de emparejamiento aumentará considerablemente, al igual que el esfuerzo requerido para gestionarlas. Es ahí cuando se considera usar &lt;em&gt;AWS Transit Gateway&lt;/em&gt; para implementar un diseño &lt;em&gt;Hub &amp;amp; Spoke&lt;/em&gt; más sencillo de gestionar a esa escala.&lt;/p&gt;

&lt;p&gt;Eso parecería resolver el problema de la interconectividad privada, pero tanto VPC Peering como Transit Gateway establecen un túnel completo de comunicación bidireccional, permitiendo que cualquier ENI en la &lt;code&gt;VPC A&lt;/code&gt; pueda comunicarse con cualquier ENI en la &lt;code&gt;VPC B&lt;/code&gt;. Para algunos, eso podría no parecer muy seguro.&lt;/p&gt;

&lt;p&gt;En ese punto aparece &lt;em&gt;PrivateLink&lt;/em&gt;, que permite exponer únicamente endpoints específicos de la &lt;code&gt;VPC B&lt;/code&gt;, de modo que la &lt;code&gt;VPC A&lt;/code&gt; los consuma de forma unidireccional, sin permitir tráfico indiscriminado entre VPCs. Esto es particularmente importante cuando las VPC pertenecen a distintos propietarios.&lt;/p&gt;

&lt;p&gt;¿Entonces qué? ¿Así de simple es el criterio para escoger entre estos tres servicios de AWS? Digamos que esa es la idea básica, pero es un poco más complejo que eso. En este artículo exploraremos las características clave de cada servicio y comparaciones detalladas entre ellos que probablemente te resulten útiles. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Por qué importa conocer las opciones de conectividad privada de Amazon VPC
&lt;/h2&gt;

&lt;p&gt;La mayor parte de nuestro tráfico en la nube probablemente no debería pasar a través de Internet. Sin embargo, este suele ser el comportamiento predeterminado cuando comenzamos con AWS: exponemos todo mediante una dirección IP pública y consumimos endpoints públicos a través de un Internet Gateway.&lt;/p&gt;

&lt;p&gt;Pero dirigir todo el tráfico por Internet no solo te expone desde el punto de vista de seguridad, sino que también puede implicar costos más altos que una opción privada y segura. ¿Qué? ¿Más seguridad a menor costo? Así es. 🤯&lt;/p&gt;

&lt;p&gt;AWS ofrece varias opciones que permiten lograr esto. Por ejemplo, los &lt;em&gt;Gateway Endpoints&lt;/em&gt;, mediante los cuales tus recursos en una VPC pueden comunicarse con servicios como Amazon S3 o Amazon DynamoDB sin costos por transferencia de datos. He visto casos de clientes cuyas instancias EC2 realizaban millones de solicitudes a S3 al mes, y créeme, el costo por transferencia de datos hacia Internet no es nada barato. Con una implementación increíblemente simple como la de los &lt;em&gt;Gateway Endpoints&lt;/em&gt;, podrían haberse ahorrado miles de dólares en su factura de AWS.&lt;/p&gt;

&lt;p&gt;Ahora bien, el enfoque de este artículo no son los Gateway Endpoints, sino revisar otras opciones de conectividad algo más avanzadas que te permitirán obtener beneficios principalmente en el ámbito de la seguridad y las conexiones privadas. Algunas de ellas son más seguras y privadas que otras, dependiendo siempre de tu caso de uso.&lt;/p&gt;

&lt;p&gt;Pero mi punto es que, si no conoces estos servicios de AWS, junto con sus beneficios y limitaciones, podrías no realizar correctamente el análisis de &lt;em&gt;trade-offs&lt;/em&gt; y terminar tomando una decisión equivocada al escoger el servicio más adecuado para tu caso. Por eso es importante conocer las opciones de conectividad privada de Amazon VPC.&lt;/p&gt;




&lt;h2&gt;
  
  
  VPC Peering
&lt;/h2&gt;

&lt;p&gt;VPC Peering permite conectar dos VPCs de forma privada utilizando la red de AWS, haciéndolas comportarse como si estuvieran en la misma red. Esta conexión se puede establecer entre VPCs en la misma región de AWS o en regiones diferentes. Además, VPC Peering permite conexiones entre VPCs propiedad de diferentes cuentas de AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Características clave de VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conectividad privada&lt;/strong&gt;: Permite la comunicación privada entre VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multirregional y multicuenta&lt;/strong&gt;: Admite VPCs en diferentes regiones y cuentas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CIDR no superpuestos&lt;/strong&gt;: Las VPCs deben tener bloques CIDR no superpuestos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actualizaciones de la tabla de rutas&lt;/strong&gt;: Requiere actualizar las tablas de rutas en las subredes de cada VPC para garantizar que las instancias puedan comunicarse.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fupbh8wlk754ojjer1ozw.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.amazonaws.com%2Fuploads%2Farticles%2Fupbh8wlk754ojjer1ozw.png" alt="VPC Peering" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitaciones de VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Superposición de CIDR&lt;/strong&gt;: Las VPCs no deben tener bloques CIDR superpuestos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No transitivo&lt;/strong&gt;: Las conexiones VPC Peering no son transitivas; cada VPC que necesita comunicarse debe tener una conexión de emparejamiento directa.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Una sola conexión por par de VPC&lt;/strong&gt;: Solo se puede establecer una conexión VPC peering entre dos VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Límite de conexión&lt;/strong&gt;: Máximo de 125 conexiones VPC peering por VPC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Escenarios no válidos para VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Conexión VPN o Direct Connect a la red local.&lt;/li&gt;
&lt;li&gt;Acceso a Internet a través de un &lt;em&gt;Internet Gateway&lt;/em&gt; de una VPC emparejada.&lt;/li&gt;
&lt;li&gt;Acceso a Internet a través del &lt;em&gt;NAT Gateway&lt;/em&gt; de una VPC emparejada.&lt;/li&gt;
&lt;li&gt;Acceso a S3/DynamoDB a través de un &lt;em&gt;VPC Gateway endpoint&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conexión VPC Peering con múltiples VPCs
&lt;/h3&gt;

&lt;p&gt;Cuando múltiples VPCs necesitan comunicarse entre sí utilizando el emparejamiento, debe crear una &lt;em&gt;full mesh&lt;/em&gt; de conexiones de emparejamiento. Esto se vuelve rápidamente complejo a medida que aumenta el número de VPCs.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fcgdt3sj588xirjvjgr62.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.amazonaws.com%2Fuploads%2Farticles%2Fcgdt3sj588xirjvjgr62.png" alt="VPC Peering con múltiples conexiones de emparejamiento" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Esta arquitectura ya comienza a tener demasiadas conexiones de emparejamiento que gestionar, ¿cierto? Creo que ya empiezo a notar el &lt;em&gt;Full Mess&lt;/em&gt; — perdón, &lt;em&gt;Full Mesh&lt;/em&gt; — en la red. Será mejor pasar al siguiente servicio: &lt;em&gt;AWS Transit Gateway&lt;/em&gt;. 😂&lt;/p&gt;




&lt;h2&gt;
  
  
  AWS Transit Gateway
&lt;/h2&gt;

&lt;p&gt;Transit Gateway permite a los clientes interconectar miles de VPCs y redes locales en un modelo de hub-and-spoke. Simplifica la gestión de la red centralizando la conectividad.&lt;/p&gt;

&lt;h3&gt;
  
  
  Características clave de Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Attachments&lt;/strong&gt;: Admite attachments para VPCs, conexiones de emparejamiento con otras Transit Gateways, VPNs, Direct Connect Gateways y dispositivos de red de terceros.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Características&lt;/strong&gt;: Incluye soporte para multidifusión, MTU, modo de dispositivo, consideración de AZ y TGW Sharing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arquitecturas&lt;/strong&gt;: Admite arquitecturas como inspección centralizada de tráfico, egreso centralizado y servicios compartidos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Por qué usar Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Escalabilidad&lt;/strong&gt;: Admite hasta 5000 attachments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conectividad híbrida&lt;/strong&gt;: Permite la conectividad híbrida a través de VPN y Direct Connect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gestión simplificada&lt;/strong&gt;: Reduce la complejidad en la gestión de múltiples conexiones VPC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Transit Gateway con múltiples VPCs
&lt;/h3&gt;

&lt;p&gt;Un Transit Gateway actúa como un enrutador central para todas las VPCs conectadas, simplificando drásticamente la gestión de la conectividad. Cada VPC solo necesita una sola conexión al TGW.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Focgwtjyam5ycqb6kmc7s.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.amazonaws.com%2Fuploads%2Farticles%2Focgwtjyam5ycqb6kmc7s.png" alt="Transit Gateway" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Transit Gateway con conexión local
&lt;/h3&gt;

&lt;p&gt;Transit Gateway se integra con &lt;em&gt;AWS Site-to-Site VPN&lt;/em&gt; y &lt;em&gt;AWS Direct Connect&lt;/em&gt; para extender tu red privada a AWS de forma segura.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fo9vtqk389l9703l74oyx.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.amazonaws.com%2Fuploads%2Farticles%2Fo9vtqk389l9703l74oyx.png" alt="Transit Gateway con conexión local" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Emparejamiento de Transit Gateway entre regiones de AWS
&lt;/h3&gt;

&lt;p&gt;Transit Gateway admite emparejamiento entre regiones, lo que le permite construir una red privada global entre regiones de AWS sin exponer el tráfico a Internet.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Focndkwbjelzobxocwwh8.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.amazonaws.com%2Fuploads%2Farticles%2Focndkwbjelzobxocwwh8.png" alt="Emparejamiento de Transit Gateway" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Consideraciones importantes para Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resolución de DNS&lt;/strong&gt;: Admite la resolución de DNS para todas las VPCs conectadas al TGW.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compartir con RAM&lt;/strong&gt;: Se puede compartir utilizando Resource Access Manager (RAM) entre cuentas de AWS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facturación&lt;/strong&gt;: Se factura por hora, por attachment, con cargos por procesamiento de datos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ancho de banda&lt;/strong&gt;: Admite hasta 50 Gbps de ancho de banda total de VPN con ECMP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MTU&lt;/strong&gt;: Admite una MTU de 8500 bytes para el tráfico entre VPCs y 1500 bytes para las conexiones VPN.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VPC Peering vs Transit Gateway
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Característica&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;VPC Peering&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Transit Gateway&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Arquitectura&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Conexión uno a uno – &lt;em&gt;Full mesh&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;em&gt;Hub and Spoke&lt;/em&gt; con múltiples attachments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Conectividad híbrida&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No soportado&lt;/td&gt;
&lt;td&gt;Soportado a través de VPN y Direct Connect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complejidad&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple para menos VPCs, Complejo a medida que aumenta el número&lt;/td&gt;
&lt;td&gt;Simple para cualquier número de VPCs y conectividad de red híbrida&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Escalabilidad&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;125 conexiones de emparejamiento por VPC&lt;/td&gt;
&lt;td&gt;5000 attachments por TGW&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Latencia&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Más baja&lt;/td&gt;
&lt;td&gt;Salto adicional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ancho de banda&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sin límite&lt;/td&gt;
&lt;td&gt;50 Gbps por attachment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Referencia de grupo de seguridad&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Soportado&lt;/td&gt;
&lt;td&gt;Soportado (solo reglas de entrada)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Conectividad de subred&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Para todas las subredes a través de AZs&lt;/td&gt;
&lt;td&gt;Solo subredes dentro de la misma AZ en la que se crea el attachment TGW&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Enrutamiento transitivo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No soportado&lt;/td&gt;
&lt;td&gt;Soportado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TCO&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Más bajo – Solo costo de transferencia de datos&lt;/td&gt;
&lt;td&gt;Costo por attachment + costo de transferencia de datos&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Muy bonito todo, pero recuerda que ninguno de estos dos servicios soluciona el problema de las VPC con CIDRs superpuestos. Además, ambos establecen un túnel bidireccional muy amplio entre VPCs, y cuando conozcas el siguiente servicio, &lt;em&gt;AWS PrivateLink&lt;/em&gt;, lo pensarás dos veces antes de elegir de inmediato uno de estos servicios para tu conectividad privada. 🧐&lt;/p&gt;




&lt;h2&gt;
  
  
  AWS PrivateLink
&lt;/h2&gt;

&lt;p&gt;AWS PrivateLink, junto con los endpoints de VPC, permite conexiones seguras y privadas entre tu VPC y los servicios de AWS soportados, incluidos aquellos alojados por otros clientes o socios de AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Por qué usar VPC Endpoints
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Comunicación privada&lt;/strong&gt;: Permite una comunicación segura entre tu VPC y los servicios de AWS sin usar Internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Superficie de ataque reducida&lt;/strong&gt;: Elimina la necesidad de &lt;em&gt;Internet Gateways&lt;/em&gt;, dispositivos NAT o VPN, minimizando la exposición.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amplio soporte de servicios&lt;/strong&gt;: Funciona con servicios nativos de AWS, servicios de socios y aquellos alojados por otros clientes de AWS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exposición controlada&lt;/strong&gt;: Permite exponer únicamente aplicaciones o endpoints específicos, en lugar de toda la red.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatibilidad con CIDRs superpuestos&lt;/strong&gt;: Soluciona el dilema de la conectividad privada entre VPCs que usan rangos de direcciones IP superpuestos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Sin VPC Endpoints y PrivateLink
&lt;/h4&gt;

&lt;p&gt;Sin PrivateLink, tu tráfico a los servicios de AWS viaja por Internet público, aunque ambos recursos residen en AWS. Esto introduce latencia adicional, exposición de seguridad y dependencia de la ruta de Internet.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fsae1klxoe52gq6psp4ck.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.amazonaws.com%2Fuploads%2Farticles%2Fsae1klxoe52gq6psp4ck.png" alt="Sin VPC endpoints y PrivateLink" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Con VPC Endpoints y PrivateLink
&lt;/h4&gt;

&lt;p&gt;Con PrivateLink, tu VPC (consumidora) se conecta de forma privada a servicios de AWS o de terceros (proveedores) a través de ENIs locales (Interfaces de Red Elásticas), asegurando que el tráfico permanezca dentro de la red troncal de AWS.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fybznfd0n6zgttjovymdo.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.amazonaws.com%2Fuploads%2Farticles%2Fybznfd0n6zgttjovymdo.png" alt="Con VPC endpoints y PrivateLink" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Descripción general de VPC Endpoints y PrivateLink
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Proporcionan conectividad de red privada entre VPCs y servicios de AWS.&lt;/li&gt;
&lt;li&gt;Eliminan la necesidad de puertas &lt;em&gt;Internet Gateways&lt;/em&gt; o &lt;em&gt;NAT Gateways&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Los endpoints son redundantes, escalables horizontalmente y altamente disponibles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway endpoint&lt;/strong&gt;: Acceso solo a Amazon S3 y DynamoDB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface endpoint&lt;/strong&gt;: Acceso a servicios entre cuentas u otras VPCs.&lt;/li&gt;
&lt;li&gt;Otros tipos de endpoints: &lt;strong&gt;Gateway Load Balancer&lt;/strong&gt;, &lt;strong&gt;Resource&lt;/strong&gt; y &lt;strong&gt;Service-Network&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VPC Endpoints impulsados por PrivateLink
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interface endpoint&lt;/strong&gt;: Para acceder a servicios implementados en otras VPCs y cuentas de AWS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource endpoint&lt;/strong&gt;: Para recursos específicos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service-Network endpoint&lt;/strong&gt;: Para redes de servicios de VPC Lattice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Soporte para IPv4 e IPv6&lt;/strong&gt;: Soporte de NAT y tráfico UDP.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F15s482c2wll0afkbor88.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.amazonaws.com%2Fuploads%2Farticles%2F15s482c2wll0afkbor88.png" alt="VPC PrivateLink" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Consideraciones importantes para VPC PrivateLink
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direcciones IP locales&lt;/strong&gt;: Los endpoints de VPC crean direcciones IP locales usando ENI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Soporte de superposición de CIDR&lt;/strong&gt;: Puede conectar servicios dentro de VPCs con bloques CIDR superpuestos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alta disponibilidad&lt;/strong&gt;: Cree endpoints de VPC en múltiples Zonas de Disponibilidad.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grupos de seguridad&lt;/strong&gt;: Utiliza grupos de seguridad – reglas de entrada.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Soporte de tráfico&lt;/strong&gt;: Admite tráfico IPv4 e IPv6 sobre TCP y UDP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acceso desde otras redes&lt;/strong&gt;: Puede accederse desde otras redes como VPCs emparejadas, Transit Gateway, VPN o Direct Connect.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Comunicación entre VPCs con CIDRs superpuestos
&lt;/h4&gt;

&lt;p&gt;PrivateLink permite la comunicación entre VPCs que usan bloques CIDR superpuestos sin requerir cambios de enrutamiento.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fox9bhhnuklkkdjmvgnia.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.amazonaws.com%2Fuploads%2Farticles%2Fox9bhhnuklkkdjmvgnia.png" alt="VPC PrivateLink con CIDRs superpuestos" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Endpoint de VPC con grupo de seguridad
&lt;/h4&gt;

&lt;p&gt;Los endpoints de PrivateLink están asociados con ENIs y protegidos por reglas de entrada de grupos de seguridad para un acceso controlado.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fm9kpcbk7r2069rn99xlh.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.amazonaws.com%2Fuploads%2Farticles%2Fm9kpcbk7r2069rn99xlh.png" alt="Endpoint de VPC con grupo de seguridad" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Acceso desde otras redes
&lt;/h4&gt;

&lt;p&gt;Los endpoints de PrivateLink se pueden acceder desde redes externas como VPCs emparejadas, Transit Gateway, VPN y Direct Connect.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fgq1f8p65uk8xpsrikg27.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.amazonaws.com%2Fuploads%2Farticles%2Fgq1f8p65uk8xpsrikg27.png" alt="Acceso desde otras redes a endpoint de VPC" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS PrivateLink vs VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VPC Peering&lt;/strong&gt;: Útil para muchos recursos que se comunican entre VPCs emparejadas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PrivateLink&lt;/strong&gt;: Ideal para permitir el acceso a una sola aplicación alojada en tu VPC sin emparejar las VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Superposición de CIDR&lt;/strong&gt;: No se puede crear un emparejamiento de VPC con CIDRs superpuestos, pero PrivateLink lo admite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Límites de conexión&lt;/strong&gt;: Máximo de 125 conexiones de emparejamiento; sin límite en las conexiones de PrivateLink.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Origen del tráfico&lt;/strong&gt;: El emparejamiento de VPC permite el origen de tráfico bidireccional; PrivateLink permite solo que el consumidor origine el tráfico.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Lecciones Aprendidas
&lt;/h2&gt;

&lt;p&gt;En este trabajo vivirás haciendo análisis de &lt;em&gt;trade-offs&lt;/em&gt; de manera constante. A veces, un solo servicio no será la solución perfecta para tu problema; necesitarás combinarlos o incluso ponerte creativo. 🤔&lt;/p&gt;

&lt;p&gt;Para mí, lo más importante que me gustaría que te lleves de estas lecciones aprendidas es la importancia del costo en el análisis de &lt;em&gt;trade-offs&lt;/em&gt;, y que, para evitar sorpresas a final de mes, nunca te olvides de los precios de cada servicio.&lt;/p&gt;

&lt;p&gt;Porque sí, Transit Gateway puede ser una excelente opción para gestionar múltiples conexiones a gran escala, pero también implica un costo considerable por cada &lt;em&gt;attachment&lt;/em&gt; y por cada gigabyte de tráfico procesado, mientras que VPC Peering es prácticamente gratuito.&lt;/p&gt;

&lt;p&gt;De igual forma, podrías inclinarte por usar PrivateLink para que tus instancias EC2 consuman todos los servicios de AWS mediante endpoints privados, pero recuerda que cada endpoint tiene un costo fijo, además del costo por procesamiento de datos. Quizá te convenga usarlo solo para servicios como AWS Secrets Manager o AWS KMS, pero no necesariamente para Amazon S3 o Amazon CloudWatch, especialmente si no manejas información sensible.&lt;/p&gt;

&lt;p&gt;Un comentario adicional: Como se mencionó anteriormente, Transit Gateway resulta útil en múltiples patrones de arquitectura centralizados, entre los cuales se encuentra el patrón de &lt;em&gt;servicios compartidos&lt;/em&gt;. Este patrón se refiere a que, si múltiples VPC necesitan un endpoint de PrivateLink, puede que no sea la mejor idea crearlo en cada VPC, sino implementarlo en una &lt;em&gt;VPC de servicios compartidos&lt;/em&gt;, desde la cual los consumidores accedan al endpoint de forma centralizada.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;Elegir la opción de conectividad privada adecuada en AWS depende de sus requisitos específicos, incluyendo el número de VPCs, la necesidad de conectividad híbrida y la complejidad de tu arquitectura de red. VPC Peering es ideal para conexiones simples y directas entre un número limitado de VPCs. Transit Gateway ofrece escalabilidad y gestión simplificada para redes más grandes y complejas. AWS PrivateLink proporciona conexiones seguras y privadas a los servicios de AWS y otras VPCs, especialmente útil para el acceso a aplicaciones específicas sin el emparejamiento completo de VPC. Comprender estas opciones te ayudará a diseñar una arquitectura de red robusta, segura y eficiente en AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qué sigue
&lt;/h2&gt;

&lt;p&gt;En la siguiente sección dejaré los recursos y documentos oficiales de los servicios mencionados, junto con algunos puntos interesantes sobre los temas que he tratado, por si te interesa continuar aprendiendo sobre ellos o profundizar para determinar si realmente aplican a tu caso de uso.&lt;/p&gt;

&lt;p&gt;También te invito a desplegar y probar estos tres servicios en tu cuenta de AWS y dejarme en los comentarios qué te parecieron. Y si ya los conoces, cuéntame en los comentarios qué &lt;em&gt;trade-off&lt;/em&gt; particular te llevó a escoger entre un servicio y otro, o qué característica descubriste que cambió radicalmente tu percepción sobre alguno de ellos. ✍🏻&lt;/p&gt;

&lt;p&gt;Quizá has oído hablar de &lt;em&gt;Amazon VPC Lattice&lt;/em&gt;, un servicio relativamente nuevo en comparación con los otros mencionados en este artículo, pero que está ganando cada vez más adopción como una de las opciones más modernas para la conectividad privada en Amazon VPC. Te invito a echarle un vistazo; pronto estaré probándolo y escribiendo un artículo al respecto.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recursos oficiales
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/peering/what-is-vpc-peering.html" rel="noopener noreferrer"&gt;¿Qué es VPC Peering?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/vpc/pricing/" rel="noopener noreferrer"&gt;Precios de Amazon VPC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/tgw/what-is-transit-gateway.html" rel="noopener noreferrer"&gt;¿Qué es AWS Transit Gateway?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/transit-gateway/pricing/" rel="noopener noreferrer"&gt;Precios de AWS Transit Gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc/latest/privatelink/what-is-privatelink.html" rel="noopener noreferrer"&gt;¿Qué es AWS PrivateLink?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/es/privatelink/pricing/" rel="noopener noreferrer"&gt;Precios de AWS PrivateLink&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/es_es/vpc-lattice/latest/ug/what-is-vpc-lattice.html" rel="noopener noreferrer"&gt;¿Qué es Amazon VPC Lattice?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>spanish</category>
      <category>aws</category>
      <category>networking</category>
      <category>connectivity</category>
    </item>
    <item>
      <title>Amazon VPC private connectivity options: VPC Peering vs Transit Gateway vs PrivateLink</title>
      <dc:creator>Cristhian Becerra</dc:creator>
      <pubDate>Sun, 12 Oct 2025 23:51:41 +0000</pubDate>
      <link>https://dev.to/cbecerra/amazon-vpc-private-connectivity-options-vpc-peering-vs-transit-gateway-vs-privatelink-2b25</link>
      <guid>https://dev.to/cbecerra/amazon-vpc-private-connectivity-options-vpc-peering-vs-transit-gateway-vs-privatelink-2b25</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; In the world of cloud computing, ensuring secure and efficient communication between various resources is paramount. Amazon Web Services (AWS) offers several options for private connectivity within and between Virtual Private Clouds (VPCs). This article explores three primary methods: VPC Peering, AWS Transit Gateway, and AWS PrivateLink. Each method has its unique features, benefits, and use cases, making it essential to understand their differences to choose the right solution for your needs. 🙌🏻&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Estimated reading time:&lt;/strong&gt; 15 minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Level:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spanish version:&lt;/strong&gt; &lt;a href="https://dev.to/cbecerra/opciones-de-conectividad-privada-de-amazon-vpc-vpc-peering-vs-transit-gateway-vs-privatelink-573b"&gt;Opciones de conectividad privada de Amazon VPC: VPC Peering vs Transit Gateway vs PrivateLink&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Table of Contents:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Why It Matters to Understand Amazon VPC Private Connectivity Options&lt;/li&gt;
&lt;li&gt;
VPC Peering

&lt;ul&gt;
&lt;li&gt;Key Features of VPC Peering&lt;/li&gt;
&lt;li&gt;VPC Peering Limitations&lt;/li&gt;
&lt;li&gt;Invalid Scenarios for VPC Peering&lt;/li&gt;
&lt;li&gt;VPC Peering Connection with Multiple VPCs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

AWS Transit Gateway

&lt;ul&gt;
&lt;li&gt;Key Features of Transit Gateway&lt;/li&gt;
&lt;li&gt;Why Use Transit Gateway&lt;/li&gt;
&lt;li&gt;Transit Gateway with Multiple VPCs&lt;/li&gt;
&lt;li&gt;Transit Gateway with On-Premises Connection&lt;/li&gt;
&lt;li&gt;Transit Gateway Peering Across AWS Regions&lt;/li&gt;
&lt;li&gt;Important Considerations for Transit Gateway&lt;/li&gt;
&lt;li&gt;VPC Peering vs Transit Gateway&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

AWS PrivateLink

&lt;ul&gt;
&lt;li&gt;Why Use VPC Endpoints&lt;/li&gt;
&lt;li&gt;VPC Endpoints and PrivateLink Overview&lt;/li&gt;
&lt;li&gt;VPC Endpoints Powered by PrivateLink&lt;/li&gt;
&lt;li&gt;Important Considerations for VPC PrivateLink&lt;/li&gt;
&lt;li&gt;AWS PrivateLink vs VPC Peering&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Lessons Learned&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;What’s Next&lt;/li&gt;

&lt;li&gt;Official Resources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you have two EC2 instances in different Amazon VPCs, they probably shouldn’t be communicating through public IP addresses. In that case, you should use &lt;em&gt;VPC Peering&lt;/em&gt; to establish private communication between the VPCs.&lt;/p&gt;

&lt;p&gt;Eventually, as your infrastructure grows and you have many VPCs that need to connect with each other, the number of peering connections will increase significantly, along with the effort required to manage them. That’s when you might consider using &lt;em&gt;AWS Transit Gateway&lt;/em&gt; to implement a &lt;em&gt;Hub &amp;amp; Spoke&lt;/em&gt; design that’s easier to manage at scale.&lt;/p&gt;

&lt;p&gt;That might seem to solve the private interconnectivity problem, but both VPC Peering and Transit Gateway establish a full bidirectional communication tunnel, allowing any ENI in &lt;code&gt;VPC A&lt;/code&gt; to communicate with any ENI in &lt;code&gt;VPC B&lt;/code&gt;. For some, that might not seem very secure.&lt;/p&gt;

&lt;p&gt;At that point, &lt;em&gt;PrivateLink&lt;/em&gt; comes into play. It allows you to expose only specific endpoints from &lt;code&gt;VPC B&lt;/code&gt;, so that &lt;code&gt;VPC A&lt;/code&gt; can consume them in a unidirectional way, without allowing unrestricted traffic between VPCs. This is particularly important when the VPCs belong to different owners.&lt;/p&gt;

&lt;p&gt;So what now? Is that really all there is to choosing between these three AWS services? Let’s say that’s the basic idea, but it’s a bit more complex than that. In this article, we’ll explore the key features of each service and provide detailed comparisons that you’ll likely find useful. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Why It Matters to Understand Amazon VPC Private Connectivity Options
&lt;/h2&gt;

&lt;p&gt;Most of our traffic in the cloud probably shouldn’t be going through the Internet. However, this is often the default behavior when we first start with AWS: we expose everything through a public IP address and consume public endpoints via an Internet Gateway.&lt;/p&gt;

&lt;p&gt;But routing all your traffic through the Internet not only exposes you from a security standpoint, it can also lead to higher costs compared to a private and secure option. What? More security at a lower cost? That’s right. 🤯&lt;/p&gt;

&lt;p&gt;AWS offers several options that make this possible. For example, &lt;em&gt;Gateway Endpoints&lt;/em&gt; allow your VPC resources to communicate with services like Amazon S3 or Amazon DynamoDB without data transfer costs. I’ve seen cases where customers had EC2 instances making millions of requests to S3 per month, and believe me, data transfer costs to the Internet aren’t cheap. With an incredibly simple implementation like Gateway Endpoints, they could have saved thousands of dollars on their AWS bill.&lt;/p&gt;

&lt;p&gt;Now, the focus of this article isn’t on Gateway Endpoints, but rather on other, more advanced connectivity options that bring benefits mainly in the areas of security and private connections. Some of them are more secure and private than others, it always depends on your use case.&lt;/p&gt;

&lt;p&gt;But my point is this: if you don’t know these AWS services, along with their benefits and limitations, you might fail to properly analyze the trade-offs and end up making the wrong decision when choosing the most suitable service for your case. That’s why it’s important to understand the private connectivity options available in Amazon VPC.&lt;/p&gt;




&lt;h2&gt;
  
  
  VPC Peering
&lt;/h2&gt;

&lt;p&gt;VPC Peering allows you to connect two VPCs privately using AWS’s network, making them behave as if they were in the same network. This connection can be established between VPCs in the same AWS region or across different regions. Additionally, VPC Peering supports connections between VPCs owned by different AWS accounts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Connectivity&lt;/strong&gt;: Enables private communication between VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Region and Cross-Account&lt;/strong&gt;: Supports VPCs in different regions and accounts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-Overlapping CIDRs&lt;/strong&gt;: VPCs must have non-overlapping CIDR blocks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route Table Updates&lt;/strong&gt;: Requires updating route tables in each VPC’s subnets to ensure instances can communicate.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fupbh8wlk754ojjer1ozw.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.amazonaws.com%2Fuploads%2Farticles%2Fupbh8wlk754ojjer1ozw.png" alt="VPC Peering" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  VPC Peering Limitations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CIDR Overlap&lt;/strong&gt;: VPCs must not have overlapping CIDR blocks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-Transitive&lt;/strong&gt;: VPC Peering connections are not transitive; each VPC that needs to communicate must have a direct peering connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Connection per VPC Pair&lt;/strong&gt;: Only one VPC peering connection can be established between two VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connection Limit&lt;/strong&gt;: Maximum of 125 VPC peering connections per VPC.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Invalid Scenarios for VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;VPN or Direct Connect connection to on-premises network.&lt;/li&gt;
&lt;li&gt;Internet access through a peered VPC’s internet gateway.&lt;/li&gt;
&lt;li&gt;Internet access through a peered VPC’s NAT Gateway.&lt;/li&gt;
&lt;li&gt;Access to S3/DynamoDB through a VPC Gateway endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VPC Peering Connection with Multiple VPCs
&lt;/h3&gt;

&lt;p&gt;When multiple VPCs need to communicate with each other using peering, you must create a &lt;em&gt;full mesh&lt;/em&gt; of peering connections. This quickly becomes complex as the number of VPCs grows.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fcgdt3sj588xirjvjgr62.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.amazonaws.com%2Fuploads%2Farticles%2Fcgdt3sj588xirjvjgr62.png" alt="VPC Peering with multiple peering connections" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This architecture is already starting to have too many peering connections to manage, right? I think I’m beginning to notice the &lt;em&gt;Full Mess&lt;/em&gt; — sorry, &lt;em&gt;Full Mesh&lt;/em&gt; — in the network. It’s better to move on to the next service: &lt;em&gt;AWS Transit Gateway&lt;/em&gt;. 😂&lt;/p&gt;




&lt;h2&gt;
  
  
  AWS Transit Gateway
&lt;/h2&gt;

&lt;p&gt;Transit Gateway allows customers to interconnect thousands of VPCs and on-premises networks in a hub-and-spoke model. It simplifies network management by centralizing connectivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Attachments&lt;/strong&gt;: Supports attachments for VPCs, peering connections with other Transit Gateways, VPNs, Direct Connect Gateways, and third-party network appliances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Features&lt;/strong&gt;: Includes multicast support, MTU, appliance mode, AZ consideration, and TGW Sharing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architectures&lt;/strong&gt;: Supports architectures like centralized traffic inspection, centralized egress and shared services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Use Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Supports up to 5000 attachments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid Connectivity&lt;/strong&gt;: Enables hybrid connectivity via VPN and Direct Connect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplified Management&lt;/strong&gt;: Reduces complexity in managing multiple VPC connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Transit Gateway with Multiple VPCs
&lt;/h3&gt;

&lt;p&gt;A Transit Gateway acts as a central router for all connected VPCs, drastically simplifying connectivity management. Each VPC only needs a single attachment to the TGW.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Focgwtjyam5ycqb6kmc7s.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.amazonaws.com%2Fuploads%2Farticles%2Focgwtjyam5ycqb6kmc7s.png" alt="Transit Gateway" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Transit Gateway with On-Premises Connection
&lt;/h3&gt;

&lt;p&gt;Transit Gateway integrates with &lt;em&gt;AWS Site-to-Site VPN&lt;/em&gt; and *AWS Direct Connect * to extend your private network into AWS securely.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fo9vtqk389l9703l74oyx.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.amazonaws.com%2Fuploads%2Farticles%2Fo9vtqk389l9703l74oyx.png" alt="Transit Gateway with On-Premises connection" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Transit Gateway Peering Across AWS Regions
&lt;/h3&gt;

&lt;p&gt;Transit Gateway supports inter-region peering, allowing you to build a global private network between AWS regions without exposing traffic to the internet.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Focndkwbjelzobxocwwh8.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.amazonaws.com%2Fuploads%2Farticles%2Focndkwbjelzobxocwwh8.png" alt="Transit Gateway Peering" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Considerations for Transit Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DNS Resolution&lt;/strong&gt;: Supports DNS resolution for all VPCs attached to the TGW.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RAM Sharing&lt;/strong&gt;: Can be shared using Resource Access Manager (RAM) across AWS accounts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Billing&lt;/strong&gt;: Billed per hour, per attachment, with data processing charges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bandwidth&lt;/strong&gt;: Supports up to 50 Gbps total VPN bandwidth with ECMP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MTU&lt;/strong&gt;: Supports an MTU of 8500 bytes for traffic between VPCs and 1500 bytes for VPN connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VPC Peering vs Transit Gateway
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;VPC Peering&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Transit Gateway&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One-to-One connection – Full Mesh&lt;/td&gt;
&lt;td&gt;Hub and Spoke with multiple attachments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hybrid Connectivity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;td&gt;Supported via VPN and Direct Connect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complexity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple for fewer VPCs, Complex as number increases&lt;/td&gt;
&lt;td&gt;Simple for any number of VPCs and hybrid network connectivity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scale&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;125 peering connections per VPC&lt;/td&gt;
&lt;td&gt;5000 attachments per TGW&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Latency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lowest&lt;/td&gt;
&lt;td&gt;Additional Hop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bandwidth&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No limit&lt;/td&gt;
&lt;td&gt;50 Gbps per attachment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Security Group Reference&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Supported&lt;/td&gt;
&lt;td&gt;Supported (Inbound rules only)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Subnet Connectivity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;For all subnets across AZs&lt;/td&gt;
&lt;td&gt;Only subnets within the same AZ in which TGW attachment is created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Transitive Routing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;td&gt;Supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TCO&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lowest – Only Data transfer cost&lt;/td&gt;
&lt;td&gt;Per attachment cost + Data transfer cost&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All very nice, but remember that neither of these two services solves the problem of VPCs with overlapping CIDRs. In addition, both establish a very broad bidirectional tunnel between VPCs, and once you get to know the next service, &lt;em&gt;AWS PrivateLink&lt;/em&gt;, you’ll think twice before immediately choosing one of these services for your private connectivity. 🧐&lt;/p&gt;




&lt;h2&gt;
  
  
  AWS PrivateLink
&lt;/h2&gt;

&lt;p&gt;AWS PrivateLink, in conjunction with VPC endpoints, enables secure and private connections between your VPC and supported AWS services, including those hosted by other AWS customers or partners.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use VPC Endpoints
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Communication:&lt;/strong&gt; Enables secure communication between your VPC and AWS services without using the internet.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Attack Surface:&lt;/strong&gt; Removes the need for Internet Gateways, NAT devices, or VPNs, minimizing exposure.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broad Service Support:&lt;/strong&gt; Works with AWS native services, partner services, and those hosted by other AWS customers.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controlled exposure&lt;/strong&gt;: Allows you to expose only specific applications or endpoints instead of the entire network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overlapping CIDR compatibility&lt;/strong&gt;: Solves the dilemma of private connectivity between VPCs that use overlapping IP address ranges.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Without VPC Endpoints and PrivateLink
&lt;/h4&gt;

&lt;p&gt;Without PrivateLink, your traffic to AWS services travels over the public internet, even though both resources reside in AWS. This introduces additional latency, security exposure, and reliance on internet routing.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fsae1klxoe52gq6psp4ck.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.amazonaws.com%2Fuploads%2Farticles%2Fsae1klxoe52gq6psp4ck.png" alt="Without VPC endpoints and PrivateLink" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  With VPC Endpoints and PrivateLink
&lt;/h4&gt;

&lt;p&gt;With PrivateLink, your VPC connects privately to AWS or third-party services via local ENIs (Elastic Network Interfaces), ensuring traffic stays within the AWS network backbone.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fybznfd0n6zgttjovymdo.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.amazonaws.com%2Fuploads%2Farticles%2Fybznfd0n6zgttjovymdo.png" alt="With VPC endpoints and PrivateLink" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  VPC Endpoints and PrivateLink Overview
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Provide private network connectivity between VPCs and AWS services.
&lt;/li&gt;
&lt;li&gt;Eliminate the need for Internet Gateways or NAT Gateways.
&lt;/li&gt;
&lt;li&gt;Endpoints are redundant, horizontally scaled, and highly available.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway Endpoint:&lt;/strong&gt; Access Amazon S3 and DynamoDB only.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface Endpoint:&lt;/strong&gt; Access services across accounts or other VPCs.
&lt;/li&gt;
&lt;li&gt;Other endpoint types: &lt;strong&gt;Gateway Load Balancer&lt;/strong&gt;, &lt;strong&gt;Resource&lt;/strong&gt;, and &lt;strong&gt;Service-Network&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  VPC Endpoints Powered by PrivateLink
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interface Endpoint&lt;/strong&gt;: For accessing services deployed in other VPCs and AWS accounts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Endpoint&lt;/strong&gt;: For specific resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service-Network Endpoint&lt;/strong&gt;: For VPC Lattice service networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Support for IPv4 and IPv6&lt;/strong&gt;: NAT and UDP traffic support.&lt;/li&gt;
&lt;/ul&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F15s482c2wll0afkbor88.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.amazonaws.com%2Fuploads%2Farticles%2F15s482c2wll0afkbor88.png" alt="VPC PrivateLink" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Considerations for VPC PrivateLink
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local IP Addresses&lt;/strong&gt;: VPC endpoints create local IP addresses using ENI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overlapping CIDR Support&lt;/strong&gt;: Can connect services inside VPCs with overlapping CIDR blocks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Availability&lt;/strong&gt;: Create VPC endpoints across multiple Availability Zones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups&lt;/strong&gt;: Uses Security Groups – inbound rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traffic Support&lt;/strong&gt;: Supports IPv4 and IPv6 traffic over TCP and UDP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access from Other Networks&lt;/strong&gt;: Can be accessed from other networks like Peered VPCs, Transit Gateway, VPN, or Direct Connect.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  VPC communication with overlapping CIDRs
&lt;/h4&gt;

&lt;p&gt;PrivateLink enables communication between VPCs that use overlapping CIDR blocks without requiring routing changes.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fox9bhhnuklkkdjmvgnia.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.amazonaws.com%2Fuploads%2Farticles%2Fox9bhhnuklkkdjmvgnia.png" alt="VPC PrivateLink with overlapping CIDRs" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  VPC endpoint with security group
&lt;/h4&gt;

&lt;p&gt;PrivateLink endpoints are associated with ENIs and protected by security group inbound rules for controlled access.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fm9kpcbk7r2069rn99xlh.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.amazonaws.com%2Fuploads%2Farticles%2Fm9kpcbk7r2069rn99xlh.png" alt="VPC endpoint with security group" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Access from Other Networks
&lt;/h4&gt;

&lt;p&gt;PrivateLink endpoints can be accessed from external networks such as Peered VPCs, Transit Gateway, VPN, and Direct Connect.&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2Fgq1f8p65uk8xpsrikg27.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.amazonaws.com%2Fuploads%2Farticles%2Fgq1f8p65uk8xpsrikg27.png" alt="VPC endpoint access from other networks" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS PrivateLink vs VPC Peering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VPC Peering&lt;/strong&gt;: Useful for many resources communicating between peered VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PrivateLink&lt;/strong&gt;: Ideal for allowing access to a single application hosted in your VPC without peering the VPCs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CIDR Overlap&lt;/strong&gt;: VPC peering cannot be created with overlapping CIDRs, but PrivateLink supports it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connection Limits&lt;/strong&gt;: Maximum of 125 peering connections; no limit on PrivateLink connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traffic Origin&lt;/strong&gt;: VPC peering enables bidirectional traffic origin; PrivateLink allows only the consumer to originate traffic.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;In this line of work, you’ll constantly be performing trade-off analyses. Sometimes, a single service won’t be the perfect solution to your problem; you’ll need to combine them or even get a bit creative. 🤔&lt;/p&gt;

&lt;p&gt;For me, the most important takeaway from these lessons is the importance of cost in your trade-off analysis — and that, to avoid surprises at the end of the month, you should always keep service pricing in mind.&lt;/p&gt;

&lt;p&gt;Because yes, Transit Gateway can be an excellent option for managing multiple large-scale connections, but it also comes with a considerable cost for each attachment and every gigabyte of processed traffic, while VPC Peering is practically free.&lt;/p&gt;

&lt;p&gt;Likewise, you might lean toward using PrivateLink so your EC2 instances can consume all AWS services through private endpoints, but remember that each endpoint has a fixed cost plus a data processing charge. It might make sense to use it only for services like AWS Secrets Manager or AWS KMS, but not necessarily for Amazon S3 or Amazon CloudWatch, especially if you’re not handling sensitive data.&lt;/p&gt;

&lt;p&gt;One additional comment: as mentioned earlier, Transit Gateway is useful for multiple centralized architecture patterns, one of which is the &lt;em&gt;shared services&lt;/em&gt; pattern. This refers to situations where multiple VPCs need access to a PrivateLink endpoint. In such cases, it might not be the best idea to create the same endpoint in each VPC. Instead, you can implement it in a &lt;em&gt;shared services VPC&lt;/em&gt;, allowing all consumers to access the endpoint from there in a centralized way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Choosing the right private connectivity option in AWS depends on your specific requirements, including the number of VPCs, the need for hybrid connectivity, and the complexity of your network architecture. VPC Peering is ideal for simple, direct connections between a limited number of VPCs. Transit Gateway offers scalability and simplified management for larger, more complex networks. AWS PrivateLink provides secure, private connections to AWS services and other VPCs, especially useful for specific application access without full VPC peering. Understanding these options helps you design a robust, secure, and efficient network architecture on AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;p&gt;In the next section, I’ll include the official resources and documentation for the services mentioned, along with some interesting points about the topics I’ve covered — in case you’re interested in continuing to learn about them or diving deeper to determine whether they truly apply to your use case.&lt;/p&gt;

&lt;p&gt;I also invite you to deploy and test these three services in your own AWS account and let me know in the comments what you thought of them. And if you’re already familiar with them, share in the comments which specific trade-off led you to choose one service over another, or which feature you discovered that completely changed your perception of a particular service. ✍🏻&lt;/p&gt;

&lt;p&gt;You may have heard of &lt;em&gt;Amazon VPC Lattice&lt;/em&gt;, a relatively new service compared to the others mentioned in this article, but one that’s quickly gaining adoption as one of the most modern options for private connectivity in Amazon VPC. I encourage you to check it out — I’ll be testing it soon and writing an article about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html" rel="noopener noreferrer"&gt;What is VPC Peering?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/vpc/pricing/" rel="noopener noreferrer"&gt;Amazon VPC Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html" rel="noopener noreferrer"&gt;What is AWS Transit Gateway?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/transit-gateway/pricing/" rel="noopener noreferrer"&gt;AWS Transit Gateway Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc/latest/privatelink/what-is-privatelink.html" rel="noopener noreferrer"&gt;What is AWS PrivateLink?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/privatelink/pricing/" rel="noopener noreferrer"&gt;AWS PrivateLink Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/vpc-lattice/latest/ug/what-is-vpc-lattice.html" rel="noopener noreferrer"&gt;What is Amazon VPC Lattice?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>english</category>
      <category>aws</category>
      <category>networking</category>
      <category>connectivity</category>
    </item>
  </channel>
</rss>
