env zero will assume an AWS IAM Role in your account to query AWS’s billing API.Documentation Index
Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
Use this file to discover all available pages before exploring further.
Read more about cross account role delegation. To begin, log in to your AWS Console, and select the Identity and Access Management (IAM) service.
Create an AWS IAM Policy
- Click on Policies -> Create Policy
- Select the Cost Explorer Service
- Select the
GetCostAndUsageAction - Choose a name for your policy and save it.
Create an AWS IAM Role
- Click on Roles -> Create Role
- Under type of trusted entity select
Another AWS Account - Under Account ID enter
913128560467 - Select
**Require external ID** - Enter an External ID. The value Must be equal to your organization ID.
- Click Next:Permissions
- Select the policy you created in step 2.
- Click Next:Tags
- Click Next:Review
- Enter a name for the role, and click Create Role
- Click on the Role you just created - We will need the
Role ARNin subsequent steps.
Adding your Cost Role via IaC
CloudFormation (yaml)
OpenTofu/Terraform (hcl)
Enable User Defined Cost Allocation Tags
- Add the Tags called
env0_environment_idandenv0_project_idto some resource in your AWS account - Make sure that you add those tags to a resource that has some cost to it, for example an EC2 instance. - Go to the “Billing” Service (Billing & Cost Management). You’ll need to log into to the parent account, if you are using sub-accounts.
- Under the left side menu, click Cost allocation tags.
- Under the User-Defined Cost Allocation Tags section, check the checkboxes for the tag-keys
env0_environment_idandenv0_project_id. Pay attention that those tags might be available in Cost Allocation Tags only after a few days, usually it’s 24 hours but we’ve seen cases where it took a week for them to show up. - Click Activate

NoteAfter this step, it can take up to 24 hours to see actual cost values in your environments.
Enable Hourly and Resource Level Data
- Go to the “Billing” Service (Billing & Cost Management). You’ll need to log into to the parent account, if you are using sub-accounts.
- Under the left side menu, click Cost Explorer.
- Click on the Launch Cost Explorer button.
- In the Cost Explorer page on the left side menu click on Preferences.
- Under the Hourly and Resource Level Data enable the Hourly and Resource Level Data checkbox and save the changes.
Add Credentials to your Organization
- Under your Organization Settings, Select the Credentials tab
- Under Cost Credentials, click Add Credential
- Select the AWS Assumed Role type, and enter the
Role ARNfrom the previous step. The External ID cannot be edited. - Click Add
- Re-run the environments to apply the necessary tags.

Enable cost monitoring
- Go to the** Project Settings** of the desired project.
- Select the Credentials tab.
- Check the appropriate cloud provider checkbox, and select the credential you created in the steps above.
- Click Save.
Next steps
- Set Cost Monitoring - Enable cost tracking after adding credentials.
- Set Budget Notifications - Get alerted when project spending crosses a limit.
- Cloud Analyst - Explore AI-powered cost insights across your organization.