File tree 4 files changed +12
-2
lines changed
4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ Available targets:
187
187
| tags | Additional tags (e.g. ` map('BusinessUnit','XYZ') ` | map(string) | ` <map> ` | no |
188
188
| terraform_backend_config_file_name | Name of terraform backend config file | string | ` terraform.tf ` | no |
189
189
| terraform_backend_config_file_path | The path to terrafrom project directory | string | `` | no |
190
+ | terraform_backend_config_template_file | The path to the template used to generate the config file | string | `` | no |
190
191
| terraform_state_file | The path to the state file inside the bucket | string | ` terraform.tfstate ` | no |
191
192
| terraform_version | The minimum required terraform version | string | ` 0.12.2 ` | no |
192
193
| write_capacity | DynamoDB write capacity units | string | ` 5 ` | no |
Original file line number Diff line number Diff line change 31
31
| tags | Additional tags (e.g. ` map('BusinessUnit','XYZ') ` | map(string) | ` <map> ` | no |
32
32
| terraform_backend_config_file_name | Name of terraform backend config file | string | ` terraform.tf ` | no |
33
33
| terraform_backend_config_file_path | The path to terrafrom project directory | string | `` | no |
34
+ | terraform_backend_config_template_file | The path to the template used to generate the config file | string | `` | no |
34
35
| terraform_state_file | The path to the state file inside the bucket | string | ` terraform.tfstate ` | no |
35
36
| terraform_version | The minimum required terraform version | string | ` 0.12.2 ` | no |
36
37
| write_capacity | DynamoDB write capacity units | string | ` 5 ` | no |
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ locals {
12
12
var. terraform_backend_config_file_name
13
13
)
14
14
15
+ terraform_backend_config_template_file = var. terraform_backend_config_template_file != " " ? var. terraform_backend_config_template_file : " ${ path . module } /templates/terraform.tf.tpl"
16
+
15
17
bucket_name = var. s3_bucket_name != " " ? var. s3_bucket_name : module. s3_bucket_label . id
16
18
}
17
19
@@ -197,7 +199,7 @@ resource "aws_dynamodb_table" "without_server_side_encryption" {
197
199
}
198
200
199
201
data "template_file" "terraform_backend_config" {
200
- template = file (" ${ path . module } /templates/terraform.tf.tpl " )
202
+ template = file (local . terraform_backend_config_template_file )
201
203
202
204
vars = {
203
205
region = var.region
Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ variable "terraform_backend_config_file_path" {
191
191
description = " The path to terrafrom project directory"
192
192
}
193
193
194
+ variable "terraform_backend_config_template_file" {
195
+ type = string
196
+ default = " "
197
+ description = " The path to the template used to generate the config file"
198
+ }
199
+
194
200
variable "terraform_version" {
195
201
type = string
196
202
default = " 0.12.2"
@@ -207,4 +213,4 @@ variable "s3_bucket_name" {
207
213
type = string
208
214
default = " "
209
215
description = " S3 bucket name. If not provided, the name will be generated by the label module in the format namespace-stage-name"
210
- }
216
+ }
You can’t perform that action at this time.
0 commit comments