Terraform module for commitment management integration with AWS using the nOps platform
- Creation of an S3 bucket and CUR report
- Creation IAM roles with the necessary permissions required by the nOps platform
- Automatic detection of payer and child accounts for correct creation of only necessary resources
- Terraform v1.2+
- AWS CLI configured with appropriate permissions
The below example shows how to add the management (root) AWS account integration:
The CUR report name and bucket name are only required to deploy the module to the Payer account.
- Being authenticated on the Payer account of the AWS organization, add the following code:
provider "aws" {
alias = "root"
}
module cm_onboarding {
providers = {
aws = aws.root
}
source = "nops-io/nops-commitment-management/aws"
# Make sure the bucket name is unique globally, this is a requisite by AWS
cur_bucket_name = "my_cur_bucket"
# CUR report display name
cur_report_name = "my_cur_report"
}
- Initialize Terraform:
terraform init
- Plan and apply the Terraform configuration:
terraform plan -out=plan
terraform apply plan
Onboarding child accounts is performed using the same module, it already contains the logic to react when its being applied on any account that is not root
provider "aws" {
alias = "child"
}
module cm_onboarding {
providers = {
aws = aws.child
}
source = "nops-io/nops-commitment-management/aws"
# No variables are required to deploy this module on child accounts
}
Name | Version |
---|---|
terraform | >= 1.2 |
aws | >= 4.0 |
Name | Version |
---|---|
aws | >= 4.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
cur_bucket_name | The S3 bucket name to be used to setup CUR integration. This name has to be unique globally. | string |
"" |
no |
cur_report_name | Name of the CUR report. | string |
"" |
no |
Name | Description |
---|---|
cur_bucket_arn | The ARN of the CUR S3 bucket |
nops_sharesave_mgt_role_arn | The ARN of the Sharesave Management role |
nops_sharesave_payer_role_arn | The ARN of the Sharesave Payer role |
nops_sharesave_ri_role_arn | The ARN of the Sharesave RI role |