env0 will assume an AWS IAM Role in your account, in order to query AWS's billing API.
Read more about cross account role delegation.
To begin, log in to your AWS Console, and select the Identity and Access Management (IAM) service.
- Click on Policies -> Create Policy
- Select the Cost Explorer Service
- Select the
- Choose a name for your policy and save it.
- Click on Roles -> Create Role
- Under type of trusted entity select
Another AWS Account
- Under Account ID enter
**Require external ID**
- Enter an External ID of your choosing - consider this like a password env0 will use in order to assume the role.
- Click Next:Permissions
- Select the policy you created in step 2.
- Click Next:Tags
- Add the Key
env0_environment_idand the Key
env0_project_id. Values are not needed.
- 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 ARNand the
External IDin subsequent steps.
- 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
- Click Activate
- After this step, it can take up to 24 hours to see actual cost values in your environments.
- Under your Organization Settings, Select the Credentials tab
- Under Cost Credentials, click Add Credential
- Select the AWS Assumed Role type, and enter the
External IDfrom the previous step.
- Click Add
Updated 3 months ago