Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B add filter to iot_thing_indexing_configuration #26862

Conversation

Oltier
Copy link
Contributor

@Oltier Oltier commented Sep 19, 2022

Change summary

Update the [Create|Get|Update]IndexingConfiguration requests with a new optional parameter: filter

Change details

AWS has introduced a breaking change, making filter attribute required, when named_shadow_indexing_mode is set to ON.
https://docs.aws.amazon.com/iot/latest/apireference/API_ThingIndexingConfiguration.html
https://awsapichanges.info/archive/changes/0a7be3-iot.html

If filter is missing in the described case above, then the following error message is returned when trying to add a similar configuration:

resource "aws_iot_indexing_configuration" "indexing-config" {
  thing_indexing_configuration {
    thing_indexing_mode              = "REGISTRY_AND_SHADOW"
    thing_connectivity_indexing_mode = "STATUS"
    named_shadow_indexing_mode       = "ON"

    custom_field {
      name = "shadow.name.shadowName.desired.someStringValue"
      type = "String"
    }
  }
}
Error: error updating IoT Indexing Configuration: InvalidRequestException: NamedShadowNames Filter must not be empty for enabling NamedShadowIndexingMode

Closes #27532

Output from acceptance testing:

AWS_PROFILE=default TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20 -run='TestAccIoTIndexingConfiguration_serial'  -timeout 180m
=== RUN   TestAccIoTIndexingConfiguration_serial
=== RUN   TestAccIoTIndexingConfiguration_serial/basic
=== RUN   TestAccIoTIndexingConfiguration_serial/allAttributes
--- PASS: TestAccIoTIndexingConfiguration_serial (51.15s)
    --- PASS: TestAccIoTIndexingConfiguration_serial/basic (27.02s)
    --- PASS: TestAccIoTIndexingConfiguration_serial/allAttributes (24.13s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/iot        52.884s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Please review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/iot Issues and PRs that pertain to the iot service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Sep 19, 2022
@Oltier Oltier changed the title B add filters to iot thing indexing configuration B add filters to iot_thing_indexing_configuration Sep 20, 2022
@Oltier Oltier changed the title B add filters to iot_thing_indexing_configuration B add filter to iot_thing_indexing_configuration Sep 20, 2022
@Oltier Oltier marked this pull request as ready for review September 20, 2022 12:27
@icsaba
Copy link

icsaba commented Sep 28, 2022

@HashiCoop any update on it? what's the ETA?

@tmarlok88
Copy link
Contributor

The functionality is currently broken since aws introduced this change: https://awsapichanges.info/archive/changes/0a7be3-iot.html
named_shadow_indexing_mode cannot be enabled without a filter.

@breathingdust breathingdust added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 11, 2022
@Oltier Oltier force-pushed the b-add-filters-to-iot-thing_indexing_configuration branch from fd7b3c0 to a00e495 Compare October 14, 2022 12:56
@Oltier Oltier force-pushed the b-add-filters-to-iot-thing_indexing_configuration branch from a00e495 to 71906b3 Compare November 29, 2022 14:29
@gergo-schreiner-goto
Copy link

gergo-schreiner-goto commented Dec 15, 2022

Hey,

Can somebody review the PR and merge the changes? @breathingdust

Thanks in advance!

@breathingdust breathingdust added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 26, 2023
@BernhardRode
Copy link

Any news on when this can be merged?

Zoltan Tudlik added 7 commits September 18, 2023 09:35
AWS updated the [Create|Get|Update]IndexingConfiguration requests with a new optional parameter: filter
This filter attribute IS required now, when named_shadow_indexing_mode is set to ON.
https://docs.aws.amazon.com/iot/latest/apireference/API_ThingIndexingConfiguration.html

If filter is missing in the described case above, then the following error message is returned:
Error: error updating IoT Indexing Configuration: InvalidRequestException: NamedShadowNames Filter must not be empty for enabling NamedShadowIndexingMode
add expand and flatten functions for filter.named_shadow_names array
Add example for filter with named_shadow_name
resource/aws_iot_indexing_configuration: Add filter to thing_indexing_configuration, resolving `InvalidRequestException: NamedShadowNames Filter must not be empty for enabling NamedShadowIndexingMode` error
fix typo on `named_shadow_names`
set interface array for filter when deserializing instead of map
@Oltier Oltier force-pushed the b-add-filters-to-iot-thing_indexing_configuration branch from 71906b3 to fe1bdfe Compare September 18, 2023 07:37
@ewbankkit ewbankkit self-assigned this Oct 25, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Before

% make testacc TESTARGS='-run=TestAccIoTIndexingConfiguration_serial' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTIndexingConfiguration_serial -timeout 360m
=== RUN   TestAccIoTIndexingConfiguration_serial
=== PAUSE TestAccIoTIndexingConfiguration_serial
=== CONT  TestAccIoTIndexingConfiguration_serial
=== RUN   TestAccIoTIndexingConfiguration_serial/basic
=== RUN   TestAccIoTIndexingConfiguration_serial/allAttributes
    indexing_configuration_test.go:64: Step 1/2 error: Error running apply: exit status 1
        
        Error: updating IoT Indexing Configuration: InvalidRequestException: NamedShadowNames Filter must not be empty for enabling NamedShadowIndexingMode
        
          with aws_iot_indexing_configuration.test,
          on terraform_plugin_test.tf line 2, in resource "aws_iot_indexing_configuration" "test":
           2: resource "aws_iot_indexing_configuration" "test" {
        
--- FAIL: TestAccIoTIndexingConfiguration_serial (28.95s)
    --- PASS: TestAccIoTIndexingConfiguration_serial/basic (21.73s)
    --- FAIL: TestAccIoTIndexingConfiguration_serial/allAttributes (7.23s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/iot        33.982s
FAIL
make: *** [testacc] Error 1

After

% make testacc TESTARGS='-run=TestAccIoTIndexingConfiguration_serial' PKG=iot
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iot/... -v -count 1 -parallel 20  -run=TestAccIoTIndexingConfiguration_serial -timeout 360m
=== RUN   TestAccIoTIndexingConfiguration_serial
=== PAUSE TestAccIoTIndexingConfiguration_serial
=== CONT  TestAccIoTIndexingConfiguration_serial
=== RUN   TestAccIoTIndexingConfiguration_serial/basic
=== RUN   TestAccIoTIndexingConfiguration_serial/allAttributes
--- PASS: TestAccIoTIndexingConfiguration_serial (43.69s)
    --- PASS: TestAccIoTIndexingConfiguration_serial/basic (22.00s)
    --- PASS: TestAccIoTIndexingConfiguration_serial/allAttributes (21.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iot	49.206s

@ewbankkit
Copy link
Contributor

@Oltier Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit a596c02 into hashicorp:main Oct 26, 2023
@github-actions github-actions bot added this to the v5.23.0 milestone Oct 26, 2023
@github-actions
Copy link

This functionality has been released in v5.23.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@Oltier Oltier deleted the b-add-filters-to-iot-thing_indexing_configuration branch October 27, 2023 09:46
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/iot Issues and PRs that pertain to the iot service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_iot_indexing_configuration does not support named shadows
8 participants