AWS-EIOS · Richard Pineda
Built by AI Solutions Architect Claude Code GitHub Actions Terraform AWS
The architecture map

AWS-EIOS · Infrastructure as code

AWS-EIOS: the Terraform that builds the AWS environment EIOS runs in.

Half of it stays on; the other half exists only for a demo and is destroyed after it. Nothing is applied by hand.

Terraform governed by ACE · every piece below is a real component · click any piece for the details

Click or tap any piece to see what it does, in plain words. The pulses show how the work moves.

TWO HALVES, ONE REASON: COST Permanent half ABOUT 1.5 USD A MONTH KMS key one key encrypts everything · never destroyed ECR private image registry S3 bucket the web app, private, reached only through CloudFront CloudFront one entry point, two origins Secret container for the AI key, seeded by the owner 2 CI identities push images · publish the web app Ephemeral half ABOUT 0.10 USD AN HOUR VPC 3 layers across 2 zones, one NAT RDS PostgreSQL 16 private, encrypted, no public access ECS Fargate the API and the bootstrap task ALB accepts only the secret header WAF rate limit and 2 managed rule sets Secrets and logs containers only, plus flow logs bind unbind HOW A CHANGE REACHES AWS Pull request
A change to the Terraform is proposed. Nothing is applied yet.
Plan and checks
Format, validation, lint, security scans, the plan with secrets hidden, and a cost estimate.
ACE gate
The gate reads the real plan, derives its risk class and must pass.
Written OK
The owner approves in writing in the pull request, before the merge.
Merge applies
A merge touching the ephemeral half applies it from CI. The permanent half is a manual launch.
Destroy
Manual, from main, with a typed confirmation. It refuses while CloudFront is still bound.
NOBODY APPLIES FROM A WORKSTATION SHORT-LIVED CREDENTIALS (OIDC) WHO CAN DO WHAT Four CI identities
Plan is read-only. Deploy is limited to main. Image push and web publish are separate. Each permission is narrowed with CloudTrail evidence.
Four database identities
Master only to bootstrap, a login-less owner, a migration owner and an app that can only read and write rows. So row security means something.
Closed network
API in private subnets with no public address. Database with no route out. Security groups talk to each other only. The ALB accepts one secret header.
Secrets
Terraform creates only the empty containers. The owner seeds the values by script. The plan saved for apply is redacted and kept one day.
DECISIONS AND PROOF 7 decisions, each with its reason 0001 Fargate for the backend, not Lambda 0002 One CloudFront with two origins 0003 Own PostgreSQL, not a hosted one 0004 Four separate database identities 0005 Three subnet layers, one NAT 0006 Cost center is a placeholder 0007 Permanent and ephemeral split Proof 15
rows of the build checklist, each applied, verified and destroyed
After every destroy the state is empty and the temporary resources are gone.
built destroyed limit component
DOS MITADES, UNA RAZÓN: EL COSTO Mitad permanente UNOS 1,5 USD AL MES KMS key una llave cifra todo · nunca se destruye ECR registro privado de imágenes S3 bucket la app web, privada, solo accesible por CloudFront CloudFront una sola entrada, dos orígenes Contenedor de secreto para la llave de la IA, la siembra el dueño 2 identidades de CI subir imágenes · publicar la app web Mitad efímera UNOS 0,10 USD POR HORA VPC 3 capas en 2 zonas, una sola NAT RDS PostgreSQL 16 privada, cifrada, sin acceso público ECS Fargate la API y la tarea de arranque ALB solo acepta el encabezado secreto WAF límite de tasa y 2 conjuntos de reglas gestionadas Secretos y registros solo contenedores, más registros de red enlazar desenlazar CÓMO LLEGA UN CAMBIO A AWS Pull request
Se propone un cambio al Terraform. Todavía no se aplica nada.
Plan y comprobaciones
Formato, validación, lint, escaneos de seguridad, el plan con secretos ocultos y una estimación de costo.
Gate de ACE
El gate lee el plan real, deriva su clase de riesgo y debe aprobar.
OK escrito
El dueño aprueba por escrito en el pull request, antes del merge.
El merge aplica
Un merge que toca la mitad efímera la aplica desde CI. La permanente se lanza a mano.
Destruir
Manual, desde main, con una confirmación escrita. Se niega mientras CloudFront siga enlazada.
NADIE APLICA DESDE UN COMPUTADOR CREDENCIALES DE CORTA VIDA (OIDC) QUIÉN PUEDE HACER QUÉ Cuatro identidades de CI
El plan es de solo lectura. El despliegue se limita a main. Subir imágenes y publicar la web van separados. Cada permiso se acota con evidencia de CloudTrail.
Cuatro identidades de base de datos
El maestro solo para arrancar, un dueño sin ingreso, un dueño de migraciones y una app que solo lee y escribe filas. Así la seguridad por fila significa algo.
Red cerrada
API en subredes privadas sin dirección pública. Base de datos sin ruta hacia afuera. Los grupos de seguridad solo se hablan entre sí. El ALB acepta un encabezado secreto.
Secretos
Terraform crea solo los contenedores vacíos. El dueño siembra los valores con un script. El plan guardado para aplicar va redactado y se conserva un día.
DECISIONES Y PRUEBA 7 decisiones, cada una con su razón 0001 Fargate para el backend, no Lambda 0002 Una CloudFront con dos orígenes 0003 PostgreSQL propio, no uno alojado 0004 Cuatro identidades de base de datos separadas 0005 Tres capas de subredes, una NAT 0006 El centro de costo es un marcador 0007 División permanente y efímera Prueba 15
filas de la lista de construcción, cada una aplicada, verificada y destruida
Después de cada destrucción el estado queda vacío y los recursos temporales desaparecen.
construido destruido límite componente