Skip to content

Commit

Permalink
Ability to set custom name for CUR bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clemente committed Oct 1, 2024
1 parent e976cb5 commit 434e6ca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions terraform-modules/cur-setup-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ Type: `string`

The following input variables are optional (have default values):

### cur\_bucket\_name

Description: S3 Bucket name for CUR

Type: `string`

Default: `null`


### cur\_name\_suffix

Description: Suffix used to name the CUR report
Expand Down
4 changes: 4 additions & 0 deletions terraform-modules/cur-setup-source/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ data "aws_caller_identity" "this" {}
data "aws_partition" "this" {}
data "aws_region" "this" {}

locals {
cur_bucket_name = var.cur_bucket_name != null ? var.cur_bucket_name : "${var.resource_prefix}-${data.aws_caller_identity.this.account_id}-local"
}

###
# CUR S3 Bucket
###
Expand Down
6 changes: 6 additions & 0 deletions terraform-modules/cur-setup-source/variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
variable "cur_bucket_name" {
type = string
description = "S3 Bucket name for CUR(optional)"
default = null
}

variable "destination_bucket_arn" {
type = string
description = "Destination Bucket ARN"
Expand Down

0 comments on commit 434e6ca

Please sign in to comment.