Skip to content

Commit

Permalink
fix: Better TF formating when dynamodb_table is empty when creating b…
Browse files Browse the repository at this point in the history
…ackend template file (#149)
  • Loading branch information
SMontiel authored Nov 10, 2023
1 parent ac43e7b commit 9058aa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ data "aws_iam_policy_document" "aggregated_policy" {
override_policy_documents = var.source_policy_documents
}


data "aws_iam_policy_document" "bucket_policy" {
count = local.enabled ? 1 : 0

Expand Down
13 changes: 7 additions & 6 deletions templates/terraform.tf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ terraform {
required_version = ">= ${terraform_version}"
backend "s3" {
region = "${region}"
bucket = "${bucket}"
key = "${terraform_state_file}"
region = "${region}"
bucket = "${bucket}"
key = "${terraform_state_file}"
profile = "${profile}"
role_arn = "${role_arn}"
encrypt = "${encrypt}"
%{~ if dynamodb_table != "" ~}
dynamodb_table = "${dynamodb_table}"
%{~ endif ~}
profile = "${profile}"
role_arn = "${role_arn}"
encrypt = "${encrypt}"
}
}

0 comments on commit 9058aa1

Please sign in to comment.