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

sweeper/aws_cur_report_definition: Checks for region support #20294

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

gdavison
Copy link
Contributor

In some regions where CUR was not supported, such as us-east-2, the error RequestError is returned, which will cause the sweeper to skip.

In other regions where it is not supported, such as us-west-2, the error is ThrottlingException instead.

This PR now checks for the existence of a CUR endpoint and skips if the region does not support CUR.

Output from acceptance testing:

$ make sweep SWEEPARGS=-sweep-run=aws_cur_report_definition

2021/07/23 11:59:31 [DEBUG] Running Sweepers for region (us-east-1):
2021/07/23 11:59:31 [DEBUG] Running Sweeper (aws_cur_report_definition) in region (us-east-1)
2021/07/23 11:59:33 [DEBUG] Completed Sweeper (aws_cur_report_definition) in region (us-east-1) in 2.455980495s
2021/07/23 11:59:33 Completed Sweepers for region (us-east-1) in 2.456235699s
2021/07/23 11:59:33 Sweeper Tests for region (us-east-1) ran successfully:
	- aws_cur_report_definition
2021/07/23 11:59:33 [DEBUG] Running Sweepers for region (us-east-2):
2021/07/23 11:59:33 [DEBUG] Running Sweeper (aws_cur_report_definition) in region (us-east-2)
2021/07/23 11:59:34 [WARN] Skipping Cost and Usage Report Definitions sweep for us-east-2: CUR not supported in this region
2021/07/23 11:59:34 [DEBUG] Completed Sweeper (aws_cur_report_definition) in region (us-east-2) in 1.284317519s
2021/07/23 11:59:34 Completed Sweepers for region (us-east-2) in 1.284335761s
2021/07/23 11:59:34 Sweeper Tests for region (us-east-2) ran successfully:
	- aws_cur_report_definition
2021/07/23 11:59:34 [DEBUG] Running Sweepers for region (us-west-2):
2021/07/23 11:59:34 [DEBUG] Running Sweeper (aws_cur_report_definition) in region (us-west-2)
2021/07/23 11:59:36 [WARN] Skipping Cost and Usage Report Definitions sweep for us-west-2: CUR not supported in this region
2021/07/23 11:59:36 [DEBUG] Completed Sweeper (aws_cur_report_definition) in region (us-west-2) in 1.740692215s
2021/07/23 11:59:36 Completed Sweepers for region (us-west-2) in 1.740708271s
2021/07/23 11:59:36 Sweeper Tests for region (us-west-2) ran successfully:
	- aws_cur_report_definition

@github-actions github-actions bot added service/costandusagereportservice tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XS Managed by automation to categorize the size of a PR. labels Jul 23, 2021
@gdavison gdavison added sweeper Pertains to changes to or issues with the sweeper. and removed tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 23, 2021
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 🚀.

@gdavison gdavison merged commit 98e6eef into main Jul 23, 2021
@gdavison gdavison deleted the sweeper-cur-report-definition branch July 23, 2021 22:26
@github-actions github-actions bot added this to the v3.52.0 milestone Jul 23, 2021
@github-actions
Copy link

This functionality has been released in v3.52.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 Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/XS Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants