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.
To publish its report when doing a Merge request, Infracost needs to use a Gitlab Token allowing access to the Gitlab API. The token has to be unprotected since it is used in a Merge Request. This is the reason why the main Gitlab repository is in private.
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.