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

fix: update approve_after_days validation in ssm patch baseline resource #39949

Merged

Conversation

stefanfreitag
Copy link
Contributor

Description

As described in #39917 the validation range for the approve_after_days setting is not matching the range described in the official docs (see References section).

The PR updates the range from 0-100 to 0-360. In addition, the documentation for the resource is updated.

Relations

Closes #39917

References

Output from Acceptance Testing

make testacc TESTS=TestAccSSMPatchBaseline PKG=ssm
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/ssm/... -v -count 1 -parallel 5 -run='TestAccSSMPatchBaseline'  -timeout 360m
2024/10/30 19:58:29 Initializing Terraform AWS Provider...
=== RUN   TestAccSSMPatchBaselineDataSource_existingBaseline
=== PAUSE TestAccSSMPatchBaselineDataSource_existingBaseline
=== RUN   TestAccSSMPatchBaselineDataSource_newBaseline
=== PAUSE TestAccSSMPatchBaselineDataSource_newBaseline
=== RUN   TestAccSSMPatchBaseline_tags
=== PAUSE TestAccSSMPatchBaseline_tags
=== RUN   TestAccSSMPatchBaseline_tags_null
=== PAUSE TestAccSSMPatchBaseline_tags_null
=== RUN   TestAccSSMPatchBaseline_tags_EmptyMap
=== PAUSE TestAccSSMPatchBaseline_tags_EmptyMap
=== RUN   TestAccSSMPatchBaseline_tags_AddOnUpdate
=== PAUSE TestAccSSMPatchBaseline_tags_AddOnUpdate
=== RUN   TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate
=== PAUSE TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate
=== RUN   TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_overlapping
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_overlapping
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate
=== PAUSE TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate
=== RUN   TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccSSMPatchBaseline_basic
=== PAUSE TestAccSSMPatchBaseline_basic
=== RUN   TestAccSSMPatchBaseline_disappears
=== PAUSE TestAccSSMPatchBaseline_disappears
=== RUN   TestAccSSMPatchBaseline_operatingSystem
=== PAUSE TestAccSSMPatchBaseline_operatingSystem
=== RUN   TestAccSSMPatchBaseline_approveUntilDateParam
=== PAUSE TestAccSSMPatchBaseline_approveUntilDateParam
=== RUN   TestAccSSMPatchBaseline_approveAfterDaysParam
=== PAUSE TestAccSSMPatchBaseline_approveAfterDaysParam
=== RUN   TestAccSSMPatchBaseline_sources
=== PAUSE TestAccSSMPatchBaseline_sources
=== RUN   TestAccSSMPatchBaseline_approvedPatchesNonSec
=== PAUSE TestAccSSMPatchBaseline_approvedPatchesNonSec
=== RUN   TestAccSSMPatchBaseline_approvalRuleEmpty
=== PAUSE TestAccSSMPatchBaseline_approvalRuleEmpty
=== RUN   TestAccSSMPatchBaseline_rejectPatchesAction
=== PAUSE TestAccSSMPatchBaseline_rejectPatchesAction
=== CONT  TestAccSSMPatchBaselineDataSource_existingBaseline
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag
=== CONT  TestAccSSMPatchBaseline_rejectPatchesAction
=== CONT  TestAccSSMPatchBaseline_approvalRuleEmpty
=== CONT  TestAccSSMPatchBaseline_approvedPatchesNonSec
--- PASS: TestAccSSMPatchBaselineDataSource_existingBaseline (26.55s)
=== CONT  TestAccSSMPatchBaseline_sources
--- PASS: TestAccSSMPatchBaseline_rejectPatchesAction (40.97s)
=== CONT  TestAccSSMPatchBaseline_approveAfterDaysParam
--- PASS: TestAccSSMPatchBaseline_approvedPatchesNonSec (41.16s)
=== CONT  TestAccSSMPatchBaseline_approveUntilDateParam
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag (44.28s)
=== CONT  TestAccSSMPatchBaseline_operatingSystem
--- PASS: TestAccSSMPatchBaseline_approvalRuleEmpty (66.80s)
=== CONT  TestAccSSMPatchBaseline_disappears
--- PASS: TestAccSSMPatchBaseline_approveAfterDaysParam (27.67s)
=== CONT  TestAccSSMPatchBaseline_basic
--- PASS: TestAccSSMPatchBaseline_sources (57.52s)
=== CONT  TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccSSMPatchBaseline_disappears (30.80s)
=== CONT  TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccSSMPatchBaseline_approveUntilDateParam (57.90s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccSSMPatchBaseline_operatingSystem (58.78s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccSSMPatchBaseline_basic (63.93s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace (71.66s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add (71.36s)
=== CONT  TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate (47.84s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag (84.05s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag (101.62s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag (42.52s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag (40.61s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_overlapping
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag (41.04s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace (71.59s)
=== CONT  TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly (65.44s)
=== CONT  TestAccSSMPatchBaseline_tags_EmptyMap
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly (68.72s)
=== CONT  TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccSSMPatchBaseline_tags_EmptyMap (52.11s)
=== CONT  TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_overlapping (113.59s)
=== CONT  TestAccSSMPatchBaseline_tags_AddOnUpdate
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping (115.61s)
=== CONT  TestAccSSMPatchBaseline_tags
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate (77.39s)
=== CONT  TestAccSSMPatchBaseline_tags_null
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add (103.65s)
=== CONT  TestAccSSMPatchBaselineDataSource_newBaseline
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly (149.91s)
--- PASS: TestAccSSMPatchBaseline_tags_AddOnUpdate (69.21s)
--- PASS: TestAccSSMPatchBaselineDataSource_newBaseline (29.46s)
--- PASS: TestAccSSMPatchBaseline_tags_null (46.43s)
--- PASS: TestAccSSMPatchBaseline_tags (132.69s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ssm        471.222s

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

  • 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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ssm Issues and PRs that pertain to the ssm service. needs-triage Waiting for first response or review from a maintainer. labels Oct 30, 2024
@stefanfreitag stefanfreitag force-pushed the b-aws_ssm_patch_baseline-update-validation branch from 8c42547 to b2b4d7a Compare October 30, 2024 19:58
@stefanfreitag stefanfreitag marked this pull request as ready for review October 30, 2024 20:25
@stefanfreitag stefanfreitag requested a review from a team as a code owner October 30, 2024 20:25
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Oct 31, 2024
Copy link
Member

@jar-b jar-b 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 PKG=ssm TESTS=TestAccSSMPatchBaseline_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/ssm/... -v -count 1 -parallel 20 -run='TestAccSSMPatchBaseline_'  -timeout 360m
2024/10/31 10:40:51 Initializing Terraform AWS Provider...

--- PASS: TestAccSSMPatchBaseline_rejectPatchesAction (39.34s)
=== CONT  TestAccSSMPatchBaseline_sources
--- PASS: TestAccSSMPatchBaseline_approvedPatchesNonSec (39.45s)
=== CONT  TestAccSSMPatchBaseline_approveAfterDays
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nullOverlappingResourceTag (47.56s)
=== CONT  TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nullNonOverlappingResourceTag (47.78s)
=== CONT  TestAccSSMPatchBaseline_approveUntilDateParam
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_emptyResourceTag (47.93s)
=== CONT  TestAccSSMPatchBaseline_disappears
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_emptyProviderOnlyTag (48.20s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccSSMPatchBaseline_tags_EmptyMap (60.35s)
=== CONT  TestAccSSMPatchBaseline_basic
--- PASS: TestAccSSMPatchBaseline_tags_null (60.49s)
=== CONT  TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccSSMPatchBaseline_operatingSystem (64.76s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate
--- PASS: TestAccSSMPatchBaseline_approvalRuleEmpty (66.69s)
=== CONT  TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccSSMPatchBaseline_approveAfterDays (31.08s)
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_updateToResourceOnly (77.01s)
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Replace (79.14s)
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_updateToProviderOnly (79.30s)
--- PASS: TestAccSSMPatchBaseline_tags_AddOnUpdate (79.42s)
--- PASS: TestAccSSMPatchBaseline_disappears (32.27s)
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnCreate (85.16s)
--- PASS: TestAccSSMPatchBaseline_sources (53.38s)
--- PASS: TestAccSSMPatchBaseline_approveUntilDateParam (51.95s)
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnCreate (36.32s)
--- PASS: TestAccSSMPatchBaseline_tags_EmptyTag_OnUpdate_Add (101.43s)
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Add (56.63s)
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_nonOverlapping (106.61s)
--- PASS: TestAccSSMPatchBaseline_basic (47.36s)
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_overlapping (107.72s)
--- PASS: TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_DefaultTag (63.37s)
--- PASS: TestAccSSMPatchBaseline_tags_ComputedTag_OnUpdate_Replace (47.23s)
--- PASS: TestAccSSMPatchBaseline_tags (119.82s)
--- PASS: TestAccSSMPatchBaseline_tags_DefaultTags_providerOnly (120.51s)
--- PASS: TestAccSSMPatchBaseline_tags_IgnoreTags_Overlap_ResourceTag (60.13s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ssm        125.671s

@jar-b
Copy link
Member

jar-b commented Oct 31, 2024

Thanks for your contribution, @stefanfreitag! 👍

@stefanfreitag
Copy link
Contributor Author

Thanks for updating the PR :) Always good to see how/ where to improve!

@jar-b jar-b merged commit 485918f into hashicorp:main Oct 31, 2024
41 checks passed
@github-actions github-actions bot added this to the v5.74.0 milestone Oct 31, 2024
Copy link

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

@stefanfreitag stefanfreitag deleted the b-aws_ssm_patch_baseline-update-validation branch November 1, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. service/ssm Issues and PRs that pertain to the ssm service. 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_ssm_patch_baseline is more strict about approval rules than AWS is
2 participants