Skip to content

Commit

Permalink
add import_table configs to autoscaled resource
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenbaum committed Oct 26, 2023
1 parent 30a1a1b commit 20994eb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,37 @@ resource "aws_dynamodb_table" "autoscaled" {
kms_key_arn = var.server_side_encryption_kms_key_arn
}

dynamic "import_table" {
for_each = length(var.import_table) > 0 ? [var.import_table] : []

content {
input_format = import_table.value.input_format
input_compression_type = try(import_table.value.input_compression_type, null)

dynamic "input_format_options" {
for_each = import_table.value.input_format == "CSV" ? try([import_table.value.input_format_options], []) : []

content {

dynamic "csv" {
for_each = try([input_format_options.value.csv], [])

content {
delimiter = try(csv.value.delimiter, null)
header_list = try(csv.value.header_list, null)
}
}
}
}

s3_bucket_source {
bucket = import_table.value.bucket
bucket_owner = try(import_table.value.bucket_owner, null)
key_prefix = try(import_table.value.key_prefix, null)
}
}
}

tags = merge(
var.tags,
{
Expand Down

0 comments on commit 20994eb

Please sign in to comment.