Resource(s) Affected
null_resource (hashicorp/null provider)
Configuration
```hcl
Relevant part (simplified)
module "secret_rotation" {
...
}
resource "null_resource" "insert_data" {
triggers = {
sp_display_name = var.sp_display_name
}
}
```
Expected Behavior
sp_display_name is defined once and should resolve to the same value throughout the run. The triggers["sp_display_name"] value on null_resource.insert_data should remain consistent between plan and apply, and Terraform should complete successfully without detecting any inconsistencies.
Actual Behavior
sp_display_name was only defined once, with a single value, but during terraform apply the null_resource provider reported two different values for triggers["sp_display_name"] on null_resource.insert_data (used here in a secret rotation module) — one at plan time and a different one during apply:
- Initial planned value:
"my-service-principala"
- Final value during apply:
"my-service-principal"
This resulted in the following error:
```
Error: Provider produced inconsistent final plan
When expanding the plan for
module.secret_rotation.null_resource.insert_data to include new values
learned so far during apply, provider
"registry.terraform.io/hashicorp/null" produced an invalid new value for
.triggers["sp_display_name"]: was cty.StringVal("my-service-principala"),
but now cty.StringVal("my-service-principal").
This is a bug in the provider, which should be reported in the provider's
own issue tracker.
```
Additionally, warnings were raised:
```
Use managed_services_customer_managed_key_id instead
(and 3 more similar warnings elsewhere)
```
Steps to Reproduce
- Define a
null_resource with a triggers map referencing a variable once (e.g. sp_display_name = var.sp_display_name), and change sp_display_name from the original
- Run
terraform apply
- Observe plan generation with
sp_display_name = "my-service-principala"
- During apply, without any config change, the value Terraform reports for the same attribute becomes
"my-service-principal"
- Terraform throws an inconsistent final plan error on the
null_resource's triggers attribute
Terraform and provider versions
```shell
terraform version
```
Is it a regression?
Debug Output
Important Factoids
Would you like to implement a fix?
No (reporting issue)
Resource(s) Affected
null_resource(hashicorp/nullprovider)Configuration
```hcl
Relevant part (simplified)
module "secret_rotation" {
...
}
resource "null_resource" "insert_data" {
triggers = {
sp_display_name = var.sp_display_name
}
}
```
Expected Behavior
sp_display_nameis defined once and should resolve to the same value throughout the run. Thetriggers["sp_display_name"]value onnull_resource.insert_datashould remain consistent between plan and apply, and Terraform should complete successfully without detecting any inconsistencies.Actual Behavior
sp_display_namewas only defined once, with a single value, but duringterraform applythenull_resourceprovider reported two different values fortriggers["sp_display_name"]onnull_resource.insert_data(used here in a secret rotation module) — one at plan time and a different one during apply:"my-service-principala""my-service-principal"This resulted in the following error:
```
Error: Provider produced inconsistent final plan
When expanding the plan for
module.secret_rotation.null_resource.insert_data to include new values
learned so far during apply, provider
"registry.terraform.io/hashicorp/null" produced an invalid new value for
.triggers["sp_display_name"]: was cty.StringVal("my-service-principala"),
but now cty.StringVal("my-service-principal").
This is a bug in the provider, which should be reported in the provider's
own issue tracker.
```
Additionally, warnings were raised:
```
Use managed_services_customer_managed_key_id instead
(and 3 more similar warnings elsewhere)
```
Steps to Reproduce
null_resourcewith atriggersmap referencing a variable once (e.g.sp_display_name = var.sp_display_name), and change sp_display_name from the originalterraform applysp_display_name = "my-service-principala""my-service-principal"null_resource'striggersattributeTerraform and provider versions
```shell
terraform version
```
Is it a regression?
Debug Output
Important Factoids
Would you like to implement a fix?
No (reporting issue)