Infracost

Infracost is a FinOps tool that allows you to preview infrastructure costs before deploying it. The tool automatically calculates the cost of each resource deployed in the cloud, then announces the new cost and compares it to the old cost.

Infracost must be used before the infrastructure is created: in our case, it must be used in the Dev environment hence during a Merge Request.

Infracost is installed directly in the Gitlab CI pipeline: we create a job specifically for Infracost, in which we fill in the Gitlab Token that Infracost will use to publish its report.

Here is the report that was generated and published in the Merge Request by Infracost when the EC2 t4g.small instances used by the EKS Node Group were replaced by EC2 t3a.small instances:

Infracost Report