Skip to content
~/caio.barilli
ENPT
← All projects
DevOps / IaC

AWS platform with Terraform

AWS infrastructure for AgroNegociar's news portal, in production and staging, built from scratch with Terraform.

Year
2022–2025
Type
Client project · AgroNegociar
Status
Delivered
years of project
3
environments: production and staging
2
automatic backup every week
1×

01 · Problem

AgroNegociar had an app for agribusiness and needed a gateway for new customers. The strategy was to build a community: a news portal and a social network where producers, companies and readers from the sector meet, read content and find their way to the app. For that to work, the site had to be complete, fast on any screen and easy for the client's team to manage, and the infrastructure had to be reliable, with no risk of losing content.

02 · Solution

The portal and the social network were built on a complete community WordPress theme, with a child theme carrying the project's identity and a fully responsive layout. Pages were built in Elementor. The social network runs on the big community plugins integrated with the theme, BuddyPress and bbPress, and on top of them we developed several custom plugins: tools for the administrators and layout components the theme did not offer. On the infrastructure side, everything is versioned as code with Terraform: an Ubuntu server on AWS with the site on a separate disk, remote, encrypted state in S3, and identical production and staging environments. Every week an automatic backup of the database and the theme goes to a bucket. Since everything else is rebuilt from code, the whole environment can be recreated without losses. DNS and SSL run on Cloudflare, and the server is managed with WordOps.

03 · Features

Portal and social network

  • News, profiles and interaction between users, as a gateway to the app

Community plugins

  • BuddyPress for the social network: profiles, groups, activity feed, messages, friendships and verified accounts
  • bbPress for the forum
  • Both integrated with the theme and with Elementor

Custom WordPress

  • Child theme over a community theme, pages in Elementor and a responsive layout on any screen

Custom plugins

  • Administration tools and layout components built for the project

Infrastructure as code

  • EC2 Ubuntu 24.04 with an always-current AMI, Elastic IP, security group and a persistent EBS disk mounted automatically

Backup and recovery

  • Database and theme saved to a bucket every week, and everything else rebuilt from code without losses

Reliable environments

  • Production and staging from the same code, with remote, encrypted state in S3

Publishing

  • Cloudflare for DNS and SSL, and WordOps on the server

04 · Stack

  • Terraform
  • AWS EC2
  • EBS
  • S3
  • Cloudflare
  • WordOps
  • Bash
  • WordPress
  • BuddyPress
  • bbPress
  • Elementor
  • PHP

05 · Architecture decisions

The decisions that shaped the project.
  1. —

    Start from a complete theme

    The theme already brought the community base, so the effort went into what was unique to the business.

  2. —

    Logic in plugins

    Rules and components live in custom plugins, separate from the look, which makes them easier to evolve and update.

  3. —

    Everything rebuildable

    Only the database and the theme need a backup, because everything else comes from code.

  4. —

    Remote state in S3

    Terraform state lives in an encrypted S3 bucket, so any machine with the repository can update the environment.

06 · Screenshots

Sanitised architecture diagram

07 · Links

Source is privateTerraform template on GitHub ↗No public demo
Next projectNext.js Tailwind Store →
Diagram of the production and staging environments on AWS
Sanitised architecture diagram