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

ListTagsForResourceOutput.NextMarker with empty string #3513

Closed
3 tasks done
anton-yurchenko opened this issue Aug 29, 2020 · 2 comments
Closed
3 tasks done

ListTagsForResourceOutput.NextMarker with empty string #3513

anton-yurchenko opened this issue Aug 29, 2020 · 2 comments
Labels
bug This issue is a bug.

Comments

@anton-yurchenko
Copy link

anton-yurchenko commented Aug 29, 2020

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
ListTagsForResource return NextMarker as empty string instead of nil.

I have a single CloudFront WAF IP Set which I am trying to retrieve with ListTagsForResource and I expect NextMarker to return nil as described here but instead it returns as empty string and causes the following error on next iteration:

InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, ListTagsForResourceInput.NextMarker.

P.S: just in case this may collide somehow, I have some IP match conditions on "classic" (v1) WAF

Version of AWS SDK for Go?

1.34.13

Version of Go (go version)?

go version go1.14.2 darwin/amd64

To Reproduce (observed behavior)

package main

import (
	"fmt"
	"os"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/wafv2"
)

func main() {
	s := session.Must(session.NewSession())
	cli := wafv2.New(s)

	var token *string
	for {
		o, err := cli.ListTagsForResource(&wafv2.ListTagsForResourceInput{
			Limit:       aws.Int64(1),
			ResourceARN: aws.String("arn:aws:wafv2:us-east-1:<account-id>:global/ipset/<ipset-name>/<ipset-id>"),
			NextMarker:  token,
		})
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		if o.NextMarker != nil {
			token = o.NextMarker
			fmt.Printf("-> next marker: '%v'\n", *o.NextMarker)
		} else {
			break
		}
	}
}
-> next marker: ''
InvalidParameter: 1 validation error(s) found.
- minimum field size of 1, ListTagsForResourceInput.NextMarker.

exit status 1

Expected behavior
NextMarker should be returned only if there are more resources to retrieve, otherwise nil.

Quote from docs:

When you request a list of objects with a Limit setting, if the number of objects that are still available for retrieval exceeds the limit, AWS WAF returns a NextMarker value in the response.

@anton-yurchenko anton-yurchenko added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 29, 2020
@skmcgrail skmcgrail removed the needs-triage This issue or PR still needs to be triaged. label Mar 26, 2021
@skotambkar
Copy link
Contributor

We do not have plans to fix this in V1 SDK. The aws/aws-sdk-go-v2 has fixed this issue.

@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

3 participants