Loading...
Loading...
### Terraform Version ```shell Terraform v1.11.3 on darwin_arm64 + provider registry.terraform.io/hashicorp/google v6.28.0 ``` ### Terraform Configuration Files in `main.tf` ```terraform resource "google_secret_manager_secret" "this" { secret_id = var.secret_id replication { auto {} } } resource "google_secret_manager_secret_version" "this" { count = var.secret_data_wo == null ? 0 : 1 secret = google_secret_manager_secret.this.id secret_data_wo = var.secret_data_wo } ``` in `main.tftest.hcl`: ```terraform mock_provider "google" { mock_resource "google_secret_manager_secret" { defaults = { project = "test-foo" } } mock_resource "google_secret_manager_secret_version" { defaults = { project = "test-foo" } } } run "simple_example" { variables { secret_id = "foobar" secret_data_wo = sensitive("hunter2") } } ``` ### Debug Output (let me know if you need this) ### Expected Behavior The test should pass ### Actual Behavior ``` % tf test main.tftest.hcl... in progress run "simple_example"... fail ╷ │ Error: Provider produced invalid plan │ │ Provider "provider[\"registry.terraform.io/hashicorp/google\"]" returned a value for │ the write-only attribute "google_secret_manager_secret_version.this[0].secret_data_wo" │ during planning. Write-only attributes cannot be read back from the provider. This is │ a bug in the provider, which should be reported in the provider's own issue tracker. ╵ main.tftest.hcl... tearing down main.tftest.hcl... fail ``` ### Steps to Reproduce 1. `terraform init` 2. `terraform test` ### Additional Context I know the warning says to file a provider bug for this error, but I verified and pretty sure this is an issue with the mock provider. A plan-only test with the real provider works fine. ### 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.