Tech Tip #39: Put your infrastructure in code

You can't cut waste you can't see.

Video created by explainapaper.com

The problem

An estate built by hand in consoles hides oversized, duplicated and forgotten resources. Nobody can review what is not written down.

The fix you can use today

  • Describe the estate as infrastructure as code, one reviewed source of truth.
  • Review it like application code: look for idle, oversized and duplicated resources.
  • Add policy checks that flag oversized or untagged resources before they deploy.

GreenCode researchers found that infrastructure written as code is easier to check, shrink and rebuild.

Tools that help

  • Terraform / OpenTofu: declarative infrastructure as code: the whole estate written down, reviewable and versioned
  • Checkov: policy-as-code checks on infrastructure definitions before they are deployed
  • Cloud Carbon Footprint: estimates the energy and emissions of AWS, Azure and Google Cloud usage from billing and usage data

How GreenCode helps

GreenCode helps tackle this by mining a running estate and rebuilding it as infrastructure as code. It then attributes energy and CO2e to the services that cause it, including services that barely run at all. More on this.

Tags

#iac#cloud

Sources

All GreenCode Tech Tips

  • Tip #39
  • For Ops and infrastructure
  • Category Cloud and infrastructure
  • Format short video
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch