File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ Available targets:
187187| tags | Additional tags (e.g. ` map('BusinessUnit','XYZ') ` | map(string) | ` <map> ` | no |
188188| terraform_backend_config_file_name | Name of terraform backend config file | string | ` terraform.tf ` | no |
189189| 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 |
190191| terraform_state_file | The path to the state file inside the bucket | string | ` terraform.tfstate ` | no |
191192| terraform_version | The minimum required terraform version | string | ` 0.12.2 ` | no |
192193| write_capacity | DynamoDB write capacity units | string | ` 5 ` | no |
Original file line number Diff line number Diff line change 3131| tags | Additional tags (e.g. ` map('BusinessUnit','XYZ') ` | map(string) | ` <map> ` | no |
3232| terraform_backend_config_file_name | Name of terraform backend config file | string | ` terraform.tf ` | no |
3333| 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 |
3435| terraform_state_file | The path to the state file inside the bucket | string | ` terraform.tfstate ` | no |
3536| terraform_version | The minimum required terraform version | string | ` 0.12.2 ` | no |
3637| write_capacity | DynamoDB write capacity units | string | ` 5 ` | no |
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ locals {
1212 var. terraform_backend_config_file_name
1313 )
1414
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+
1517 bucket_name = var. s3_bucket_name != " " ? var. s3_bucket_name : module. s3_bucket_label . id
1618}
1719
@@ -197,7 +199,7 @@ resource "aws_dynamodb_table" "without_server_side_encryption" {
197199}
198200
199201data "template_file" "terraform_backend_config" {
200- template = file (" ${ path . module } /templates/terraform.tf.tpl " )
202+ template = file (local . terraform_backend_config_template_file )
201203
202204 vars = {
203205 region = var.region
Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ variable "terraform_backend_config_file_path" {
191191 description = " The path to terrafrom project directory"
192192}
193193
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+
194200variable "terraform_version" {
195201 type = string
196202 default = " 0.12.2"
@@ -207,4 +213,4 @@ variable "s3_bucket_name" {
207213 type = string
208214 default = " "
209215 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