Skip to content

Commit

Permalink
fix indexing_configuration.go flattenThingIndexingConfiguration
Browse files Browse the repository at this point in the history
set interface array for filter when deserializing instead of map
  • Loading branch information
Zoltan Tudlik committed Sep 18, 2023
1 parent 18ee400 commit fe1bdfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/service/iot/indexing_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func ResourceIndexingConfiguration() *schema.Resource {
"named_shadow_names": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MinItems: 1,
Elem: &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -283,7 +282,7 @@ func flattenThingIndexingConfiguration(apiObject *iot.ThingIndexingConfiguration
}

if v := apiObject.Filter; v != nil {
tfMap["filter"] = flattenIndexingFilter(v)
tfMap["filter"] = []interface{}{flattenIndexingFilter(v)}
}

return tfMap
Expand Down
4 changes: 2 additions & 2 deletions internal/service/iot/indexing_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func testAccIndexingConfiguration_allAttributes(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.named_shadow_indexing_mode", "ON"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.thing_connectivity_indexing_mode", "STATUS"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.thing_indexing_mode", "REGISTRY_AND_SHADOW"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.filter.named_shadow_names.#", "1"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.filter.named_shadow_names.0", "thing1shadow"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.filter.0.named_shadow_names.#", "1"),
resource.TestCheckResourceAttr(resourceName, "thing_indexing_configuration.0.filter.0.named_shadow_names.0", "thing1shadow"),
),
},
{
Expand Down

0 comments on commit fe1bdfe

Please sign in to comment.