Data Sources - Search
The Search Data Sources resource provides statistical data and other information about AWS resources that Amazon Macie monitors and analyzes for your account. The information includes quantitative breakdowns that indicate how much data Macie can analyze to detect sensitive data in a resource, and whether and when that analysis occurred. The data is available for all the AWS resources that Macie monitors and analyzes for your account.
Note that complete data is available for a resource only if Macie can retrieve and process information about the resource. If a resource's permissions settings or an error prevents Macie from retrieving and processing information about a resource, the available statistical data and other information is limited. In this case, the data includes only a subset of the resource's properties, such as the name of the resource and the account ID for the AWS account that owns the resource.
In addition to querying data, you can use this resource to build, test, and refine
runtime criteria for new classification jobs. These criteria can determine which
Amazon Simple Storage Service (Amazon S3) buckets a job analyzes when it runs. For existing
classification jobs, you can use this resource to create a snapshot of the S3 buckets that
currently match the criteria. The SearchResourcesBucketCriteria
structure for the Search Data
Sources resource is the same as the S3BucketCriteriaForJob
structure for
classification jobs. To learn more about specifying runtime criteria for jobs, see
Scope options for jobs
in the Amazon Macie User Guide.
You can use the Search Data Sources resource to query (retrieve) statistical data and other information about AWS resources that Macie monitors and analyzes for your account. To customize and refine your query, you can use the supported parameters to specify how to filter, sort, and paginate the query results. You can also use this resource to build and test S3 bucket criteria for classification jobs.
URI
/datasources/search-resources
HTTP methods
POST
Operation ID: SearchResources
Retrieves (queries) statistical data and other information about AWS resources that Amazon Macie monitors and analyzes.
Responses | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Status code | Response model | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
200 | SearchResourcesResponse | The request succeeded. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
400 | ValidationException | The request failed because the input doesn't satisfy the constraints specified by the service. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
402 | ServiceQuotaExceededException | The request failed because fulfilling the request would exceed one or more service quotas for your account. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
403 | AccessDeniedException | The request was denied because you don't have sufficient access to the specified resource. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | ResourceNotFoundException | The request failed because the specified resource wasn't found. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
409 | ConflictException | The request failed because it conflicts with the current state of the specified resource. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
429 | ThrottlingException | The request failed because you sent too many requests during a certain amount of time. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | InternalServerException | The request failed due to an unknown internal server error, exception, or failure. |
Schemas
Request bodies
{ "bucketCriteria": { "excludes": { "and": [ { "simpleCriterion": { "comparator": enum, "key": enum, "values": [ "string" ] }, "tagCriterion": { "comparator": enum, "tagValues": [ { "key": "string", "value": "string" } ] } } ] }, "includes": { "and": [ { "simpleCriterion": { "comparator": enum, "key": enum, "values": [ "string" ] }, "tagCriterion": { "comparator": enum, "tagValues": [ { "key": "string", "value": "string" } ] } } ] } }, "maxResults": integer, "nextToken": "string", "sortCriteria": { "attributeName": enum, "orderBy": enum } }
Response bodies
{ "matchingResources": [ { "matchingBucket": { "accountId": "string", "bucketName": "string", "classifiableObjectCount": integer, "classifiableSizeInBytes": integer, "errorCode": enum, "errorMessage": "string", "jobDetails": { "isDefinedInJob": enum, "isMonitoredByJob": enum, "lastJobId": "string", "lastJobRunTime": "string" }, "lastAutomatedDiscoveryTime": "string", "objectCount": integer, "objectCountByEncryptionType": { "customerManaged": integer, "kmsManaged": integer, "s3Managed": integer, "unencrypted": integer, "unknown": integer }, "sensitivityScore": integer, "sizeInBytes": integer, "sizeInBytesCompressed": integer, "unclassifiableObjectCount": { "fileType": integer, "storageClass": integer, "total": integer }, "unclassifiableObjectSizeInBytes": { "fileType": integer, "storageClass": integer, "total": integer } } } ], "nextToken": "string" }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }
{ "message": "string" }
Properties
AccessDeniedException
Provides information about an error that occurred due to insufficient access to a specified resource.
BucketMetadataErrorCode
The error code for an error that prevented Amazon Macie from retrieving and processing metadata from Amazon S3 for an S3 bucket and the bucket's objects.
ACCESS_DENIED
ConflictException
Provides information about an error that occurred due to a versioning conflict for a specified resource.
InternalServerException
Provides information about an error that occurred due to an unknown internal server error, exception, or failure.
JobDetails
Specifies whether any one-time or recurring classification jobs are configured to analyze data in an S3 bucket, and, if so, the details of the job that ran most recently.
MatchingBucket
Provides statistical data and other information about an S3 bucket that Amazon Macie monitors and analyzes for your account. By default, object count and storage size values include data for object parts that are the result of incomplete multipart uploads. For more information, see How Macie monitors Amazon S3 data security in the Amazon Macie User Guide.
If an error occurs when
Macie attempts to retrieve and process information about the bucket
or the bucket's objects, the value for most of these properties is null. Key
exceptions are accountId
and bucketName
. To identify the
cause of the error, refer to the errorCode
and errorMessage
values.
MatchingResource
Provides statistical data and other information about an AWS resource that Amazon Macie monitors and analyzes for your account.
ObjectCountByEncryptionType
Provides information about the number of objects that are in an S3 bucket and use certain types of server-side encryption, use client-side encryption, or aren't encrypted.
ObjectLevelStatistics
Provides information about the total storage size (in bytes) or number of objects
that Amazon Macie can't analyze in one or more S3 buckets. In a
BucketMetadata
or MatchingBucket
object, this data is
for a specific bucket. In a GetBucketStatisticsResponse
object, this
data is aggregated for all the buckets in the query results. If versioning is enabled
for a bucket, storage size values are based on the size of the latest version of each
applicable object in the bucket.
ResourceNotFoundException
Provides information about an error that occurred because a specified resource wasn't found.
SearchResourcesBucketCriteria
Specifies property- and tag-based conditions that define filter criteria for including or excluding S3 buckets from the query results. Exclude conditions take precedence over include conditions.
SearchResourcesComparator
The operator to use in a condition that filters the results of a query. Valid values are:
EQ
NE
SearchResourcesCriteria
Specifies a property- or tag-based filter condition for including or excluding AWS resources from the query results.
SearchResourcesCriteriaBlock
Specifies property- and tag-based conditions that define filter criteria for including or excluding AWS resources from the query results.
SearchResourcesRequest
Specifies criteria for filtering, sorting, and paginating the results of a query for statistical data and other information about AWS resources that Amazon Macie monitors and analyzes.
SearchResourcesResponse
Provides the results of a query that retrieved statistical data and other information about AWS resources that Amazon Macie monitors and analyzes for your account.
SearchResourcesSimpleCriterion
Specifies a property-based filter condition that determines which AWS resources are included or excluded from the query results.
Property | Type | Required | Description |
---|---|---|---|
comparator | False | The operator to use in the condition. Valid values are | |
key | False | The property to use in the condition. | |
values | Array of type string | False | 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 (
Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in values. |
SearchResourcesSimpleCriterionKey
The property to use in a condition that filters the query results. Valid values are:
ACCOUNT_ID
S3_BUCKET_NAME
S3_BUCKET_EFFECTIVE_PERMISSION
S3_BUCKET_SHARED_ACCESS
SearchResourcesSortAttributeName
The property to sort the query results by. Valid values are:
ACCOUNT_ID
RESOURCE_NAME
S3_CLASSIFIABLE_OBJECT_COUNT
S3_CLASSIFIABLE_SIZE_IN_BYTES
SearchResourcesSortCriteria
Specifies criteria for sorting the results of a query for information about AWS resources that Amazon Macie monitors and analyzes.
SearchResourcesTagCriterion
Specifies a tag-based filter condition that determines which AWS resources are included or excluded from the query results.
SearchResourcesTagCriterionPair
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.
ServiceQuotaExceededException
Provides information about an error that occurred due to one or more service quotas for an account.
ThrottlingException
Provides information about an error that occurred because too many requests were sent during a certain amount of time.
ValidationException
Provides information about an error that occurred due to a syntax error in a request.
See also
For more information about using this API in one of the language-specific AWS SDKs and references, see the following: