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

feat: Add resource filtering support to aws_oam_link #38277

Merged

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Jul 7, 2024

Description

This PR is to add resource filtering support to the aws_oam_link resource and data source.

During testing, it is observed that an OAM sink is a global object and thus can only be created once, so parallel tests would break. I've made the change to run all OAM acceptance tests in serial instead.

There also seems to be an AWS API issue where link_configuration cannot be unset via an update. I've tried to work around the issue with different permutations of setting link_configuration, log_group_configuration and metric_configuration, none of which worked. For now, I have to treat this as an upstream problem that should be resolved in the future, so that it doesn't block this feature from being merged.

Relations

Closes #37515

References

Referred to the API reference for specs.

Output from Acceptance Testing

$ export AWS_ALTERNATIVE_PROFILE=<redacted>
$ make testacc TESTS="TestAccObservabilityAccessManager" PKG=oam
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/oam/... -v -count 1 -parallel 20 -run='TestAccObservabilityAccessManager'  -timeout 360m
=== RUN   TestAccObservabilityAccessManager_serial
=== PAUSE TestAccObservabilityAccessManager_serial
=== CONT  TestAccObservabilityAccessManager_serial
=== RUN   TestAccObservabilityAccessManager_serial/SinksDataSource
=== RUN   TestAccObservabilityAccessManager_serial/SinksDataSource/basic
=== RUN   TestAccObservabilityAccessManager_serial/Link
=== RUN   TestAccObservabilityAccessManager_serial/Link/basic
=== RUN   TestAccObservabilityAccessManager_serial/Link/disappears
=== RUN   TestAccObservabilityAccessManager_serial/Link/update
=== RUN   TestAccObservabilityAccessManager_serial/Link/tags
=== RUN   TestAccObservabilityAccessManager_serial/Link/logGroupConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/Link/metricConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/basic
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/logGroupConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/metricConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinksDataSource
=== RUN   TestAccObservabilityAccessManager_serial/LinksDataSource/basic
=== RUN   TestAccObservabilityAccessManager_serial/Sink
=== RUN   TestAccObservabilityAccessManager_serial/Sink/basic
=== RUN   TestAccObservabilityAccessManager_serial/Sink/disappears
=== RUN   TestAccObservabilityAccessManager_serial/Sink/tags
=== RUN   TestAccObservabilityAccessManager_serial/SinkDataSource
=== RUN   TestAccObservabilityAccessManager_serial/SinkDataSource/basic
=== RUN   TestAccObservabilityAccessManager_serial/SinkPolicy
=== RUN   TestAccObservabilityAccessManager_serial/SinkPolicy/basic
=== RUN   TestAccObservabilityAccessManager_serial/SinkPolicy/update
--- PASS: TestAccObservabilityAccessManager_serial (423.60s)
    --- PASS: TestAccObservabilityAccessManager_serial/SinksDataSource (13.59s)
        --- PASS: TestAccObservabilityAccessManager_serial/SinksDataSource/basic (13.59s)
    --- PASS: TestAccObservabilityAccessManager_serial/Link (214.68s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/basic (24.17s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/disappears (20.29s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/update (37.85s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/tags (56.83s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/logGroupConfiguration (38.01s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/metricConfiguration (37.53s)
    --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource (59.90s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/basic (19.90s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/logGroupConfiguration (20.02s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/metricConfiguration (19.98s)
    --- PASS: TestAccObservabilityAccessManager_serial/LinksDataSource (19.86s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinksDataSource/basic (19.86s)
    --- PASS: TestAccObservabilityAccessManager_serial/Sink (61.50s)
        --- PASS: TestAccObservabilityAccessManager_serial/Sink/basic (15.24s)
        --- PASS: TestAccObservabilityAccessManager_serial/Sink/disappears (12.82s)
        --- PASS: TestAccObservabilityAccessManager_serial/Sink/tags (33.44s)
    --- PASS: TestAccObservabilityAccessManager_serial/SinkDataSource (13.34s)
        --- PASS: TestAccObservabilityAccessManager_serial/SinkDataSource/basic (13.34s)
    --- PASS: TestAccObservabilityAccessManager_serial/SinkPolicy (40.74s)
        --- PASS: TestAccObservabilityAccessManager_serial/SinkPolicy/basic (15.64s)
        --- PASS: TestAccObservabilityAccessManager_serial/SinkPolicy/update (25.10s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/oam        423.881s

$

@acwwat acwwat requested a review from a team as a code owner July 7, 2024 23:01
Copy link

github-actions bot commented Jul 7, 2024

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

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • 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 size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/oam Issues and PRs that pertain to the oam service. labels Jul 7, 2024
@terraform-aws-provider terraform-aws-provider bot added needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Jul 7, 2024
@acwwat acwwat force-pushed the f-aws_oam_link-add-filtering-support branch from cd87309 to 58ce1f2 Compare July 7, 2024 23:03
@acwwat acwwat changed the title [WIP] feat: Add filtering support to aws_oam_link feat: Add filtering support to aws_oam_link Jul 7, 2024
@acwwat acwwat force-pushed the f-aws_oam_link-add-filtering-support branch 3 times, most recently from b0208a0 to 639e2a8 Compare July 7, 2024 23:12
@acwwat acwwat changed the title feat: Add filtering support to aws_oam_link feat: Add resource filtering support to aws_oam_link Jul 7, 2024
@acwwat acwwat force-pushed the f-aws_oam_link-add-filtering-support branch from 639e2a8 to 3ece6c5 Compare July 7, 2024 23:19
@acwwat acwwat force-pushed the f-aws_oam_link-add-filtering-support branch from 3ece6c5 to 542711d Compare July 7, 2024 23:37
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 8, 2024
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 🚀.

% make testacc TESTARGS='-run=TestAccObservabilityAccessManager_serial/Link' PKG=oam 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/oam/... -v -count 1 -parallel 20  -run=TestAccObservabilityAccessManager_serial/Link -timeout 360m
=== RUN   TestAccObservabilityAccessManager_serial
=== PAUSE TestAccObservabilityAccessManager_serial
=== CONT  TestAccObservabilityAccessManager_serial
=== RUN   TestAccObservabilityAccessManager_serial/Link
=== RUN   TestAccObservabilityAccessManager_serial/Link/basic
=== RUN   TestAccObservabilityAccessManager_serial/Link/disappears
=== RUN   TestAccObservabilityAccessManager_serial/Link/update
=== RUN   TestAccObservabilityAccessManager_serial/Link/tags
=== RUN   TestAccObservabilityAccessManager_serial/Link/logGroupConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/Link/metricConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/basic
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/logGroupConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinkDataSource/metricConfiguration
=== RUN   TestAccObservabilityAccessManager_serial/LinksDataSource
=== RUN   TestAccObservabilityAccessManager_serial/LinksDataSource/basic
--- PASS: TestAccObservabilityAccessManager_serial (229.87s)
    --- PASS: TestAccObservabilityAccessManager_serial/Link (166.12s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/basic (20.96s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/disappears (15.79s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/update (29.02s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/tags (40.28s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/logGroupConfiguration (29.66s)
        --- PASS: TestAccObservabilityAccessManager_serial/Link/metricConfiguration (30.42s)
    --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource (47.55s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/basic (15.69s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/logGroupConfiguration (15.90s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinkDataSource/metricConfiguration (15.96s)
    --- PASS: TestAccObservabilityAccessManager_serial/LinksDataSource (16.19s)
        --- PASS: TestAccObservabilityAccessManager_serial/LinksDataSource/basic (16.19s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/oam	234.396s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit ed1d6b6 into hashicorp:main Jul 8, 2024
44 checks passed
@github-actions github-actions bot added this to the v5.58.0 milestone Jul 8, 2024
@sp055201
Copy link

sp055201 commented Jul 11, 2024

acwwat ewbankkit Is this in GA?

Copy link

This functionality has been released in v5.58.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!

@acwwat acwwat deleted the f-aws_oam_link-add-filtering-support branch July 19, 2024 02:49
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 Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. external-maintainer Contribution from a trusted external contributor. service/oam Issues and PRs that pertain to the oam service. size/XL 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.

[Enhancement]: Update aws_oam_link to support resource filtering for log groups and metric namespaces
3 participants