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

Invalid result in func (c *Route53) ListResourceRecordSetsPages #4386

Closed
karanpopat opened this issue May 4, 2022 · 7 comments
Closed

Invalid result in func (c *Route53) ListResourceRecordSetsPages #4386

karanpopat opened this issue May 4, 2022 · 7 comments
Assignees
Labels
bug This issue is a bug.

Comments

@karanpopat
Copy link

Describe the bug

The function ListResourceRecordSetsPages returns all the resources present in an account for the input

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordName : '<SomeName>'
}

even if <SomeName> is an invalid name.

Also returns error

Error: InvalidInput: 
        status code: 400, request id: ebe93e33-4272-422f-b595-bfd6ee9f0ae6 (SQLSTATE HV000)

when ListResourceRecordSetsInput has any StartRecordType set as input

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordType : 'A'
}

Expected Behavior

The function ListResourceRecordSetsPages should return the resources having an exact match for the entered StartRecordName

API should return results on setting StartRecordType as an input parameter

Current Behavior

The function ListResourceRecordSetsPages returns all the resources present in an account for the input

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordName : '<SomeName>'
}

even if <SomeName> is an invalid name.

Also returns error

Error: InvalidInput: 
        status code: 400, request id: ebe93e33-4272-422f-b595-bfd6ee9f0ae6 (SQLSTATE HV000)

when ListResourceRecordSetsInput has any StartRecordType set as input

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordType : 'A'
}

Reproduction Steps

Make an API call using ListResourceRecordSetsPages setting the parameters as below

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordName : '<SomeName>'
}

where <SomeName> is an invalid name.

Make an API call using ListResourceRecordSetsPages setting the parameters as below

&route53.ListResourceRecordSetsInput{
		HostedZoneId: &hostedZoneID,
		StartRecordType : 'A'
}

Possible Solution

No response

Additional Information/Context

No response

SDK version used

aws-sdk-go@v1.42.25

Environment details (Version of Go (go version)? OS name and version, etc.)

go version go1.18.1 darwin/arm64

@karanpopat
Copy link
Author

Hi, Any updates on this issue?
The CLI is working fine, but the issue is there in SDK.

@vudh1
Copy link
Contributor

vudh1 commented Jun 13, 2022

Hi @karanpopat thanks for bringing this to our attention. Can you check if this issue is persisting with the latest version of SDK v1.44.32 and provide us with the reproducible code that we can use to investigate this?

@vudh1 vudh1 added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 13, 2022
@github-actions
Copy link

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jun 16, 2022
@karanpopat
Copy link
Author

Hi, @vudh1 I checked using the SDK version v1.44.32, and the issue is still there.
Here's the reproducible code for it:

svc, err := Route53Service(ctx, d)
	if err != nil {
		return nil, err
	}

	input := &route53.ListResourceRecordSetsInput{
		HostedZoneId:   aws.String(hostedZoneID),
		MaxItems:        aws.String("1000"),
		StartRecordName: aws.String(&name),
	}

	err = svc.ListResourceRecordSetsPages(
		input,
		func(page *route53.ListResourceRecordSetsOutput, isLast bool) bool {
			plugin.Logger(ctx).Debug("-------------->>>>>>>>>>>", page)

			for _, record := range page.ResourceRecordSets {
				plugin.Logger(ctx).Debug("-------------->>>>>>>>>>>======>>>", record)
			}
			return *page.IsTruncated
		},
	)

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jun 17, 2022
@thapabishwa
Copy link

Any updates @vudh1 ?

@cbruno10
Copy link

@karanpopat believe you can close this issue, I think we originally misunderstood how the StartRecordName worked, as we were getting names that were greater in lexicographical order than the record name passed in, even if that record didn't exist (which is expected). For the StartRecordType, we weren't pairing that with StartRecordName, which is why we were getting an InvalidInput error (as expected, based on the constraint mentioned in documentation).

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants