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

Tech debt: Migrate cloudwatch resources to AWS SDK for Go v2 #35569

Merged
merged 14 commits into from
Feb 6, 2024

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jan 30, 2024

Description

Ibid.

Relations

Relates #32976.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccCloudWatch' PKG=cloudwatch ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudwatch/... -v -count 1 -parallel 3  -run=TestAccCloudWatch -timeout 360m
=== RUN   TestAccCloudWatchCompositeAlarm_basic
=== PAUSE TestAccCloudWatchCompositeAlarm_basic
=== RUN   TestAccCloudWatchCompositeAlarm_disappears
=== PAUSE TestAccCloudWatchCompositeAlarm_disappears
=== RUN   TestAccCloudWatchCompositeAlarm_tags
=== PAUSE TestAccCloudWatchCompositeAlarm_tags
=== RUN   TestAccCloudWatchCompositeAlarm_actionsEnabled
=== PAUSE TestAccCloudWatchCompositeAlarm_actionsEnabled
=== RUN   TestAccCloudWatchCompositeAlarm_alarmActions
=== PAUSE TestAccCloudWatchCompositeAlarm_alarmActions
=== RUN   TestAccCloudWatchCompositeAlarm_description
=== PAUSE TestAccCloudWatchCompositeAlarm_description
=== RUN   TestAccCloudWatchCompositeAlarm_updateAlarmRule
=== PAUSE TestAccCloudWatchCompositeAlarm_updateAlarmRule
=== RUN   TestAccCloudWatchCompositeAlarm_insufficientDataActions
=== PAUSE TestAccCloudWatchCompositeAlarm_insufficientDataActions
=== RUN   TestAccCloudWatchCompositeAlarm_okActions
=== PAUSE TestAccCloudWatchCompositeAlarm_okActions
=== RUN   TestAccCloudWatchCompositeAlarm_allActions
=== PAUSE TestAccCloudWatchCompositeAlarm_allActions
=== RUN   TestAccCloudWatchCompositeAlarm_actionsSuppressor
=== PAUSE TestAccCloudWatchCompositeAlarm_actionsSuppressor
=== RUN   TestAccCloudWatchDashboard_basic
=== PAUSE TestAccCloudWatchDashboard_basic
=== RUN   TestAccCloudWatchDashboard_disappears
=== PAUSE TestAccCloudWatchDashboard_disappears
=== RUN   TestAccCloudWatchMetricAlarm_basic
=== PAUSE TestAccCloudWatchMetricAlarm_basic
=== RUN   TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate
=== PAUSE TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate
=== RUN   TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic
=== PAUSE TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic
=== RUN   TestAccCloudWatchMetricAlarm_AlarmActions_swfAction
=== PAUSE TestAccCloudWatchMetricAlarm_AlarmActions_swfAction
=== RUN   TestAccCloudWatchMetricAlarm_dataPointsToAlarm
=== PAUSE TestAccCloudWatchMetricAlarm_dataPointsToAlarm
=== RUN   TestAccCloudWatchMetricAlarm_treatMissingData
=== PAUSE TestAccCloudWatchMetricAlarm_treatMissingData
=== RUN   TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== PAUSE TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== RUN   TestAccCloudWatchMetricAlarm_extendedStatistic
=== PAUSE TestAccCloudWatchMetricAlarm_extendedStatistic
=== RUN   TestAccCloudWatchMetricAlarm_metricQuery
=== PAUSE TestAccCloudWatchMetricAlarm_metricQuery
=== RUN   TestAccCloudWatchMetricAlarm_missingStatistic
=== PAUSE TestAccCloudWatchMetricAlarm_missingStatistic
=== RUN   TestAccCloudWatchMetricAlarm_tags
=== PAUSE TestAccCloudWatchMetricAlarm_tags
=== RUN   TestAccCloudWatchMetricAlarm_disappears
=== PAUSE TestAccCloudWatchMetricAlarm_disappears
=== RUN   TestAccCloudWatchMetricStream_basic
=== PAUSE TestAccCloudWatchMetricStream_basic
=== RUN   TestAccCloudWatchMetricStream_disappears
=== PAUSE TestAccCloudWatchMetricStream_disappears
=== RUN   TestAccCloudWatchMetricStream_nameGenerated
=== PAUSE TestAccCloudWatchMetricStream_nameGenerated
=== RUN   TestAccCloudWatchMetricStream_namePrefix
=== PAUSE TestAccCloudWatchMetricStream_namePrefix
=== RUN   TestAccCloudWatchMetricStream_includeFilters
=== PAUSE TestAccCloudWatchMetricStream_includeFilters
=== RUN   TestAccCloudWatchMetricStream_includeFiltersWithMetricNames
=== PAUSE TestAccCloudWatchMetricStream_includeFiltersWithMetricNames
=== RUN   TestAccCloudWatchMetricStream_excludeFilters
=== PAUSE TestAccCloudWatchMetricStream_excludeFilters
=== RUN   TestAccCloudWatchMetricStream_excludeFiltersWithMetricNames
=== PAUSE TestAccCloudWatchMetricStream_excludeFiltersWithMetricNames
=== RUN   TestAccCloudWatchMetricStream_update
=== PAUSE TestAccCloudWatchMetricStream_update
=== RUN   TestAccCloudWatchMetricStream_tags
=== PAUSE TestAccCloudWatchMetricStream_tags
=== RUN   TestAccCloudWatchMetricStream_additional_statistics
=== PAUSE TestAccCloudWatchMetricStream_additional_statistics
=== RUN   TestAccCloudWatchMetricStream_includeLinkedAccountsMetrics
=== PAUSE TestAccCloudWatchMetricStream_includeLinkedAccountsMetrics
=== CONT  TestAccCloudWatchCompositeAlarm_basic
=== CONT  TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles
=== CONT  TestAccCloudWatchMetricStream_namePrefix
--- PASS: TestAccCloudWatchCompositeAlarm_basic (23.90s)
=== CONT  TestAccCloudWatchMetricAlarm_disappears
--- PASS: TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (32.49s)
=== CONT  TestAccCloudWatchMetricStream_nameGenerated
--- PASS: TestAccCloudWatchMetricAlarm_disappears (17.65s)
=== CONT  TestAccCloudWatchMetricStream_disappears
--- PASS: TestAccCloudWatchMetricStream_namePrefix (137.02s)
=== CONT  TestAccCloudWatchMetricStream_basic
--- PASS: TestAccCloudWatchMetricStream_disappears (170.63s)
=== CONT  TestAccCloudWatchMetricStream_update
--- PASS: TestAccCloudWatchMetricStream_nameGenerated (194.10s)
=== CONT  TestAccCloudWatchMetricStream_includeLinkedAccountsMetrics
--- PASS: TestAccCloudWatchMetricStream_basic (118.79s)
=== CONT  TestAccCloudWatchMetricStream_additional_statistics
--- PASS: TestAccCloudWatchMetricStream_update (74.34s)
=== CONT  TestAccCloudWatchMetricStream_tags
--- PASS: TestAccCloudWatchMetricStream_additional_statistics (70.28s)
=== CONT  TestAccCloudWatchCompositeAlarm_actionsSuppressor
--- PASS: TestAccCloudWatchCompositeAlarm_actionsSuppressor (22.38s)
=== CONT  TestAccCloudWatchMetricAlarm_treatMissingData
--- PASS: TestAccCloudWatchMetricAlarm_treatMissingData (47.74s)
=== CONT  TestAccCloudWatchMetricAlarm_dataPointsToAlarm
--- PASS: TestAccCloudWatchMetricAlarm_dataPointsToAlarm (17.82s)
=== CONT  TestAccCloudWatchMetricAlarm_AlarmActions_swfAction
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_swfAction (21.95s)
=== CONT  TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic (21.74s)
=== CONT  TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate
--- PASS: TestAccCloudWatchMetricStream_includeLinkedAccountsMetrics (270.03s)
=== CONT  TestAccCloudWatchMetricAlarm_basic
--- PASS: TestAccCloudWatchMetricAlarm_basic (21.42s)
=== CONT  TestAccCloudWatchDashboard_disappears
--- PASS: TestAccCloudWatchMetricStream_tags (242.10s)
=== CONT  TestAccCloudWatchDashboard_basic
--- PASS: TestAccCloudWatchDashboard_disappears (20.69s)
=== CONT  TestAccCloudWatchMetricStream_excludeFilters
--- PASS: TestAccCloudWatchMetricStream_excludeFilters (22.20s)
=== CONT  TestAccCloudWatchMetricStream_excludeFiltersWithMetricNames
--- PASS: TestAccCloudWatchDashboard_basic (39.30s)
=== CONT  TestAccCloudWatchMetricStream_includeFiltersWithMetricNames
--- PASS: TestAccCloudWatchMetricStream_excludeFiltersWithMetricNames (25.89s)
=== CONT  TestAccCloudWatchCompositeAlarm_description
--- PASS: TestAccCloudWatchMetricStream_includeFiltersWithMetricNames (25.95s)
=== CONT  TestAccCloudWatchCompositeAlarm_allActions
--- PASS: TestAccCloudWatchCompositeAlarm_description (38.11s)
=== CONT  TestAccCloudWatchCompositeAlarm_okActions
--- PASS: TestAccCloudWatchCompositeAlarm_allActions (39.20s)
=== CONT  TestAccCloudWatchCompositeAlarm_insufficientDataActions
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate (217.40s)
=== CONT  TestAccCloudWatchCompositeAlarm_updateAlarmRule
--- PASS: TestAccCloudWatchCompositeAlarm_okActions (55.00s)
=== CONT  TestAccCloudWatchMetricStream_includeFilters
--- PASS: TestAccCloudWatchCompositeAlarm_insufficientDataActions (51.34s)
=== CONT  TestAccCloudWatchCompositeAlarm_actionsEnabled
--- PASS: TestAccCloudWatchMetricStream_includeFilters (31.10s)
=== CONT  TestAccCloudWatchMetricAlarm_missingStatistic
--- PASS: TestAccCloudWatchMetricAlarm_missingStatistic (3.66s)
=== CONT  TestAccCloudWatchCompositeAlarm_alarmActions
--- PASS: TestAccCloudWatchCompositeAlarm_updateAlarmRule (47.46s)
=== CONT  TestAccCloudWatchMetricAlarm_tags
--- PASS: TestAccCloudWatchCompositeAlarm_actionsEnabled (47.40s)
=== CONT  TestAccCloudWatchCompositeAlarm_tags
--- PASS: TestAccCloudWatchCompositeAlarm_alarmActions (62.53s)
=== CONT  TestAccCloudWatchCompositeAlarm_disappears
--- PASS: TestAccCloudWatchMetricAlarm_tags (58.39s)
=== CONT  TestAccCloudWatchMetricAlarm_metricQuery
--- PASS: TestAccCloudWatchCompositeAlarm_tags (60.75s)
=== CONT  TestAccCloudWatchMetricAlarm_extendedStatistic
--- PASS: TestAccCloudWatchCompositeAlarm_disappears (21.89s)
--- PASS: TestAccCloudWatchMetricAlarm_metricQuery (109.63s)
--- PASS: TestAccCloudWatchMetricAlarm_extendedStatistic (204.30s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch	1007.558s

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 size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. labels Jan 30, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 30, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@ewbankkit ewbankkit added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Jan 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 TESTARGS='-run=TestAccCloudWatch' PKG=cloudwatch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudwatch/... -v -count 1 -parallel 20  -run=TestAccCloudWatch -timeout 360m

--- PASS: TestAccCloudWatchMetricAlarm_dataPointsToAlarm (24.55s)
=== CONT  TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate
--- PASS: TestAccCloudWatchMetricAlarm_disappears (25.55s)
=== CONT  TestAccCloudWatchMetricAlarm_AlarmActions_swfAction
--- PASS: TestAccCloudWatchMetricAlarm_basic (28.10s)
=== CONT  TestAccCloudWatchDashboard_disappears
--- PASS: TestAccCloudWatchMetricStream_excludeFilters (30.59s)
=== CONT  TestAccCloudWatchCompositeAlarm_description
--- PASS: TestAccCloudWatchMetricStream_excludeFiltersWithMetricNames (30.81s)
=== CONT  TestAccCloudWatchCompositeAlarm_allActions
--- PASS: TestAccCloudWatchMetricStream_includeFilters (30.84s)
=== CONT  TestAccCloudWatchCompositeAlarm_okActions
--- PASS: TestAccCloudWatchMetricStream_includeFiltersWithMetricNames (30.86s)
=== CONT  TestAccCloudWatchCompositeAlarm_insufficientDataActions
--- PASS: TestAccCloudWatchCompositeAlarm_basic (30.93s)
=== CONT  TestAccCloudWatchCompositeAlarm_updateAlarmRule
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic (31.40s)
=== CONT  TestAccCloudWatchDashboard_basic
--- PASS: TestAccCloudWatchCompositeAlarm_actionsSuppressor (31.68s)
=== CONT  TestAccCloudWatchCompositeAlarm_actionsEnabled
--- PASS: TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (36.91s)
=== CONT  TestAccCloudWatchCompositeAlarm_alarmActions
--- PASS: TestAccCloudWatchDashboard_disappears (18.37s)
=== CONT  TestAccCloudWatchMetricAlarm_missingStatistic
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_swfAction (21.46s)
=== CONT  TestAccCloudWatchMetricAlarm_tags
--- PASS: TestAccCloudWatchMetricAlarm_missingStatistic (2.56s)
=== CONT  TestAccCloudWatchMetricAlarm_metricQuery
--- PASS: TestAccCloudWatchMetricAlarm_treatMissingData (54.63s)
=== CONT  TestAccCloudWatchMetricAlarm_extendedStatistic
--- PASS: TestAccCloudWatchCompositeAlarm_updateAlarmRule (36.80s)
=== CONT  TestAccCloudWatchCompositeAlarm_tags
--- PASS: TestAccCloudWatchDashboard_basic (36.69s)
=== CONT  TestAccCloudWatchCompositeAlarm_disappears
--- PASS: TestAccCloudWatchCompositeAlarm_description (39.19s)
--- PASS: TestAccCloudWatchCompositeAlarm_actionsEnabled (38.45s)
--- PASS: TestAccCloudWatchCompositeAlarm_allActions (39.73s)
--- PASS: TestAccCloudWatchMetricStream_additional_statistics (74.02s)
--- PASS: TestAccCloudWatchMetricStream_update (80.62s)
--- PASS: TestAccCloudWatchCompositeAlarm_insufficientDataActions (49.88s)
--- PASS: TestAccCloudWatchCompositeAlarm_disappears (14.83s)
--- PASS: TestAccCloudWatchCompositeAlarm_okActions (52.79s)
--- PASS: TestAccCloudWatchCompositeAlarm_alarmActions (46.83s)
--- PASS: TestAccCloudWatchMetricAlarm_tags (41.02s)
--- PASS: TestAccCloudWatchCompositeAlarm_tags (33.41s)
--- PASS: TestAccCloudWatchMetricAlarm_metricQuery (76.58s)
--- PASS: TestAccCloudWatchMetricAlarm_extendedStatistic (126.74s)
--- PASS: TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate (183.58s)
--- PASS: TestAccCloudWatchMetricStream_disappears (224.54s)
--- PASS: TestAccCloudWatchMetricStream_basic (227.35s)
--- PASS: TestAccCloudWatchMetricStream_nameGenerated (270.44s)
--- PASS: TestAccCloudWatchMetricStream_tags (281.39s)
--- PASS: TestAccCloudWatchMetricStream_includeLinkedAccountsMetrics (298.65s)
--- PASS: TestAccCloudWatchMetricStream_namePrefix (299.94s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch 306.790s

# Conflicts:
#	go.mod
#	go.sum
#	internal/conns/awsclient_gen.go
#	names/data/names_data.csv
#	names/names.go
@ewbankkit ewbankkit merged commit 6bf7cc4 into main Feb 6, 2024
44 checks passed
@ewbankkit ewbankkit deleted the td-migrate-cloudwatch-to-aws-sdk-v2 branch February 6, 2024 22:22
@github-actions github-actions bot added this to the v5.36.0 milestone Feb 6, 2024
github-actions bot pushed a commit that referenced this pull request Feb 6, 2024
Copy link

github-actions bot commented Feb 8, 2024

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

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 Mar 10, 2024
@justinretzolk justinretzolk added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

3 participants