create_classification_job
(**kwargs)¶Creates and defines the settings for a classification job.
See also: AWS API Documentation
Request Syntax
response = client.create_classification_job(
allowListIds=[
'string',
],
clientToken='string',
customDataIdentifierIds=[
'string',
],
description='string',
initialRun=True|False,
jobType='ONE_TIME'|'SCHEDULED',
managedDataIdentifierIds=[
'string',
],
managedDataIdentifierSelector='ALL'|'EXCLUDE'|'INCLUDE'|'NONE',
name='string',
s3JobDefinition={
'bucketCriteria': {
'excludes': {
'and': [
{
'simpleCriterion': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'ACCOUNT_ID'|'S3_BUCKET_NAME'|'S3_BUCKET_EFFECTIVE_PERMISSION'|'S3_BUCKET_SHARED_ACCESS',
'values': [
'string',
]
},
'tagCriterion': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'tagValues': [
{
'key': 'string',
'value': 'string'
},
]
}
},
]
},
'includes': {
'and': [
{
'simpleCriterion': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'ACCOUNT_ID'|'S3_BUCKET_NAME'|'S3_BUCKET_EFFECTIVE_PERMISSION'|'S3_BUCKET_SHARED_ACCESS',
'values': [
'string',
]
},
'tagCriterion': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'tagValues': [
{
'key': 'string',
'value': 'string'
},
]
}
},
]
}
},
'bucketDefinitions': [
{
'accountId': 'string',
'buckets': [
'string',
]
},
],
'scoping': {
'excludes': {
'and': [
{
'simpleScopeTerm': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'OBJECT_EXTENSION'|'OBJECT_LAST_MODIFIED_DATE'|'OBJECT_SIZE'|'OBJECT_KEY',
'values': [
'string',
]
},
'tagScopeTerm': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'string',
'tagValues': [
{
'key': 'string',
'value': 'string'
},
],
'target': 'S3_OBJECT'
}
},
]
},
'includes': {
'and': [
{
'simpleScopeTerm': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'OBJECT_EXTENSION'|'OBJECT_LAST_MODIFIED_DATE'|'OBJECT_SIZE'|'OBJECT_KEY',
'values': [
'string',
]
},
'tagScopeTerm': {
'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS'|'STARTS_WITH',
'key': 'string',
'tagValues': [
{
'key': 'string',
'value': 'string'
},
],
'target': 'S3_OBJECT'
}
},
]
}
}
},
samplingPercentage=123,
scheduleFrequency={
'dailySchedule': {}
,
'monthlySchedule': {
'dayOfMonth': 123
},
'weeklySchedule': {
'dayOfWeek': 'SUNDAY'|'MONDAY'|'TUESDAY'|'WEDNESDAY'|'THURSDAY'|'FRIDAY'|'SATURDAY'
}
},
tags={
'string': 'string'
}
)
An array of unique identifiers, one for each allow list for the job to use when it analyzes data.
[REQUIRED]
A unique, case-sensitive token that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
An array of unique identifiers, one for each custom data identifier for the job to use when it analyzes data. To use only managed data identifiers, don't specify a value for this property and specify a value other than NONE for the managedDataIdentifierSelector property.
For a recurring job, specifies whether to analyze all existing, eligible objects immediately after the job is created (true). To analyze only those objects that are created or changed after you create the job and before the job's first scheduled run, set this value to false.
If you configure the job to run only once, don't specify a value for this property.
[REQUIRED]
The schedule for running the job. Valid values are:
An array of unique identifiers, one for each managed data identifier for the job to include (use) or exclude (not use) when it analyzes data. Inclusion or exclusion depends on the managed data identifier selection type that you specify for the job (managedDataIdentifierSelector).
To retrieve a list of valid values for this property, use the ListManagedDataIdentifiers operation.
The selection type to apply when determining which managed data identifiers the job uses to analyze data. Valid values are:
If you don't specify a value for this property, the job uses all managed data identifiers. If you don't specify a value for this property or you specify ALL or EXCLUDE for a recurring job, the job also uses new managed data identifiers as they are released.
[REQUIRED]
A custom name for the job. The name can contain as many as 500 characters.
[REQUIRED]
The S3 buckets that contain the objects to analyze, and the scope of that analysis.
The property- and tag-based conditions that determine which S3 buckets to include or exclude from the analysis. Each time the job runs, the job uses these criteria to determine which buckets contain objects to analyze. A job's definition can contain a bucketCriteria object or a bucketDefinitions array, not both.
The property- and tag-based conditions that determine which buckets to exclude from the job.
An array of conditions, one for each condition that determines which buckets to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
Specifies a property- or tag-based condition that defines criteria for including or excluding S3 buckets from a classification job.
A property-based condition that defines a property, operator, and one or more values for including or excluding buckets from the job.
The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
The property to use in the condition.
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:
Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in these values.
A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding buckets from the job.
The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
The tag keys, tag values, or tag key and value pairs to use in the condition.
Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in a tag-based condition that determines whether an S3 bucket is included or excluded from a classification job. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based conditions.
The value for the tag key to use in the condition.
The tag value to use in the condition.
The property- and tag-based conditions that determine which buckets to include in the job.
An array of conditions, one for each condition that determines which buckets to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
Specifies a property- or tag-based condition that defines criteria for including or excluding S3 buckets from a classification job.
A property-based condition that defines a property, operator, and one or more values for including or excluding buckets from the job.
The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
The property to use in the condition.
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:
Values are case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in these values.
A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for including or excluding buckets from the job.
The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).
The tag keys, tag values, or tag key and value pairs to use in the condition.
Specifies a tag key, a tag value, or a tag key and value (as a pair) to use in a tag-based condition that determines whether an S3 bucket is included or excluded from a classification job. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based conditions.
The value for the tag key to use in the condition.
The tag value to use in the condition.
An array of objects, one for each Amazon Web Services account that owns specific S3 buckets to analyze. Each object specifies the account ID for an account and one or more buckets to analyze for that account. A job's definition can contain a bucketDefinitions array or a bucketCriteria object, not both.
Specifies an Amazon Web Services account that owns S3 buckets for a classification job to analyze, and one or more specific buckets to analyze for that account.
The unique identifier for the Amazon Web Services account that owns the buckets.
An array that lists the names of the buckets.
The property- and tag-based conditions that determine which S3 objects to include or exclude from the analysis. Each time the job runs, the job uses these criteria to determine which objects to analyze.
The property- and tag-based conditions that determine which objects to exclude from the analysis.
An array of conditions, one for each property- or tag-based condition that determines which objects to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
Specifies a property- or tag-based condition that defines criteria for including or excluding S3 objects from a classification job. A JobScopeTerm object can contain only one simpleScopeTerm object or one tagScopeTerm object.
A property-based condition that defines a property, operator, and one or more values for including or excluding objects from the job.
The operator to use in the condition. Valid values for each supported property (key) are:
The object property to use in the condition.
An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION or OBJECT_KEY, this array can specify multiple values and Amazon Macie uses OR logic to join the values. Otherwise, this array can specify only one value.
Valid values for each supported property (key) are:
Macie doesn't support use of wildcard characters in these values. Also, string values are case sensitive.
A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding objects from the job.
The operator to use in the condition. Valid values are EQ (equals) or NE (not equals).
The object property to use in the condition. The only valid value is TAG.
The tag keys or tag key and value pairs to use in the condition. To specify only tag keys in a condition, specify the keys in this array and set the value for each associated tag value to an empty string.
Specifies a tag key or tag key and value pair to use in a tag-based condition that determines whether an S3 object is included or excluded from a classification job. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based conditions.
The value for the tag key to use in the condition.
The tag value, associated with the specified tag key (key), to use in the condition. To specify only a tag key for a condition, specify the tag key for the key property and set this value to an empty string.
The type of object to apply the condition to.
The property- and tag-based conditions that determine which objects to include in the analysis.
An array of conditions, one for each property- or tag-based condition that determines which objects to include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.
Specifies a property- or tag-based condition that defines criteria for including or excluding S3 objects from a classification job. A JobScopeTerm object can contain only one simpleScopeTerm object or one tagScopeTerm object.
A property-based condition that defines a property, operator, and one or more values for including or excluding objects from the job.
The operator to use in the condition. Valid values for each supported property (key) are:
The object property to use in the condition.
An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION or OBJECT_KEY, this array can specify multiple values and Amazon Macie uses OR logic to join the values. Otherwise, this array can specify only one value.
Valid values for each supported property (key) are:
Macie doesn't support use of wildcard characters in these values. Also, string values are case sensitive.
A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding objects from the job.
The operator to use in the condition. Valid values are EQ (equals) or NE (not equals).
The object property to use in the condition. The only valid value is TAG.
The tag keys or tag key and value pairs to use in the condition. To specify only tag keys in a condition, specify the keys in this array and set the value for each associated tag value to an empty string.
Specifies a tag key or tag key and value pair to use in a tag-based condition that determines whether an S3 object is included or excluded from a classification job. Tag keys and values are case sensitive. Also, Amazon Macie doesn't support use of partial values or wildcard characters in tag-based conditions.
The value for the tag key to use in the condition.
The tag value, associated with the specified tag key (key), to use in the condition. To specify only a tag key for a condition, specify the tag key for the key property and set this value to an empty string.
The type of object to apply the condition to.
The recurrence pattern for running the job. To run the job only once, don't specify a value for this property and set the value for the jobType property to ONE_TIME.
Specifies a daily recurrence pattern for running the job.
Specifies a monthly recurrence pattern for running the job.
The numeric day of the month when Amazon Macie runs the job. This value can be an integer from 1 through 31.
If this value exceeds the number of days in a certain month, Macie doesn't run the job that month. Macie runs the job only during months that have the specified day. For example, if this value is 31 and a month has only 30 days, Macie doesn't run the job that month. To run the job every month, specify a value that's less than 29.
Specifies a weekly recurrence pattern for running the job.
The day of the week when Amazon Macie runs the job.
A map of key-value pairs that specifies the tags to associate with the job.
A job can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
dict
Response Syntax
{
'jobArn': 'string',
'jobId': 'string'
}
Response Structure
(dict) --
The request succeeded. The specified job was created.
jobArn (string) --
The Amazon Resource Name (ARN) of the job.
jobId (string) --
The unique identifier for the job.
Exceptions
Macie2.Client.exceptions.ValidationException
Macie2.Client.exceptions.InternalServerException
Macie2.Client.exceptions.ServiceQuotaExceededException
Macie2.Client.exceptions.AccessDeniedException
Macie2.Client.exceptions.ResourceNotFoundException
Macie2.Client.exceptions.ThrottlingException
Macie2.Client.exceptions.ConflictException