Repository: cloud-custodian/cloud-custodian

Issue:
policies where Resource=user-pool results in error=Missing required parameter in input: "MaxResults" 
A user-pool based resource policy results in an error for missing required parameter=MaxResults
```
policies:
  - name: RequiredTagsAbsentCognitoUserPool
    resource: user-pool
    description: |
      Notify if Required tags Absent
    filters:
      - "tag:OwnerEmail": absent
```
2017-08-03 22:49:43,321: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/c7n/policy.py", line 306, in run
    resources = self.policy.resource_manager.resources()
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/c7n/query.py", line 292, in resources
    resources = self.augment(self.source.resources(query))
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/c7n/query.py", line 154, in resources
    resources = self.query.filter(self.manager.resource_type, **query)
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/c7n/query.py", line 67, in filter
    data = op(**params)
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/botocore/client.py", line 310, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/botocore/client.py", line 573, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/botocore/client.py", line 628, in _convert_to_request_dict
    api_params, operation_model)
  File "/mnt/home2/opensrc/cloud-custodian-public-release/.tox/py27/local/lib/python2.7/site-packages/botocore/validate.py", line 291, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
ParamValidationError: Parameter validation failed:
Missing required parameter in input: "MaxResults"


Discussion:

Resolving patch:
diff --git a/c7n/resources/cognito.py b/c7n/resources/cognito.py
--- a/c7n/resources/cognito.py
+++ b/c7n/resources/cognito.py
@@ -22,9 +22,9 @@ class CognitoIdentityPool(QueryResourceManager):
 
     class resource_type(object):
         service = 'cognito-identity'
-        enum_spec = ('list_identity_pools', 'IdentityPools', None)
+        enum_spec = ('list_identity_pools', 'IdentityPools', {'MaxResults': 60})
         detail_spec = (
-            'describe_identity_pool', 'IdentityPoolId', 'IdentityPoolId')
+            'describe_identity_pool', 'IdentityPoolId', 'IdentityPoolId', None)
         id = 'IdentityPoolId'
         name = 'IdentityPoolName'
         filter_name = None
@@ -36,7 +36,7 @@ class CognitoUserPool(QueryResourceManager):
 
     class resource_type(object):
         service = "cognito-idp"
-        enum_spec = ('list_user_pools', 'UserPools', None)
+        enum_spec = ('list_user_pools', 'UserPools', {'MaxResults': 60})
         detail_spec = (
             'describe_user_pool', 'UserPoolId', 'Id', 'UserPool')
         id = 'Id'


Test patch:
diff --git a/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_1.json b/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_1.json
@@ -0,0 +1,278 @@
+{
+    "status_code": 200, 
+    "data": {
+        "UserPool": {
+            "AliasAttributes": [
+                "email"
+            ], 
+            "SchemaAttributes": [
+                {
+                    "Name": "sub", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "1", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": true, 
+                    "AttributeDataType": "String", 
+                    "Mutable": false
+                }, 
+                {
+                    "Name": "name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "given_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "family_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "middle_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "nickname", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "preferred_username", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "profile", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "picture", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "website", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "email", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": true, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "AttributeDataType": "Boolean", 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "Name": "email_verified", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "gender", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "birthdate", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "10", 
+                        "MaxLength": "10"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "zoneinfo", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "locale", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "phone_number", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "AttributeDataType": "Boolean", 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "Name": "phone_number_verified", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "address", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "updated_at", 
+                    "NumberAttributeConstraints": {
+                        "MinValue": "0"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "Number", 
+                    "Mutable": true
+                }
+            ], 
+            "MfaConfiguration": "OFF", 
+            "Name": "origin_userpool_MOBILEHUB_1667653900", 
+            "LastModifiedDate": {
+                "hour": 18, 
+                "__class__": "datetime", 
+                "month": 1, 
+                "second": 26, 
+                "microsecond": 155000, 
+                "year": 2017, 
+                "day": 8, 
+                "minute": 13
+            }, 
+            "AdminCreateUserConfig": {
+                "UnusedAccountValidityDays": 7, 
+                "AllowAdminCreateUserOnly": false
+            }, 
+            "EmailConfiguration": {}, 
+            "AutoVerifiedAttributes": [
+                "email"
+            ], 
+            "Policies": {
+                "PasswordPolicy": {
+                    "RequireLowercase": true, 
+                    "RequireSymbols": true, 
+                    "RequireNumbers": true, 
+                    "MinimumLength": 8, 
+                    "RequireUppercase": true
+                }
+            }, 
+            "UserPoolTags": {}, 
+            "CreationDate": {
+                "hour": 18, 
+                "__class__": "datetime", 
+                "month": 1, 
+                "second": 26, 
+                "microsecond": 155000, 
+                "year": 2017, 
+                "day": 8, 
+                "minute": 13
+            }, 
+            "EstimatedNumberOfUsers": 0, 
+            "Id": "us-east-1_W6ST8sYH6", 
+            "LambdaConfig": {}
+        }, 
+        "ResponseMetadata": {
+            "RetryAttempts": 0, 
+            "HTTPStatusCode": 200, 
+            "RequestId": "a7464538-7f54-11e7-84c4-97fb370f1e33", 
+            "HTTPHeaders": {
+                "date": "Sat, 12 Aug 2017 11:52:01 GMT", 
+                "x-amzn-requestid": "a7464538-7f54-11e7-84c4-97fb370f1e33", 
+                "content-length": "4047", 
+                "content-type": "application/x-amz-json-1.1", 
+                "connection": "keep-alive"
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_2.json b/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_2.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_cognito-user-pool/cognito-idp.DescribeUserPool_2.json
@@ -0,0 +1,279 @@
+{
+    "status_code": 200, 
+    "data": {
+        "UserPool": {
+            "SmsVerificationMessage": "Your verification code is {####}.", 
+            "SchemaAttributes": [
+                {
+                    "Name": "sub", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "1", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": true, 
+                    "AttributeDataType": "String", 
+                    "Mutable": false
+                }, 
+                {
+                    "Name": "name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "given_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "family_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "middle_name", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "nickname", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "preferred_username", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "profile", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "picture", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "website", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "email", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": true, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "AttributeDataType": "Boolean", 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "Name": "email_verified", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "gender", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "birthdate", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "10", 
+                        "MaxLength": "10"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "zoneinfo", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "locale", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "phone_number", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "AttributeDataType": "Boolean", 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "Name": "phone_number_verified", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "address", 
+                    "StringAttributeConstraints": {
+                        "MinLength": "0", 
+                        "MaxLength": "2048"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "String", 
+                    "Mutable": true
+                }, 
+                {
+                    "Name": "updated_at", 
+                    "NumberAttributeConstraints": {
+                        "MinValue": "0"
+                    }, 
+                    "DeveloperOnlyAttribute": false, 
+                    "Required": false, 
+                    "AttributeDataType": "Number", 
+                    "Mutable": true
+                }
+            ], 
+            "EmailVerificationSubject": "Your verification code", 
+            "MfaConfiguration": "OFF", 
+            "Name": "c7nusers", 
+            "EmailVerificationMessage": "Your verification code is {####}.", 
+            "SmsAuthenticationMessage": "Your authentication code is {####}.", 
+            "LastModifiedDate": {
+                "hour": 7, 
+                "__class__": "datetime", 
+                "month": 7, 
+                "second": 19, 
+                "microsecond": 389000, 
+                "year": 2016, 
+                "day": 24, 
+                "minute": 12
+            }, 
+            "AdminCreateUserConfig": {
+                "UnusedAccountValidityDays": 7, 
+                "AllowAdminCreateUserOnly": false
+            }, 
+            "EmailConfiguration": {}, 
+            "AutoVerifiedAttributes": [
+                "email"
+            ], 
+            "Policies": {
+                "PasswordPolicy": {
+                    "RequireLowercase": true, 
+                    "RequireSymbols": true, 
+                    "RequireNumbers": true, 
+                    "MinimumLength": 8, 
+                    "RequireUppercase": true
+                }
+            }, 
+            "UserPoolTags": {}, 
+            "CreationDate": {
+                "hour": 7, 
+                "__class__": "datetime", 
+                "month": 7, 
+                "second": 54, 
+                "microsecond": 416000, 
+                "year": 2016, 
+                "day": 24, 
+                "minute": 11
+            }, 
+            "EstimatedNumberOfUsers": 0, 
+            "Id": "us-east-1_xzq8X91on", 
+            "LambdaConfig": {}
+        }, 
+        "ResponseMetadata": {
+            "RetryAttempts": 0, 
+            "HTTPStatusCode": 200, 
+            "RequestId": "a75d00cf-7f54-11e7-9a6e-b7204bf4a31a", 
+            "HTTPHeaders": {
+                "date": "Sat, 12 Aug 2017 11:52:01 GMT", 
+                "x-amzn-requestid": "a75d00cf-7f54-11e7-9a6e-b7204bf4a31a", 
+                "content-length": "4371", 
+                "content-type": "application/x-amz-json-1.1", 
+                "connection": "keep-alive"
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_cognito-user-pool/cognito-idp.ListUserPools_1.json b/tests/data/placebo/test_cognito-user-pool/cognito-idp.ListUserPools_1.json
new file mode 100644
--- /dev/null
+++ b/tests/data/placebo/test_cognito-user-pool/cognito-idp.ListUserPools_1.json
@@ -0,0 +1,69 @@
+{
+    "status_code": 200, 
+    "data": {
+        "UserPools": [
+            {
+                "CreationDate": {
+                    "hour": 18, 
+                    "__class__": "datetime", 
+                    "month": 1, 
+                    "second": 26, 
+                    "microsecond": 155000, 
+                    "year": 2017, 
+                    "day": 8, 
+                    "minute": 13
+                }, 
+                "LastModifiedDate": {
+                    "hour": 18, 
+                    "__class__": "datetime", 
+                    "month": 1, 
+                    "second": 26, 
+                    "microsecond": 155000, 
+                    "year": 2017, 
+                    "day": 8, 
+                    "minute": 13
+                }, 
+                "LambdaConfig": {}, 
+                "Id": "us-east-1_W6ST8sYH6", 
+                "Name": "origin_userpool_MOBILEHUB_1667653900"
+            }, 
+            {
+                "CreationDate": {
+                    "hour": 7, 
+                    "__class__": "datetime", 
+                    "month": 7, 
+                    "second": 54, 
+                    "microsecond": 416000, 
+                    "year": 2016, 
+                    "day": 24, 
+                    "minute": 11
+                }, 
+                "LastModifiedDate": {
+                    "hour": 7, 
+                    "__class__": "datetime", 
+                    "month": 7, 
+                    "second": 19, 
+                    "microsecond": 389000, 
+                    "year": 2016, 
+                    "day": 24, 
+                    "minute": 12
+                }, 
+                "LambdaConfig": {}, 
+                "Id": "us-east-1_xzq8X91on", 
+                "Name": "c7nusers"
+            }
+        ], 
+        "ResponseMetadata": {
+            "RetryAttempts": 0, 
+            "HTTPStatusCode": 200, 
+            "RequestId": "a71a2b81-7f54-11e7-b9c9-a584e55a17f8", 
+            "HTTPHeaders": {
+                "date": "Sat, 12 Aug 2017 11:52:01 GMT", 
+                "x-amzn-requestid": "a71a2b81-7f54-11e7-b9c9-a584e55a17f8", 
+                "content-length": "309", 
+                "content-type": "application/x-amz-json-1.1", 
+                "connection": "keep-alive"
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/test_cognito.py b/tests/test_cognito.py
new file mode 100644
--- /dev/null
+++ b/tests/test_cognito.py
@@ -0,0 +1,30 @@
+# Copyright 2017 Capital One Services, LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from __future__ import absolute_import, division, print_function, unicode_literals
+
+from .common import BaseTest
+
+
+class UserPool(BaseTest):
+
+    def test_query_user_pool(self):
+        factory = self.replay_flight_data('test_cognito-user-pool')
+        p = self.load_policy({
+            'name': 'users',
+            'resource': 'user-pool'
+        }, session_factory=factory)
+        resources = p.run()
+        self.assertEqual(
+            sorted([n['Name'] for n in resources]),
+            ['c7nusers', 'origin_userpool_MOBILEHUB_1667653900'])