-
Notifications
You must be signed in to change notification settings - Fork 648
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
route53 ListResourceRecordSetsInput doesn't work when HostedZoneId contains "/hostedzone/" #843
Comments
Thanks for reporting this issue @CB-GuangyaoXie. It looks like the SDK is generating the customization that removes the The customization |
Looks like I was looking at the wrong about the ordering of the middleware in my comment above. The following code can reproduce the issue: package main
import (
"context"
"log"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/route53"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/smithy-go/transport/http"
)
func main() {
cfg, err := config.LoadDefaultConfig()
if err != nil {
log.Fatalf("unable to load config, %v", err)
}
client := route53.NewFromConfig(cfg, func(o *route53.Options) {
o.HTTPClient = smithyhttp.WrapLogClient(logger{}, aws.NewBuildableHTTPClient(), true)
})
token := "blah"
zoneID := "/hostedzone/xxxxxxxxxxx"
_, err = client.ListResourceRecordSets(context.Background(), &route53.ListResourceRecordSetsInput{
HostedZoneId: &zoneID,
StartRecordName: &token,
}, func(o *route53.Options) {
o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
log.Println(stack.String())
return nil
})
})
if err != nil {
log.Fatalf("request failed, %v", err)
}
}
type logger struct{}
func (logger) Logf(format string, args ...interface{}) {
log.Printf(format, args...)
} This results in the following HTTP request and SDK error:
With the following error:
The operation's middleware stack looks correct.
|
Looks like the issue is that the SDK's customization for the ListResourceRecordSets that trims the |
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
Using
/hostedzone/xxxxx
in HostedZoneId field in ListResourceRecordSetsInput results in unknown error from AWS API.I know there is this sanitizeHostedZoneIDInput function in the code base but somehow I had to trim
/hostedzone/
prefix to avoid the error.Version of AWS SDK for Go?
v0.27.0
Version of Go (
go version
)?go version go1.15.3 darwin/amd64
To Reproduce (observed behavior)
This resulted in error:
It works if I trim the prefix like
aws.String(strings.ReplaceAll(zoneID, "/hostedzone/", ""))
Expected behavior
Given ListHostedZones() now returns hostedZoneID in the format of
/hostedzone/xxxxx
, the module should parse it correctly.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: