You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Upgrading to v0.6.0, from v0.5.0, to resolve #266 causes terraform to fail with a new (and exciting?) error.
╷
│ Error: Failed to decode resource from state
│
│ Error decoding
│ "module.elasticstack-prod.elasticstack_elasticsearch_logstash_pipeline.bob"
│ from previous state: string is required
╵
╷
│ Error: string is required
│
│ with module.elasticstack-prod.elasticstack_elasticsearch_logstash_pipeline.bob,
│ on modules/elasticstack-prod/logstash_pipelines.tf line 1, in resource "elasticstack_elasticsearch_logstash_pipeline" "bob":
│ 1: resource "elasticstack_elasticsearch_logstash_pipeline" "bob" {
│
╵
Outside of the version of the provider the entirety of the change is;
As a part of the recent version bump, I introduced a breaking change to fix an issue where the pipeline metadata field would throw an error when manual changes were made to pipelines (#278).
In order to resolve this issue, the data type of the field has been changed. Unfortunately during my testing, I missed the test case for existing resources in state migrating from a previous version (where this field would be defined as TypeMap) to the new version (where this field is expected to be defined as a TypeString) - although to be honest I'm not sure if this could have been worked around anyway! It seems Terraform gets its head scrambled a bit due to this mismatch (when running a plan with existing resources created using an older provider version).
Ensure any definitions of the pipeline_metadata field in your resource definitions have been encapsulated with jsonencode() as mentioned in the changelog
THEN
Run terraform plan (preferred)
Run terraform apply (preferred)
OR
Run terraform import as defined in the doc's for each pipeline
This will remove the reference to the resource in state (so won't impact the existing pipelines in elastic), the subsequent apply will then re-apply the resource with the new TypeString field (because the resources ID's will match in the cluster and the provider is leveraging a PUT request, there shouldn't be a need to run terraform import but it's another option available to then start managing these pipelines with Terraform again).
Describe the bug
Upgrading to v0.6.0, from v0.5.0, to resolve #266 causes terraform to fail with a new (and exciting?) error.
Outside of the version of the provider the entirety of the change is;
Debug output
With
TF_LOG=trace
the output is over 10000 lines so I'm not posting that. I did find this in it however.Versions (please complete the following information):
Additional context
terraform state show module.elasticstack-prod.elasticstack_elasticsearch_logstash_pipeline.bob
also returnsThe text was updated successfully, but these errors were encountered: