-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Module version
github.com/hashicorp/terraform-plugin-framework v1.16.0
Relevant provider source code
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"secret_string": schema.StringAttribute{
Optional: true,
WriteOnly: true,
PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()},
},
},
}
Terraform Configuration Files
terraform {
required_providers {
provs = {
source = "edu/provs"
}
}
}
provider "provs" {
path = "/var/tmp/custom_tf_provider"
}
resource "provs_secret" "test" {
description = "test secret"
secret_string = "val"
}
Expected Behavior
To satisfy this specification from the docs:
Actual Behavior
When PlanModifiers
are specified for write only attributes, even if there is a configuration for the attribute, the replace of the resource does not happen which contradicts with the public docs.
Steps to Reproduce
Provider setup
- Clone the testing provider from here.
- Run
go run ./... -debug=true
- Save the returned TF_REATTACH_PROVIDERS to use it later
Configuration setup
With the configuration shared above, do the following:
- Run
TF_REATTACH_PROVIDERS='...' terraform apply
(to create the resource) - Run
TF_REATTACH_PROVIDERS='...' terraform apply
(to see if the replace is executed which it is not)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working