aws

danm 2023-10-20T15:48:02.572319Z

Has anyone seen a change to the AWS API pagination system lately? I can't find any documentation about a change, the API docs still say the returned token should be between 1 and 1024 characters. But I'm making calls to the :cloudformation API and getting results back with a :NextToken that is 1076 characters long, and then a spec error from Cognitect when I try to apply that to the next request because it's outside spec

👀 1
onetom 2023-10-29T18:59:17.810849Z

we have noticed some change in the structure of ec2 describe instances api calls too.

danm 2023-10-20T15:48:36.604619Z

I have no idea if it would actually work as a token value, because I haven't looked into overriding the spec yet

scottbale 2023-10-20T15:52:25.077879Z

Can you work around the spec check by turning off validation?

(aws/validate-requests my-aws-api-client false)

danm 2023-10-20T15:53:51.058759Z

Ooh, I didn't even know you could do that. Thanks!

👍 1
🤞 1
danm 2023-10-20T15:56:55.842109Z

Yup! That worked 🙂 Thanks!

danm 2023-10-20T15:57:29.527419Z

So I would say this is a bug in the lib, but given that AWS's own spec says it shouldn't be possible for that field to be that long, I'm going to point the finger very firmly at them...

scottbale 2023-10-20T15:58:03.459829Z

Do you have a link to that spec handy?

danm 2023-10-20T16:02:32.027799Z

Aah, I wasn't actually using that in the 'official' context. I was going off https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackResources.html I am trying to find the schema that presumably is also what Cognitect build the Clojure SDK from, but I've not found it yet

1
scottbale 2023-10-20T16:06:32.770029Z

I was just looking for that, too. https://github.com/aws/aws-sdk-js/blob/3d94bab2d0881471606847df507cc9fe53bd9bf8/apis/cloudformation-2010-05-15.normal.json#L4436-L4440 (the latest commit as of this writing). Looks like it still specifies a max of 1024.

danm 2023-10-20T16:08:35.897909Z

I have no idea what has made this particular token very long, as I have several other stacks where the call works because the token comes back 900-odd chars, so I suspect it'll be pretty hard for you to reproduce. I can try and raise a ticket with AWS support? Although at the level we have I don't know how much attention they'll pay

scottbale 2023-10-20T16:14:11.334579Z

Just so I'm clear: even though this next token value has length 1076, you are able to pass it in a subsequent request to AWS, and it works? You get the next page of results? The token seems to function as a valid token, from Amazon's point-of-view? In that case, yes, it sure seems to be a bug on their end.

danm 2023-10-20T16:16:07.073259Z

Correct

ghadi 2023-10-20T16:16:14.302669Z

Validation shouldn’t be enabled by default

danm 2023-10-20T16:17:21.489999Z

I've gone and had a poke. We have an internal lib which sets up a client, adds some additional credential providers for web identity tokens and the like. That is explicitly turning it on. I'll have to make that optional 🙂

👍 1