fix edge case on ec2 query

This commit is contained in:
Emil Lerch 2023-08-14 13:44:26 -07:00
parent 9e02196dd0
commit 024ba8ee8f
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -202,6 +202,9 @@ pub fn main() anyerror!void {
const more = try aws.Request(services.ec2.describe_instances)
.call(.{ .next_token = next_token, .max_results = 6 }, options);
defer more.deinit();
// we could have exactly 6, which means we have a next token(?!) but not
// any actual additional data
if (more.response.reservations == null) break;
std.log.info("reservation count: {d}", .{more.response.reservations.?.len});
var batch_items: usize = 0;
for (more.response.reservations.?) |reservation| {