Skip to content

Commit

Permalink
docs: add docs for cross account role
Browse files Browse the repository at this point in the history
Add page with instructions on how to setup a cross account role to
support rightsizing.
  • Loading branch information
owenrumney committed Nov 19, 2024
1 parent f9b5769 commit be253b5
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/infracost_cloud/cross_account_role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
slug: cross_account_role
title: Cross account role
---

import useBaseUrl from '@docusaurus/useBaseUrl';

Infracost supports gathering right sizing recommendations for resources in your AWS account by assuming a cross account role. This is allows us to access your AWS resources and provide you with recommendations in your code based on Trusted Advisor and Compute Optimizer data.

:::info
This feature is currently early stage, please email [[email protected]](mailto:[email protected]) for more information.
:::

For more information about cross account roles, please see the [AWS documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html)

## Setup of the cross account role

We have provided a Terraform module to help you set up the cross account role. You can find the module [here](https://github.com/infracost/cross-account-link)

### Prerequisites

- You have an AWS account
- You need your Infracost Cloud organization ID - find this in the settings of the [Infracost Dashboard](https://dashboard.infracost.io)

### Steps

1. Use the module to create the cross account role in your AWS account

```hcl
provider "aws" {
region = "us-west-2"
}
module "infracost" {
source = "github.com/infracost/cross-account-link?ref=0.1.0"
infracost_external_id = "INFRACOST_ORGANIZATION_ID"
providers = {
aws = aws
}
}
output "infracost_cross_account_role_arn" {
value = module.infracost.role_arn
}
```

2. Run `terraform init` and `terraform apply` to create the cross account role
3. Share the `infracost_cross_account_role_arn` output with the Infracost team by email email [[email protected]](mailto:[email protected])

0 comments on commit be253b5

Please sign in to comment.