Skip to content

Commit 7039328

Browse files
FEATURE ASH-56: Support Split Cost Allocation Data in CUR (#45)
1 parent 570d9a3 commit 7039328

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ terraform {
7272
}
7373
```
7474

75+
### Split Cost Allocation Data
76+
77+
The module supports the [Split Cost Allocation Data](https://aws.amazon.com/blogs/aws-cloud-financial-management/improve-cost-visibility-of-amazon-eks-with-aws-split-cost-allocation-data/) opt-in feature of the Cost and Usage Report, which provides more granular data for ECS/EKS usage. Please note that this feature may increase your costs slightly due to a larger volume of usage data generated.
78+
79+
To enable this feature:
80+
1. Opt in to Split Cost Allocation Data in the [Cost Management Preferences](https://us-east-1.console.aws.amazon.com/costmanagement/home?region=eu-west-1#/settings) page of the AWS Console (Step 1 of the guide above).
81+
2. Set the `cur_report_split_cost_data = true` variable on this module.
82+
7583
<!-- markdownlint-disable -->
7684
<!-- BEGIN_TF_DOCS -->
7785
## Requirements
@@ -99,6 +107,7 @@ No providers.
99107
| <a name="input_cur_report_enabled"></a> [cur\_report\_enabled](#input\_cur\_report\_enabled) | Whether to enable the module that creates S3 bucket for Cost Usage Report data. | `bool` | no |
100108
| <a name="input_cur_report_name"></a> [cur\_report\_name](#input\_cur\_report\_name) | The name of the CUR report for Vertice. | `string` | no |
101109
| <a name="input_cur_report_s3_prefix"></a> [cur\_report\_s3\_prefix](#input\_cur\_report\_s3\_prefix) | The prefix for the S3 bucket path to where the CUR data will be saved. | `string` | no |
110+
| <a name="input_cur_report_split_cost_data"></a> [cur\_report\_split\_cost\_data](#input\_cur\_report\_split\_cost\_data) | Enable Split Cost Allocation Data inclusion in CUR. Note that manual opt-in is needed in AWS Console. | `bool` | no |
102111
| <a name="input_governance_role_additional_policy_json"></a> [governance\_role\_additional\_policy\_json](#input\_governance\_role\_additional\_policy\_json) | Custom additional policy in JSON format to attach to VerticeGovernance role. Default is null for no additional policy. | `string` | no |
103112
| <a name="input_governance_role_enabled"></a> [governance\_role\_enabled](#input\_governance\_role\_enabled) | Whether to enable the module that creates VerticeGovernance role for the Cloud Cost Optimization. | `bool` | no |
104113
| <a name="input_governance_role_external_id"></a> [governance\_role\_external\_id](#input\_governance\_role\_external\_id) | STS external ID value to require for assuming the governance role. Required if the governance IAM role is to be created. You will receive this from Vertice. | `string` | no |

main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module "vertice_cur_report" {
2828
cur_report_bucket_name = var.cur_bucket_name
2929
cur_report_s3_prefix = var.cur_report_s3_prefix
3030

31+
cur_report_split_cost_data = var.cur_report_split_cost_data
32+
3133
## CUR report is currently available only in the us-east-1 region
3234
providers = {
3335
aws = aws

modules/vertice-cur-report/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Sub-module responsible for the creation of an AWS Cost and Usage Report (CUR).
1414

1515
| Name | Version |
1616
|------|---------|
17-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.64.0 |
18-
| <a name="provider_aws.us-east-1"></a> [aws.us-east-1](#provider\_aws.us-east-1) | >= 4.64.0 |
17+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.41.0 |
18+
| <a name="provider_aws.us-east-1"></a> [aws.us-east-1](#provider\_aws.us-east-1) | 5.41.0 |
1919

2020
## Modules
2121

@@ -35,6 +35,7 @@ No modules.
3535
| <a name="input_cur_report_bucket_name"></a> [cur\_report\_bucket\_name](#input\_cur\_report\_bucket\_name) | The name of the bucket which will be used to store the CUR data for Vertice. | `string` | n/a | yes |
3636
| <a name="input_cur_report_name"></a> [cur\_report\_name](#input\_cur\_report\_name) | The name of the CUR report for Vertice. | `string` | `"vertice-cur-report"` | no |
3737
| <a name="input_cur_report_s3_prefix"></a> [cur\_report\_s3\_prefix](#input\_cur\_report\_s3\_prefix) | The prefix for the S3 bucket path to where the CUR data will be saved. | `string` | n/a | yes |
38+
| <a name="input_cur_report_split_cost_data"></a> [cur\_report\_split\_cost\_data](#input\_cur\_report\_split\_cost\_data) | Enable Split Cost Allocation Data inclusion in CUR. Note that manual opt-in is needed in AWS Console. | `bool` | `false` | no |
3839

3940
## Outputs
4041

modules/vertice-cur-report/main.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ resource "aws_cur_report_definition" "vertice_cur_report" {
99
format = "Parquet"
1010
compression = "Parquet"
1111

12-
additional_schema_elements = [
13-
"RESOURCES",
14-
]
12+
additional_schema_elements = concat(
13+
["RESOURCES"],
14+
var.cur_report_split_cost_data ? ["SPLIT_COST_ALLOCATION_DATA"] : [],
15+
)
1516

1617
s3_bucket = data.aws_s3_bucket.vertice_cur_bucket.bucket
1718
s3_region = data.aws_s3_bucket.vertice_cur_bucket.region

modules/vertice-cur-report/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ variable "cur_report_s3_prefix" {
1414
type = string
1515
description = "The prefix for the S3 bucket path to where the CUR data will be saved."
1616
}
17+
18+
variable "cur_report_split_cost_data" {
19+
type = bool
20+
description = "Enable Split Cost Allocation Data inclusion in CUR. Note that manual opt-in is needed in AWS Console."
21+
default = false
22+
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,9 @@ variable "cur_report_s3_prefix" {
107107
description = "The prefix for the S3 bucket path to where the CUR data will be saved."
108108
default = "cur"
109109
}
110+
111+
variable "cur_report_split_cost_data" {
112+
type = bool
113+
description = "Enable Split Cost Allocation Data inclusion in CUR. Note that manual opt-in is needed in AWS Console."
114+
default = false
115+
}

0 commit comments

Comments
 (0)