SearchResources

class Macie2.Paginator.SearchResources
paginator = client.get_paginator('search_resources')
paginate(**kwargs)

Creates an iterator that will paginate through responses from Macie2.Client.search_resources().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    bucketCriteria={
        'excludes': {
            'and': [
                {
                    'simpleCriterion': {
                        'comparator': 'EQ'|'NE',
                        'key': 'ACCOUNT_ID'|'S3_BUCKET_NAME'|'S3_BUCKET_EFFECTIVE_PERMISSION'|'S3_BUCKET_SHARED_ACCESS',
                        'values': [
                            'string',
                        ]
                    },
                    'tagCriterion': {
                        'comparator': 'EQ'|'NE',
                        'tagValues': [
                            {
                                'key': 'string',
                                'value': 'string'
                            },
                        ]
                    }
                },
            ]
        },
        'includes': {
            'and': [
                {
                    'simpleCriterion': {
                        'comparator': 'EQ'|'NE',
                        'key': 'ACCOUNT_ID'|'S3_BUCKET_NAME'|'S3_BUCKET_EFFECTIVE_PERMISSION'|'S3_BUCKET_SHARED_ACCESS',
                        'values': [
                            'string',
                        ]
                    },
                    'tagCriterion': {
                        'comparator': 'EQ'|'NE',
                        'tagValues': [
                            {
                                'key': 'string',
                                'value': 'string'
                            },
                        ]
                    }
                },
            ]
        }
    },
    sortCriteria={
        'attributeName': 'ACCOUNT_ID'|'RESOURCE_NAME'|'S3_CLASSIFIABLE_OBJECT_COUNT'|'S3_CLASSIFIABLE_SIZE_IN_BYTES',
        'orderBy': 'ASC'|'DESC'
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • bucketCriteria (dict) --

    The filter conditions that determine which S3 buckets to include or exclude from the query results.

    • excludes (dict) --

      The property- and tag-based conditions that determine which buckets to exclude from the results.

      • and (list) --

        An array of objects, one for each property- or tag-based condition that includes or excludes resources from the query results. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.

        • (dict) --

          Specifies a property- or tag-based filter condition for including or excluding Amazon Web Services resources from the query results.

          • simpleCriterion (dict) --

            A property-based condition that defines a property, operator, and one or more values for including or excluding resources from the results.

            • comparator (string) --

              The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

            • key (string) --

              The property to use in the condition.

            • values (list) --

              An array that lists one or more values to use in the condition. If you specify multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) are:

              • ACCOUNT_ID - A string that represents the unique identifier for the Amazon Web Services account that owns the resource.
              • S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie defines for the BucketPublicAccess.effectivePermission property of an S3 bucket.
              • S3_BUCKET_NAME - A string that represents the name of an S3 bucket.
              • S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that Macie defines for the BucketMetadata.sharedAccess property of an S3 bucket.

              Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in values.

              • (string) --
          • tagCriterion (dict) --

            A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding resources from the results.

            • comparator (string) --

              The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

            • tagValues (list) --

              The tag keys, tag values, or tag key and value pairs to use in the condition.

              • (dict) --

                Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in a tag-based filter condition for a query. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based filter conditions.

                • key (string) --

                  The value for the tag key to use in the condition.

                • value (string) --

                  The tag value to use in the condition.

    • includes (dict) --

      The property- and tag-based conditions that determine which buckets to include in the results.

      • and (list) --

        An array of objects, one for each property- or tag-based condition that includes or excludes resources from the query results. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.

        • (dict) --

          Specifies a property- or tag-based filter condition for including or excluding Amazon Web Services resources from the query results.

          • simpleCriterion (dict) --

            A property-based condition that defines a property, operator, and one or more values for including or excluding resources from the results.

            • comparator (string) --

              The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

            • key (string) --

              The property to use in the condition.

            • values (list) --

              An array that lists one or more values to use in the condition. If you specify multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) are:

              • ACCOUNT_ID - A string that represents the unique identifier for the Amazon Web Services account that owns the resource.
              • S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie defines for the BucketPublicAccess.effectivePermission property of an S3 bucket.
              • S3_BUCKET_NAME - A string that represents the name of an S3 bucket.
              • S3_BUCKET_SHARED_ACCESS - A string that represents an enumerated value that Macie defines for the BucketMetadata.sharedAccess property of an S3 bucket.

              Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in values.

              • (string) --
          • tagCriterion (dict) --

            A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding resources from the results.

            • comparator (string) --

              The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

            • tagValues (list) --

              The tag keys, tag values, or tag key and value pairs to use in the condition.

              • (dict) --

                Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in a tag-based filter condition for a query. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based filter conditions.

                • key (string) --

                  The value for the tag key to use in the condition.

                • value (string) --

                  The tag value to use in the condition.

  • sortCriteria (dict) --

    The criteria to use to sort the results.

    • attributeName (string) --

      The property to sort the results by.

    • orderBy (string) --

      The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'matchingResources': [
        {
            'matchingBucket': {
                'accountId': 'string',
                'bucketName': 'string',
                'classifiableObjectCount': 123,
                'classifiableSizeInBytes': 123,
                'errorCode': 'ACCESS_DENIED',
                'errorMessage': 'string',
                'jobDetails': {
                    'isDefinedInJob': 'TRUE'|'FALSE'|'UNKNOWN',
                    'isMonitoredByJob': 'TRUE'|'FALSE'|'UNKNOWN',
                    'lastJobId': 'string',
                    'lastJobRunTime': datetime(2015, 1, 1)
                },
                'lastAutomatedDiscoveryTime': datetime(2015, 1, 1),
                'objectCount': 123,
                'objectCountByEncryptionType': {
                    'customerManaged': 123,
                    'kmsManaged': 123,
                    's3Managed': 123,
                    'unencrypted': 123,
                    'unknown': 123
                },
                'sensitivityScore': 123,
                'sizeInBytes': 123,
                'sizeInBytesCompressed': 123,
                'unclassifiableObjectCount': {
                    'fileType': 123,
                    'storageClass': 123,
                    'total': 123
                },
                'unclassifiableObjectSizeInBytes': {
                    'fileType': 123,
                    'storageClass': 123,
                    'total': 123
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    The request succeeded.

    • matchingResources (list) --

      An array of objects, one for each resource that matches the filter criteria specified in the request.

      • (dict) --

        Provides statistical data and other information about an Amazon Web Services resource that Amazon Macie monitors and analyzes for your account.

        • matchingBucket (dict) --

          The details of an S3 bucket that Amazon Macie monitors and analyzes.

          • accountId (string) --

            The unique identifier for the Amazon Web Services account that owns the bucket.

          • bucketName (string) --

            The name of the bucket.

          • classifiableObjectCount (integer) --

            The total number of objects that Amazon Macie can analyze in the bucket. These objects use a supported storage class and have a file name extension for a supported file or storage format.

          • classifiableSizeInBytes (integer) --

            The total storage size, in bytes, of the objects that Amazon Macie can analyze in the bucket. These objects use a supported storage class and have a file name extension for a supported file or storage format.

            If versioning is enabled for the bucket, Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

          • errorCode (string) --

            The error code for an error that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. If this value is ACCESS_DENIED, Macie doesn't have permission to retrieve the information. For example, the bucket has a restrictive bucket policy and Amazon S3 denied the request. If this value is null, Macie was able to retrieve and process the information.

          • errorMessage (string) --

            A brief description of the error (errorCode) that prevented Amazon Macie from retrieving and processing information about the bucket and the bucket's objects. This value is null if Macie was able to retrieve and process the information.

          • jobDetails (dict) --

            Specifies whether any one-time or recurring classification jobs are configured to analyze objects in the bucket, and, if so, the details of the job that ran most recently.

            • isDefinedInJob (string) --

              Specifies whether any one-time or recurring jobs are configured to analyze data in the bucket. Possible values are:

              • TRUE - The bucket is explicitly included in the bucket definition (S3BucketDefinitionForJob) for one or more jobs and at least one of those jobs has a status other than CANCELLED. Or the bucket matched the bucket criteria (S3BucketCriteriaForJob) for at least one job that previously ran.
              • FALSE - The bucket isn't explicitly included in the bucket definition (S3BucketDefinitionForJob) for any jobs, all the jobs that explicitly include the bucket in their bucket definitions have a status of CANCELLED, or the bucket didn't match the bucket criteria (S3BucketCriteriaForJob) for any jobs that previously ran.
              • UNKNOWN - An exception occurred when Amazon Macie attempted to retrieve job data for the bucket.
            • isMonitoredByJob (string) --

              Specifies whether any recurring jobs are configured to analyze data in the bucket. Possible values are:

              • TRUE - The bucket is explicitly included in the bucket definition (S3BucketDefinitionForJob) for one or more recurring jobs or the bucket matches the bucket criteria (S3BucketCriteriaForJob) for one or more recurring jobs. At least one of those jobs has a status other than CANCELLED.
              • FALSE - The bucket isn't explicitly included in the bucket definition (S3BucketDefinitionForJob) for any recurring jobs, the bucket doesn't match the bucket criteria (S3BucketCriteriaForJob) for any recurring jobs, or all the recurring jobs that are configured to analyze data in the bucket have a status of CANCELLED.
              • UNKNOWN - An exception occurred when Amazon Macie attempted to retrieve job data for the bucket.
            • lastJobId (string) --

              The unique identifier for the job that ran most recently and is configured to analyze data in the bucket, either the latest run of a recurring job or the only run of a one-time job.

              This value is typically null if the value for the isDefinedInJob property is FALSE or UNKNOWN.

            • lastJobRunTime (datetime) --

              The date and time, in UTC and extended ISO 8601 format, when the job (lastJobId) started. If the job is a recurring job, this value indicates when the most recent run started.

              This value is typically null if the value for the isDefinedInJob property is FALSE or UNKNOWN.

          • lastAutomatedDiscoveryTime (datetime) --

            The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most recently analyzed data in the bucket while performing automated sensitive data discovery for your account. This value is null if automated sensitive data discovery is currently disabled for your account.

          • objectCount (integer) --

            The total number of objects in the bucket.

          • objectCountByEncryptionType (dict) --

            The total number of objects in the bucket, grouped by server-side encryption type. This includes a grouping that reports the total number of objects that aren't encrypted or use client-side encryption.

            • customerManaged (integer) --

              The total number of objects that are encrypted with a customer-provided key. The objects use customer-provided server-side encryption (SSE-C).

            • kmsManaged (integer) --

              The total number of objects that are encrypted with an KMS key, either an Amazon Web Services managed key or a customer managed key. The objects use KMS encryption (SSE-KMS).

            • s3Managed (integer) --

              The total number of objects that are encrypted with an Amazon S3 managed key. The objects use Amazon S3 managed encryption (SSE-S3).

            • unencrypted (integer) --

              The total number of objects that aren't encrypted or use client-side encryption.

            • unknown (integer) --

              The total number of objects that Amazon Macie doesn't have current encryption metadata for. Macie can't provide current data about the encryption settings for these objects.

          • sensitivityScore (integer) --

            The current sensitivity score for the bucket, ranging from -1 (classification error) to 100 (sensitive). This value is null if automated sensitive data discovery is currently disabled for your account.

          • sizeInBytes (integer) --

            The total storage size, in bytes, of the bucket.

            If versioning is enabled for the bucket, Amazon Macie calculates this value based on the size of the latest version of each object in the bucket. This value doesn't reflect the storage size of all versions of each object in the bucket.

          • sizeInBytesCompressed (integer) --

            The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the bucket.

            If versioning is enabled for the bucket, Amazon Macie calculates this value based on the size of the latest version of each applicable object in the bucket. This value doesn't reflect the storage size of all versions of each applicable object in the bucket.

          • unclassifiableObjectCount (dict) --

            The total number of objects that Amazon Macie can't analyze in the bucket. These objects don't use a supported storage class or don't have a file name extension for a supported file or storage format.

            • fileType (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects don't have a file name extension for a supported file or storage format.

            • storageClass (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class.

            • total (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class or don't have a file name extension for a supported file or storage format.

          • unclassifiableObjectSizeInBytes (dict) --

            The total storage size, in bytes, of the objects that Amazon Macie can't analyze in the bucket. These objects don't use a supported storage class or don't have a file name extension for a supported file or storage format.

            • fileType (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects don't have a file name extension for a supported file or storage format.

            • storageClass (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class.

            • total (integer) --

              The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class or don't have a file name extension for a supported file or storage format.

    • NextToken (string) --

      A token to resume pagination.