public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonEC2Config config = new AmazonEC2Config(); config.RegionEndpoint = region; ConfigureClient(config); AmazonEC2Client client = new AmazonEC2Client(creds, config); DescribeCarrierGatewaysResponse resp = new DescribeCarrierGatewaysResponse(); do { DescribeCarrierGatewaysRequest req = new DescribeCarrierGatewaysRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.DescribeCarrierGateways(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.CarrierGateways) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }