Loading...
Loading...
### Terraform Version ```shell 1.11.4 ``` ### Terraform Configuration Files ```terraform data "google_project" "main" {} resource "google_compute_network" "vm_vpc" { name = "foo-${data.google_project.main.project_id}" } ``` ```terraform run "test" { command = plan override_data { target = data.google_project.main values = { project_id = "test_project_id" } } } ``` ### Debug Output https://gist.github.com/nferch-circle/457fdf2b798d9be99e2430a3bfa0df48 ### Expected Behavior The test passes, because I am overriding the `project_id` value to the `google_project` datasource. ### Actual Behavior The tests fails because the `project_id` value is null. ``` ╷ │ Error: Invalid template interpolation value │ │ on main.tf line 3, in resource "google_compute_network" "vm_vpc": │ 3: name = "foo-${data.google_project.main.project_id}" │ ├──────────────── │ │ data.google_project.main.project_id is null │ │ The expression result is null. Cannot include a null value in a string template. ╵ ``` ### Steps to Reproduce Create the dummy module as `main.tf` and the test as `tests/base.tftest.hcl` 1. `terraform init` 2. `terraform test` ### Additional Context It's not super clear whether this is an problem with terraform or the provider or both, but it seems like something that should be systematically addressed. ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.