Skip to main content
Cloud Capital normally provisions the Forecasting role using a CloudFormation template deployed into your AWS management or payer account. If your organization requires that all infrastructure changes go through Terraform, you can create the equivalent IAM role directly — the role’s trust policy, permissions, and function are identical to the CloudFormation version.
This page only covers the Forecasting role (cost, billing, and usage data access). If you haven’t already reviewed how the AWS data integration works, start with Integrate AWS Data first.

What this role does

The Forecasting role is assumed by Cloud Capital’s AWS account to read your Cost and Usage Report (CUR), AWS pricing data, and billing/organization metadata, and to check its own permissions. It cannot purchase commitments and cannot create, modify, or delete your AWS infrastructure. Its only non-read actions are two Cost Explorer jobs — a cost allocation tag backfill and a Savings Plans Purchase Analyzer analysis — neither of which makes a purchase. See What Cloud Capital accesses and Security and access summary for the full breakdown.

Required parameters

Your Terraform configuration needs the following four values:
Find your CloudCapitalExternalId in the Cloud Capital application at app.cloudcapital.co/integrations — it’s labeled Integration ID there. It’s a UUID, e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890.
CostAndUsageBucketName is the S3 bucket you configured when creating your cost data export — see Create a cost data export in AWS if you haven’t set this up yet.

IAM policy JSON

The two policy documents below are extracted directly from Cloud Capital’s Forecasting CloudFormation template. Import or reference them as-is in your Terraform configuration — do not modify the actions, effects, or condition keys.

Trust policy (assume role policy)

This policy allows only Cloud Capital’s AWS account to assume the role, and only when the correct External ID is presented.
trust-policy.json
Replace <param_CloudCapitalExternalId> with your Cloud Capital Integration ID from app.cloudcapital.co/integrations.

Permissions policy

This policy scopes the role to read-only access over cost, billing, pricing, and organization metadata; your specific CUR bucket; two narrowly-scoped Cost Explorer jobs; currently-unused optimization-recommendation reads; and a self-permission check.
permissions-policy.json
Replace both <param_CostAndUsageBucketName> placeholders with the S3 bucket name from your cost data export, and <payer-account-id> with the ID of the AWS account where you deploy this role. The last statement lets the role check its own permissions and nothing else: Cloud Capital uses it to warn you when a permission is missing, before an action fails.

Example Terraform configuration

The following wires the policy documents above together with the required parameters using standard aws_iam_role and aws_iam_role_policy resources.
main.tf
Deploy this into your AWS management or payer account — the same account where your Cost and Usage Report export lives. This is a different account from the dedicated commitment account used by the Optimization role.

Setup

1

Create your cost data export in AWS

If you haven’t already, follow Create a cost data export in AWS to set up a CUR 2.0 export and note the resulting S3 bucket name.
2

Get your Cloud Capital External ID

Sign in to the Cloud Capital application and copy the Integration ID from app.cloudcapital.co/integrations. It’s a UUID, e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890.
3

Apply the Terraform configuration

Add the configuration above to your Terraform codebase, set cloud_capital_external_id and cost_and_usage_bucket_name to the values from the previous steps, and apply it in your management or payer account.
4

Share the Role ARN with Cloud Capital

After apply completes, copy the cloud_capital_forecasting_role_arn output and enter it in the Cloud Capital application where prompted for the Forecasting role ARN, then click Test Role to verify the connection.
If Cloud Capital will also be managing AWS Savings Plans and Reserved Instances on your behalf, a second, separate role is required. See Terraform Setup for the Optimization Role.