Repository navigation
fix(amp): omit unchanged destination on scraper update to prevent CloudWatch destination failure 🤖🤖🤖 - #50463
Conversation
…udWatch destination failure
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
ewbankkit
left a comment
There was a problem hiding this comment.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccAMPScraper_cloudWatchDestination\|TestAccAMPScraper_alias' PKG=amp
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Validating schemas
ok github.com/hashicorp/terraform-provider-aws/internal/provider/sdkv2 5.899s
ok github.com/hashicorp/terraform-provider-aws/internal/provider/framework 5.919s
make: Running acceptance tests on branch: 🌿 HEAD 🌿...
TF_ACC=1 go1.26.9 test ./internal/service/amp/... -v -count 1 -parallel 20 -run=TestAccAMPScraper_cloudWatchDestination\|TestAccAMPScraper_alias -timeout 360m -vet=off -buildvcs=false
2026/10/15 11:55:16 Creating Terraform AWS Provider (SDKv2-style)...
2026/10/15 11:55:16 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccAMPScraper_alias
=== PAUSE TestAccAMPScraper_alias
=== RUN TestAccAMPScraper_cloudWatchDestination
=== PAUSE TestAccAMPScraper_cloudWatchDestination
=== CONT TestAccAMPScraper_alias
=== CONT TestAccAMPScraper_cloudWatchDestination
--- PASS: TestAccAMPScraper_cloudWatchDestination (1804.96s)
--- PASS: TestAccAMPScraper_alias (2636.91s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/amp 2643.000s|
@somaz94 Thanks for the contribution 🎉 👏. |
|
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
|
This functionality has been released in v6.70.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! |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
No. This change only affects which fields are sent in the
UpdateScraperrequest.Description
Updating any in-place attribute (for example
scrape_configuration) of anaws_prometheus_scraperwith a CloudWatchdestinationfails, because the provider always sendsdestinationin theUpdateScraperrequest, and the API rejects it for CloudWatch destinations even when the value is unchanged.This PR leaves
Destinationout of the update input when it has not changed (new.Destination.Equal(old.Destination)). Whendestinationdoes change, it is still sent as before, so behavior for AMP destinations is unchanged.TestAccAMPScraper_cloudWatchDestinationgets an extra step that changesscrape_intervalfrom30sto60sto exercise the in-place update path, followed by an import verification step. The config helpertestAccScraperConfig_cloudWatchDestinationtakes an optional interval argument so existing callers keep working.AI usage disclosure
An LLM agent was used to help locate the update code path, draft the fix and the extra acceptance test step, and draft this description. I reviewed every changed line and the package compiles (
go test -run '^$' ./internal/service/amp/...).Relations
Closes #50421
References
UpdateScraperAPI referenceOutput from Acceptance Testing
I do not have access to an AWS environment that can provision the VPC and CloudWatch resources this test needs, so I have not been able to run the acceptance tests. I would appreciate it if a maintainer could run:
% make testacc TESTS=TestAccAMPScraper_cloudWatchDestination PKG=ampThe new step updates
scrape_intervalin place and should pass with this change, and fail with the currentmain.