hashicorp / hashicorp/terraform-plugin-sdk

DiffSuppressFunc doesn't work for list-type attributes

Open
#477 6 comments 21 reactions 0 assignees View on GitHub
breaking-change enhancement subsystem/types
Dominant language
Go
Stars
485
Forks
244
Avg merge
19h 57m
Merged PRs (30d)
4

Description

### SDK version

```
{
"Path": "github.com/hashicorp/terraform-plugin-sdk",
"Version": "v1.13.0"
}
```

### Relevant provider source code

https://github.com/hashicorp/terraform-plugin-sdk/blob/79b4af5fffc8a33bcff6183efc99f3006d7fde5c/helper/schema/schema.go#L265

```go
func resourceService() *schema.Resource {
...
"test_attribute": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
...
```

### Terraform Configuration Files

```hcl
resource "example_resource" "example_name" {
test_attribute = ["value1", "value2", "value3"]
}
```

### Expected Behavior

It should be possible to implement a `DiffSuppressFunction` that would enable ignoring the order on an attribute that is a list of strings.

### Actual Behavior

The `DiffSuppressFunction` schema only expects a string as the old and new attribute values; it doesn't seem possible to use on an attribute whose type is a list of strings.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.