Skip to content

Commit

Permalink
Fix data storage location (cloudera-labs#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <[email protected]>
  • Loading branch information
jimright authored and dennaloh committed Jan 20, 2025
1 parent 6f39489 commit 7405e86
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/terraform-cdp-aws-pre-reqs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ resource "random_id" "bucket_suffix" {

resource "aws_s3_bucket" "cdp_storage_locations" {
# Create buckets for the unique list of buckets in data and log storage
for_each = toset(concat([local.data_storage.data_storage_bucket], [local.log_storage.log_storage_bucket]))
for_each = toset(concat([local.data_storage.data_storage_bucket], [local.log_storage.log_storage_bucket], [local.backup_storage.backup_storage_bucket]))

bucket = "${each.value}${local.storage_suffix}"
tags = merge(local.env_tags, { Name = "${each.value}${local.storage_suffix}" })
Expand All @@ -138,9 +138,9 @@ resource "aws_s3_bucket" "cdp_storage_locations" {
# Data Storage Objects
resource "aws_s3_object" "cdp_data_storage_object" {

bucket = var.random_id_for_bucket ? "${local.data_storage.data_storage_bucket}-${one(random_id.bucket_suffix).hex}" : local.data_storage.data_storage_bucket
bucket = "${local.data_storage.data_storage_bucket}${local.storage_suffix}"

key = local.backup_storage.backup_storage_object
key = local.data_storage.data_storage_object
content_type = "application/x-directory"

depends_on = [
Expand All @@ -151,7 +151,7 @@ resource "aws_s3_object" "cdp_data_storage_object" {
# Log Storage Objects
resource "aws_s3_object" "cdp_log_storage_object" {

bucket = var.random_id_for_bucket ? "${local.log_storage.log_storage_bucket}-${one(random_id.bucket_suffix).hex}" : local.log_storage.log_storage_bucket
bucket = "${local.log_storage.log_storage_bucket}${local.storage_suffix}"

key = local.log_storage.log_storage_object
content_type = "application/x-directory"
Expand All @@ -164,7 +164,7 @@ resource "aws_s3_object" "cdp_log_storage_object" {
# Backup Storage Object
resource "aws_s3_object" "cdp_backup_storage_object" {

bucket = var.random_id_for_bucket ? "${local.backup_storage.backup_storage_bucket}-${one(random_id.bucket_suffix).hex}" : local.backup_storage.backup_storage_bucket
bucket = "${local.backup_storage.backup_storage_bucket}${local.storage_suffix}"

key = local.backup_storage.backup_storage_object
content_type = "application/x-directory"
Expand Down

0 comments on commit 7405e86

Please sign in to comment.