Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use templatefile function with template files #2

Open
codeangler opened this issue Nov 8, 2024 · 0 comments
Open

use templatefile function with template files #2

codeangler opened this issue Nov 8, 2024 · 0 comments

Comments

@codeangler
Copy link

codeangler commented Nov 8, 2024

data "template_file" "region1_bootstrap" {
template = file("bootstrap_files/bootstrap.xml.template")
vars = {
fw_gw_untrust = google_compute_subnetwork.region1_untrust.gateway_address # 10.0.1.1
fw_asn = local.fw_asn # 65001
fw_ip_vpc1 = local.region1_fw_ip_vpc1 # 10.1.0.2
cr_asn = local.cr_asn # 65000
cr_peer0 = local.region1_cr_vpc1_peer0 # 10.1.0.10
cr_peer1 = local.region1_cr_vpc1_peer1 # 10.1.0.11
}

this may be preferable ... https://developer.hashicorp.com/terraform/language/functions/templatefile instead of "file()"

Because our deployment pipelines don't have a persistent state, the file is written each time, and the plan says that the file will change. Maybe this software won't be impacted, but using the templatefile function could help with Terraform internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant