Exemple #1
0
        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);

            DescribeIamInstanceProfileAssociationsResponse resp = new DescribeIamInstanceProfileAssociationsResponse();

            do
            {
                DescribeIamInstanceProfileAssociationsRequest req = new DescribeIamInstanceProfileAssociationsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.DescribeIamInstanceProfileAssociations(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.IamInstanceProfileAssociations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }