Skip to content

Port to AWS Go SDK v2#6588

Merged
yongtang merged 2 commits into
coredns:masterfrom
skitt:aws-sdk-v2
Jul 3, 2025
Merged

Port to AWS Go SDK v2#6588
yongtang merged 2 commits into
coredns:masterfrom
skitt:aws-sdk-v2

Conversation

@skitt

@skitt skitt commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

1. Why is this pull request needed and what does it do?

v1 is deprecated, and support will end a little over a year from now. This ports the route53 plugin to v2.

The major difference is that listing resource records no longer uses a callback function; the results are retrieved directly, but paging has to be handled by the caller.

2. Which issues (if any) are related?

None.

3. Which documentation changes (if any) need to be made?

None.

4. Does this introduce a backward incompatible change or deprecation?

None.

Comment thread plugin/route53/setup.go Outdated
@codecov

codecov Bot commented Apr 5, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 49.09091% with 28 lines in your changes missing coverage. Please review.

Project coverage is 59.95%. Comparing base (93c57b6) to head (78e2223).
Report is 1519 commits behind head on master.

Files with missing lines Patch % Lines
plugin/route53/setup.go 25.00% 19 Missing and 2 partials ⚠️
plugin/route53/route53.go 74.07% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6588      +/-   ##
==========================================
+ Coverage   55.70%   59.95%   +4.25%     
==========================================
  Files         224      273      +49     
  Lines       10016    18008    +7992     
==========================================
+ Hits         5579    10796    +5217     
- Misses       3978     6581    +2603     
- Partials      459      631     +172     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jayanthvn

Copy link
Copy Markdown

Hi, Is there any plans to merge this PR?

@skitt skitt marked this pull request as ready for review March 14, 2025 10:37
@dilyevsky dilyevsky self-assigned this Mar 14, 2025
@jayanthvn

Copy link
Copy Markdown

@dilyevsky - Is it possible to please expedite the PR review? We are waiting for the release.

@jaydeokar

Copy link
Copy Markdown

Can we fix the merge conflicts ? @skitt

@dims

dims commented Jun 17, 2025

Copy link
Copy Markdown

cc @johnbelamaric @yongtang

@jaydeokar

Copy link
Copy Markdown

Testing these changes -
It seems like you have to pass a region or a non-null string while creating a route53 client.
aws/aws-sdk-go-v2#1778 - Similar issue.

This can be fixed by passing an env variable AWS_REGION, but it might break existing users of this plugin.

Comment thread plugin/route53/setup.go Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use IMDS to get the AWS_REGION if the region flag is not set ?

	if cfg.Region == "" {
	   imdsClient := imds.NewFromConfig(cfg)
	   region, err := imdsClient.GetRegion(ctx, &imds.GetRegionInput{})
	   if err != nil {
	       return nil, log.Fatalf("failed to get region from IMDS: %v", e)
	   }
	   cfg.Region = r.Region
	 }

The reason being SDK v1 used to have a default fallback region (aws global partition), which no longer exists in sdk v2. So unsuspecting users of this plugin who have not been setting a region flag will start seeing failures post upgrade..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this, I’ll update the PR when I return from PTO next week.

v1 is deprecated, and support will end a little over a year from now.
This ports the route53 plugin to v2.

The major difference is that listing resource records no longer uses a
callback function; the results are retrieved directly, but paging has
to be handled by the caller.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@skitt skitt requested a review from jaydeokar June 25, 2025 09:22
@yongtang yongtang merged commit 1449cb6 into coredns:master Jul 3, 2025
13 checks passed
@skitt skitt deleted the aws-sdk-v2 branch July 3, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants