Does Infracost need my AWS credentials?
Infracost itself does not need any AWS credentials, but Infracost uses your existing
terraform binary to execute
terraform init and
terraform plan to produce plan JSON files. This process requires Terraform to have access to your cloud credentials. The Terraform commands used by Infracost do not make any changes to your Terraform state or cloud resources,
How does Infracost get its prices?
Infracost gets its prices from a pricing API. These prices are continually updated with the latest AWS prices.
We offer a free hosted pricing API. There is also the option of running your own pricing API and configuring your infracost installation to point to it.
What data is sent to the hosted pricing API?
The pricing API needs the relevant data to return a unique AWS price point. The count of Terraform resource types is also sent to the pricing API to enable us to better prioritize adding new resources. No cloud credentials, secrets, tags or Terraform resource identifiers are sent to the pricing API.
Here is an example request to the pricing API for a t3.micro instance and the returned response: