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

sweepers: Add aws_ssm_patch_baseline and aws_ssm_default_patch_baseline #27658

Merged
merged 4 commits into from
Nov 11, 2022

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Nov 4, 2022

Adds sweepers for aws_ssm_patch_baseline and aws_ssm_default_patch_baseline

Relates #27610

Output from Acceptance Testing

$ make sweep SWEEPARGS=-sweep-run=aws_ssm_default_patch_baseline

.2022/11/03 17:43:29 [DEBUG] Running Sweepers for region (us-west-2):
2022/11/03 17:43:29 [DEBUG] Running Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2)
2022/11/03 17:43:30 [INFO] Restoring SSM Default Patch Baseline for operating system "WINDOWS" to "arn:aws:ssm:us-west-2:280605243866:patchbaseline/pb-04fb4ae6142167966"
2022/11/03 17:43:30 [DEBUG] Completed Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2) in 967.644383ms
2022/11/03 17:43:30 Completed Sweepers for region (us-west-2) in 967.776377ms
2022/11/03 17:43:30 Sweeper Tests for region (us-west-2) ran successfully:
	- aws_ssm_default_patch_baseline
$ make sweep SWEEPARGS=-sweep-run=aws_ssm_patch_baseline

2022/11/04 11:37:35 [DEBUG] Running Sweepers for region (us-west-2):
2022/11/04 11:37:35 [DEBUG] Sweeper (aws_ssm_patch_baseline) has dependency (aws_ssm_default_patch_baseline), running..
2022/11/04 11:37:35 [DEBUG] Running Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2)
2022/11/04 11:37:37 [DEBUG] Completed Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2) in 1.565329777s
2022/11/04 11:37:37 [DEBUG] Running Sweeper (aws_ssm_patch_baseline) in region (us-west-2)
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0102906ed14f67376
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-03e800854b5ae2367
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0369934ffd3c23562
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0486bacccd690f332
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0fe363ed47badffb1
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0589d4b4ccc996c4a
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-08b8fdb07815ac6f3
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-03600c7b067b36c18
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-09e0a7d69492b70ab
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0d9cc39d0d50bbf31
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-094b5e4417946e4e1
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0f45b1be16c4b0ce8
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0c1cc926284b23e4b
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-049d54e1fc6524f01
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [DEBUG] Waiting for state to become: [success]
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-0f9bddf83e44a2b3f
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-05cb05eb039c3f3b7
2022/11/04 11:37:37 [INFO] Deleting SSM Patch Baseline: pb-047dd80a07aa204df
2022/11/04 11:37:37 [DEBUG] Completed Sweeper (aws_ssm_patch_baseline) in region (us-west-2) in 359.691601ms
2022/11/04 11:37:37 [DEBUG] Sweeper (aws_ssm_default_patch_baseline) already ran in region (us-west-2)
2022/11/04 11:37:37 Completed Sweepers for region (us-west-2) in 1.925221141s
2022/11/04 11:37:37 Sweeper Tests for region (us-west-2) ran successfully:
	- aws_ssm_default_patch_baseline
	- aws_ssm_patch_baseline

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

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. service/simpledb Issues and PRs that pertain to the simpledb service. service/ssm Issues and PRs that pertain to the ssm service. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Nov 4, 2022
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 sweep SWEEPARGS=-sweep-run=aws_ssm_default_patch_baseline,aws_ssm_patch_baseline
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
# set SWEEPARGS=-sweep-allow-failures to continue after first failure
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./internal/sweep -v -tags=sweep -sweep=us-west-2,us-east-1,us-east-2 -sweep-run=aws_ssm_default_patch_baseline,aws_ssm_patch_baseline -timeout 60m
2022/11/07 07:05:01 [DEBUG] Running Sweepers for region (us-west-2):
2022/11/07 07:05:01 [DEBUG] Running Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2)
2022/11/07 07:05:01 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/11/07 07:05:01 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:01 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:02 [DEBUG] Completed Sweeper (aws_ssm_default_patch_baseline) in region (us-west-2) in 1.635739043s
2022/11/07 07:05:02 [DEBUG] Sweeper (aws_ssm_patch_baseline) has dependency (aws_ssm_default_patch_baseline), running..
2022/11/07 07:05:02 [DEBUG] Sweeper (aws_ssm_default_patch_baseline) already ran in region (us-west-2)
2022/11/07 07:05:02 [DEBUG] Running Sweeper (aws_ssm_patch_baseline) in region (us-west-2)
2022/11/07 07:05:03 [DEBUG] Completed Sweeper (aws_ssm_patch_baseline) in region (us-west-2) in 124.600686ms
2022/11/07 07:05:03 Completed Sweepers for region (us-west-2) in 1.760660724s
2022/11/07 07:05:03 Sweeper Tests for region (us-west-2) ran successfully:
	- aws_ssm_default_patch_baseline
	- aws_ssm_patch_baseline
2022/11/07 07:05:03 [DEBUG] Running Sweepers for region (us-east-1):
2022/11/07 07:05:03 [DEBUG] Running Sweeper (aws_ssm_default_patch_baseline) in region (us-east-1)
2022/11/07 07:05:03 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/11/07 07:05:03 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:03 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:04 [DEBUG] Completed Sweeper (aws_ssm_default_patch_baseline) in region (us-east-1) in 1.174392236s
2022/11/07 07:05:04 [DEBUG] Sweeper (aws_ssm_patch_baseline) has dependency (aws_ssm_default_patch_baseline), running..
2022/11/07 07:05:04 [DEBUG] Sweeper (aws_ssm_default_patch_baseline) already ran in region (us-east-1)
2022/11/07 07:05:04 [DEBUG] Running Sweeper (aws_ssm_patch_baseline) in region (us-east-1)
2022/11/07 07:05:04 [DEBUG] Waiting for state to become: [success]
2022/11/07 07:05:04 [DEBUG] Waiting for state to become: [success]
2022/11/07 07:05:04 [INFO] Deleting SSM Patch Baseline: pb-0dabef16e8de4b38e
2022/11/07 07:05:04 [INFO] Deleting SSM Patch Baseline: pb-039472c1e636ce439
2022/11/07 07:05:04 [DEBUG] Waiting for state to become: [success]
2022/11/07 07:05:04 [INFO] Deleting SSM Patch Baseline: pb-0965331a76ebf442f
2022/11/07 07:05:04 [DEBUG] Completed Sweeper (aws_ssm_patch_baseline) in region (us-east-1) in 251.147511ms
2022/11/07 07:05:04 Completed Sweepers for region (us-east-1) in 1.425681137s
2022/11/07 07:05:04 Sweeper Tests for region (us-east-1) ran successfully:
	- aws_ssm_default_patch_baseline
	- aws_ssm_patch_baseline
2022/11/07 07:05:04 [DEBUG] Running Sweepers for region (us-east-2):
2022/11/07 07:05:04 [DEBUG] Running Sweeper (aws_ssm_default_patch_baseline) in region (us-east-2)
2022/11/07 07:05:04 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/11/07 07:05:04 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:04 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/11/07 07:05:05 [DEBUG] Completed Sweeper (aws_ssm_default_patch_baseline) in region (us-east-2) in 818.720408ms
2022/11/07 07:05:05 [DEBUG] Sweeper (aws_ssm_patch_baseline) has dependency (aws_ssm_default_patch_baseline), running..
2022/11/07 07:05:05 [DEBUG] Sweeper (aws_ssm_default_patch_baseline) already ran in region (us-east-2)
2022/11/07 07:05:05 [DEBUG] Running Sweeper (aws_ssm_patch_baseline) in region (us-east-2)
2022/11/07 07:05:05 [DEBUG] Completed Sweeper (aws_ssm_patch_baseline) in region (us-east-2) in 64.866138ms
2022/11/07 07:05:05 Completed Sweepers for region (us-east-2) in 883.692833ms
2022/11/07 07:05:05 Sweeper Tests for region (us-east-2) ran successfully:
	- aws_ssm_default_patch_baseline
	- aws_ssm_patch_baseline
ok  	github.com/hashicorp/terraform-provider-aws/internal/sweep	8.761s

@gdavison gdavison merged commit 0159951 into main Nov 11, 2022
@gdavison gdavison deleted the td-ssm-patch-baseline-sweepers branch November 11, 2022 00:09
@github-actions github-actions bot added this to the v4.40.0 milestone Nov 11, 2022
@github-actions
Copy link

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

@github-actions
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 Dec 18, 2022
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. service/simpledb Issues and PRs that pertain to the simpledb service. service/ssm Issues and PRs that pertain to the ssm service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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.

2 participants