Pulumi cost estimation CLI for consistent cost estimation in your CI/CD pipeline
This tool ensures consistent cloud infrastructure cost estimation in your release pipeline running Pulumi infrastructure code before deploying resources. Get cost estimates for your infrastructure changes before they hit production.
- 🚀 Installation & Quick Start
- 🔌 Public API curl example
- 🏗️ Supported IaC Frameworks
- ☁️ Supported Cloud Resources
- .NET 10 or later - (Required for local CLI execution only)
- Valid Cloudcostify API key
Install the published prerelease globally:
dotnet tool install --global Cloudcostify.Cli --version 1.0.0-beta1 --prereleaseUpdate an existing installation:
dotnet tool update --global Cloudcostify.Cli --version 1.0.0-beta1 --prereleaseRun the tool:
cloudcostify- name: Cloudcostify Budget Guard
uses: Cloudcostify/github-action@v1.0.0-beta
env:
CLOUDCOSTIFY_API_KEY: ${{ secrets.CLOUDCOSTIFY_API_KEY }}
CLOUDCOSTIFY_PULUMI_PROJECT_STACK_NAME: ${{ secrets.STACK_NAME }}
CLOUDCOSTIFY_PULUMI_PROJECT_DIRECTORY_PATH: ./infrastructure
PulumiProjectName: ${{ secrets.PROJECT_NAME }}Set the following environment variables:
| Variable | Description | Required |
|---|---|---|
CLOUDCOSTIFY_API_KEY |
Your API subscription key | Yes |
CLOUDCOSTIFY_PULUMI_PROJECT_STACK_NAME |
Pulumi stack name (e.g., "dev") | Yes |
CLOUDCOSTIFY_PULUMI_PROJECT_DIRECTORY_PATH |
Path to Pulumi project | Yes |
PulumiProjectName |
Pulumi project name | Yes |
Example (PowerShell):
$env:CLOUDCOSTIFY_API_KEY = "your-api-key"
$env:CLOUDCOSTIFY_PULUMI_PROJECT_STACK_NAME = "dev"
$env:CLOUDCOSTIFY_PULUMI_PROJECT_DIRECTORY_PATH = "./infrastructure"
$env:PulumiProjectName = "MyProject"Example (Bash):
export CLOUDCOSTIFY_API_KEY="your-api-key"
export CLOUDCOSTIFY_PULUMI_PROJECT_STACK_NAME="dev"
export CLOUDCOSTIFY_PULUMI_PROJECT_DIRECTORY_PATH="./infrastructure"
export PulumiProjectName="MyProject"Send a Pulumi preview directly to POST https://api.cloudcostify.io/costestimation/costestimate. Create an API key in the dashboard and send it in the X-API-Key header.
Save this request body as request.json:
{
"steps": [
{
"op": "create",
"urn": "res-compute-virtualmachine-01",
"newState": {
"urn": "res-compute-virtualmachine-01",
"type": "azure-native:compute:VirtualMachine",
"inputs": {
"location": "westeurope",
"vmName": "[redacted]",
"resourceGroupName": "[redacted]",
"hardwareProfile": {
"vmSize": "Standard_D2s_v3"
},
"osProfile": {
"linuxConfiguration": {}
}
}
}
}
]
}Replace YOUR_API_KEY with your dashboard key:
curl --request POST "https://api.cloudcostify.io/costestimation/costestimate" --header "X-API-Key: YOUR_API_KEY" --header "Content-Type: application/json" --data-binary "@request.json"In Windows PowerShell, run the same command with curl.exe instead of curl.
An HTTP 200 response looks like this (selected fields shown; prices are illustrative and vary with current Azure pricing):
{
"currency": "USD",
"cloudProvider": "Azure",
"aggregateCosts": {
"perHour": 0.10,
"perMonth": 73.00
},
"cloudResources": [
{
"virtualMachines": [
{
"name": "[redacted]",
"location": "westeurope",
"virtualMachineSku": {
"sku": "Standard_D2s_v3",
"price": 0.10,
"priceUnit": "PerHour",
"os": "Linux"
},
"aggregateVirtualMachineCosts": {
"perHour": 0.10,
"perMonth": 73.00
}
}
]
}
]
}The API also accepts Pulumi stack exports with resources in deployment.resources. Remove resource names, credentials, and other sensitive values before sending JSON directly; the CLI sanitizes its payload when you use the CLI instead.
We only transmit an anonymous list of resource types and quantities (e.g., '1x Standard_D2_v2 VM, 1x AKS Cluster') required to calculate the cost. Your source code, variables, and cloud credentials never leave your infrastructure. You can verify this by reviewing the CLI and GitHub Action source code on GitHub.
We take security and privacy seriously. For any security concerns, please contact us at mailto:hello@cloudcostify.io.
We love contributions! Please see CONTRIBUTING.md for details on:
- Setting up your development environment
- Code style guidelines
- Submitting pull requests
- Reporting bugs
- Requesting features
This project is licensed under a custom license - see the LICENSE file for details.
TL;DR: Free to use, fork, and modify for personal and commercial projects. Cannot be sold as a standalone product.
If you encounter issues or have questions:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Contact: mailto:hello@cloudcostify.io
Engineered with purpose by the Cloudcostify team