Skip to content

Commit 33c1aad

Browse files
authored
Revert 0.19.0 (#56)
## what * Reverts the updates from #53 as they were no good. ## why * Using the flag to not write the back config file causes terraform to believe the file should be destroyed since it was no longer tracked as a resource. That approach just generally won't work. ## references * Reverts #53
1 parent 6866a42 commit 33c1aad

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ Available targets:
217217
| additional\_tag\_map | Additional tags for appending to each tag map | `map(string)` | `{}` | no |
218218
| arn\_format | ARN format to be used. May be changed to support deployment in GovCloud/China regions. | `string` | `"arn:aws"` | no |
219219
| attributes | Additional attributes (e.g. `state`) | `list(string)` | <pre>[<br> "state"<br>]</pre> | no |
220-
| backend\_config\_file\_overwrite\_enabled | If false, the backend config file will not be overwritten if it exists. | `bool` | `true` | no |
221220
| billing\_mode | DynamoDB billing mode | `string` | `"PROVISIONED"` | no |
222221
| block\_public\_acls | Whether Amazon S3 should block public ACLs for this bucket | `bool` | `true` | no |
223222
| block\_public\_policy | Whether Amazon S3 should block public bucket policies for this bucket | `bool` | `true` | no |

docs/terraform.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
| additional\_tag\_map | Additional tags for appending to each tag map | `map(string)` | `{}` | no |
2525
| arn\_format | ARN format to be used. May be changed to support deployment in GovCloud/China regions. | `string` | `"arn:aws"` | no |
2626
| attributes | Additional attributes (e.g. `state`) | `list(string)` | <pre>[<br> "state"<br>]</pre> | no |
27-
| backend\_config\_file\_overwrite\_enabled | If false, the backend config file will not be overwritten if it exists. | `bool` | `true` | no |
2827
| billing\_mode | DynamoDB billing mode | `string` | `"PROVISIONED"` | no |
2928
| block\_public\_acls | Whether Amazon S3 should block public ACLs for this bucket | `bool` | `true` | no |
3029
| block\_public\_policy | Whether Amazon S3 should block public bucket policies for this bucket | `bool` | `true` | no |

main.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ locals {
1414

1515
terraform_backend_config_template_file = var.terraform_backend_config_template_file != "" ? var.terraform_backend_config_template_file : "${path.module}/templates/terraform.tf.tpl"
1616

17-
terraform_backend_config_file_exists = fileexists(local.terraform_backend_config_file)
18-
19-
overwrite_backend_config_file = (! local.terraform_backend_config_file_exists || var.backend_config_file_overwrite_enabled) && var.terraform_backend_config_file_path != ""
20-
2117
bucket_name = var.s3_bucket_name != "" ? var.s3_bucket_name : module.s3_bucket_label.id
2218
}
2319

@@ -250,11 +246,8 @@ data "template_file" "terraform_backend_config" {
250246
}
251247
}
252248

253-
# We only write the backend config file if:
254-
# 1. The file doesn't exist and the module was given `terraform_backend_config_file_path`
255-
# 2. The file does exist, `backend_config_file_overwrite_enabled` is `true`, and the module was given `terraform_backend_config_file_path`
256249
resource "local_file" "terraform_backend_config" {
257-
count = local.overwrite_backend_config_file ? 1 : 0
250+
count = var.terraform_backend_config_file_path != "" ? 1 : 0
258251
content = data.template_file.terraform_backend_config.rendered
259252
filename = local.terraform_backend_config_file
260253
}

variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ variable "terraform_state_file" {
221221
description = "The path to the state file inside the bucket"
222222
}
223223

224-
variable "backend_config_file_overwrite_enabled" {
225-
type = bool
226-
default = true
227-
description = "If false, the backend config file will not be overwritten if it exists."
228-
}
229-
230224
variable "s3_bucket_name" {
231225
type = string
232226
default = ""

0 commit comments

Comments
 (0)