Skip to main content
The AWS connect wizard offers two Terraform options next to CloudFormation and Manual IAM. Both create the same resources in your payer account as the CloudFormation stack: the S3 bucket for your Cost and Usage Report, the Legacy CUR export, an optional CUR 2.0 export, the IAM policies for your permission level, and the cross-account IAM role.
Who can do this: Only Admin users in your nOps organization can connect AWS or create an onboarding key. See Users and roles.
This page covers Savings Analysis and Full Platform access. Commitment Management is set up separately. See AWS Commitment Management setup.

Prerequisites

  • Terraform 1.6 or later, with credentials for your AWS payer (management) account. Child and member accounts are not supported.
  • Permission to create IAM policies and roles, S3 buckets, and Cost and Usage Report exports in that account.
  • Cost Explorer turned on in the payer account. See Turn on Cost Explorer in your payer account.
  • Optional: an existing S3 bucket in us-east-1 for the CUR. AWS only offers CUR exports in us-east-1. An existing bucket is never changed, so its bucket policy must already allow billingreports.amazonaws.com and bcm-data-exports.amazonaws.com to write to it.

Terraform module

1

Choose the setup method

Open Connect Amazon Web Services from Settings > Cloud Provider Integrations and choose Terraform module.
2

Enter your account

Enter the 12-digit Payer AWS Account ID and an Integration name, then click Next.
3

Name the CUR bucket and exports

Enter the S3 bucket name and export names, or select Use a bucket I already have in us-east-1. Choose Savings Analysis or Full Platform as the permission level. The wizard shows a Terraform configuration with your values and the ExternalId filled in.
4

Apply the configuration

Copy the configuration into your Terraform project and run:
5

Paste the role ARN

Run terraform output -raw role_arn, paste the value into Role ARN in the wizard, then run verification.

Terraform, full setup

In this option, Terraform registers the account with nOps itself. It uses an onboarding key you create in the wizard. The key can only register new AWS accounts. It cannot read, change, or delete anything in nOps.
1

Choose the setup method

Open Connect Amazon Web Services from Settings > Cloud Provider Integrations and choose Terraform, full setup.
2

Enter your account

Enter the 12-digit Payer AWS Account ID and an Integration name, then click Next.
3

Name the CUR bucket and exports

Enter the S3 bucket name and export names, or select Use a bucket I already have in us-east-1. Choose Savings Analysis or Full Platform as the permission level.
4

Create the onboarding key

Click Create API key. The key is shown once. Copy the export command and run it in the shell where you will run Terraform:
The key is never written to the generated files. If you lose it, revoke it in the wizard and create another.
5

Download the files

Save each file into a new, empty directory:
6

Apply

In that directory, with CLARA_API_KEY exported, run:
Keep the wizard open. The Apply step updates when nOps receives the registration and shows the result. Click Done once it shows Connected.

What the result means

After onboarding

  • Revoke the key when you are done. You can revoke it in the wizard, and it is no longer needed once the account is registered.
  • Re-running the same configuration is safe. Terraform already has the resources in its state, so terraform apply changes nothing.
  • Registration is create-only. To change the integration later, or to disconnect it, use Settings in nOps. terraform destroy removes the AWS resources but leaves the integration in nOps.

Troubleshooting

The account already has resources with the same names, for example from the CloudFormation stack or from another Terraform state. The module does not adopt or overwrite them, and nothing is registered with nOps. Remove the existing stack, or import the resources into your state, then apply again.
Cost Explorer has not been turned on in the payer account. See Turn on Cost Explorer in your payer account, then verify again from Settings.
The bucket must be in us-east-1. Use a bucket in that region, or let the module create one.
For the policies and role the configuration creates, see Permissions & Resources.