Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT MERGE: docs: add docs for cross account role #680

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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])
Loading