Open laynax opened 2 years ago
Thanks for opening this issue. I believe the following comment might be what you need...
https://github.com/fastly/terraform-provider-fastly/issues/231#issuecomment-632840094
@Integralist Thanks for your respond. Yes, using trimspace()
would do the trick too. However, I was trying to fix this on provider side.
More details on my digging: I tried using DiffSuppressFunc and StateFunc but them both didn't work (in case of doing such, we receive a newVal here with 2 elements which the second one is not filled with data and causes erorr). I think the reason for that is SetType is not supported by terraform any more.
Hi team
I have a
fastly_service_vcl
resource including alogging_syslog
withtls_ca_cert
enabled. Now by making any changes to service, even if it's not related tologging_syslog
, I get to seelogging_syslog
block diff by executingterraform plan
.Digging deeper into the problem, showed it's caused by commiting
tls_ca_cert
string with a trailing\n
(how I passed to it initially) into tfstate. So after each read, terraform compares cert with trailing\n
in tfstate with the one without whitespace fetched from fastly-api.I'm a new comer in GO world and wanted to contribute to your project, but couldn't find a proper way to solve the problem to submit a PR.
Terraform Version
Affected Resource(s)
fastly_service_vcl
Terraform Configuration Files
Expected Behavior
Changing service comment must be the only modified line in
terraform plan
Actual Behavior
Redundant diff on
logging_syslog
block.Steps to Reproduce
terraform apply
test_service.comment
)terraform plan