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

Transcript

You cannot cut waste you cannot see. Many estates were built by hand, click by click, in a cloud console. That hides servers that are too big, doubled up or forgotten. Nobody can review what was never written down. So the waste stays, and keeps drawing power. Here is the fix you can use today. Describe your 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. Write it down using tools like Terraform or OpenTofu, and check it with Checkov. Then estimate your cloud's energy and emissions, using tools like Cloud Carbon Footprint. GreenCode helps tackle this by mapping a running estate and rebuilding it as code. Then it shows which services use the energy, and which barely run. That was GreenCode Tech Tip number thirty-nine. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #39
  • For Ops and infrastructure
  • Length 1:10
  • Category Cloud and infrastructure
GreenCode

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

Get in touch