classification_jobs
Creates, updates, deletes, gets or lists a classification_jobs resource.
Overview
| Name | classification_jobs |
| Type | Resource |
| Id | aws.macie2.classification_jobs |
Fields
The following fields are returned by SELECT queries:
- describe_classification_job
- list_classification_jobs
| Name | Datatype | Description |
|---|---|---|
name | string | The custom name of the job. |
allow_list_ids | array | An array of unique identifiers, one for each allow list that the job is configured to use when it analyzes data. |
client_token | string | The token that was provided to ensure the idempotency of the request to create the job. |
created_at | string (date-time) | The date and time, in UTC and extended ISO 8601 format, when the job was created. |
custom_data_identifier_ids | array | An array of unique identifiers, one for each custom data identifier that the job is configured to use when it analyzes data. This value is null if the job is configured to use only managed data identifiers to analyze data. |
description | string | The custom description of the job. |
initial_run | boolean | For a recurring job, specifies whether you configured the job to analyze all existing, eligible objects immediately after the job was created (true). If you configured the job to analyze only those objects that were created or changed after the job was created and before the job's first scheduled run, this value is false. This value is also false for a one-time job. |
job_arn | string | The Amazon Resource Name (ARN) of the job. |
job_id | string | The unique identifier for the job. |
job_status | string | The current status of the job. Possible values are: CANCELLED - You cancelled the job or, if it's a one-time job, you paused the job and didn't resume it within 30 days. COMPLETE - For a one-time job, Amazon Macie finished processing the data specified for the job. This value doesn't apply to recurring jobs. IDLE - For a recurring job, the previous scheduled run is complete and the next scheduled run is pending. This value doesn't apply to one-time jobs. PAUSED - Macie started running the job but additional processing would exceed the monthly sensitive data discovery quota for your account or one or more member accounts that the job analyzes data for. RUNNING - For a one-time job, the job is in progress. For a recurring job, a scheduled run is in progress. USER_PAUSED - You paused the job. If you paused the job while it had a status of RUNNING and you don't resume it within 30 days of pausing it, the job or job run will expire and be cancelled, depending on the job's type. To check the expiration date, refer to the UserPausedDetails.jobExpiresAt property. (RUNNING, PAUSED, CANCELLED, COMPLETE, IDLE, USER_PAUSED) |
job_type | string | The schedule for running a classification job. Valid values are: (ONE_TIME, SCHEDULED) |
last_run_error_status | object | Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run. |
last_run_time | string (date-time) | The date and time, in UTC and extended ISO 8601 format, when the job started. If the job is a recurring job, this value indicates when the most recent run started or, if the job hasn't run yet, when the job was created. |
managed_data_identifier_ids | array | An array of unique identifiers, one for each managed data identifier that the job is explicitly configured to include (use) or exclude (not use) when it analyzes data. Inclusion or exclusion depends on the managed data identifier selection type specified for the job (managedDataIdentifierSelector). This value is null if the job's managed data identifier selection type is ALL, NONE, or RECOMMENDED. |
managed_data_identifier_selector | string | The selection type that determines which managed data identifiers a classification job uses to analyze data. Valid values are: (ALL, EXCLUDE, INCLUDE, NONE, RECOMMENDED) |
s_3_job_definition | object | Specifies which S3 buckets contain the objects that a classification job analyzes, and the scope of that analysis. The bucket specification can be static (bucketDefinitions) or dynamic (bucketCriteria). If it's static, the job analyzes objects in the same predefined set of buckets each time the job runs. If it's dynamic, the job analyzes objects in any buckets that match the specified criteria each time the job starts to run. |
sampling_percentage | integer | The sampling depth, as a percentage, that determines the percentage of eligible objects that the job analyzes. |
schedule_frequency | object | Specifies the recurrence pattern for running a classification job. |
statistics | object | The number of times that the job has run and processing statistics for the job's current run. |
tags | object | A map of key-value pairs that specifies which tags (keys and values) are associated with the job. |
user_paused_details | object | If the current status of the job is USER_PAUSED, specifies when the job was paused and when the job or job run will expire and be cancelled if it isn't resumed. This value is present only if the value for jobStatus is USER_PAUSED. |
| Name | Datatype | Description |
|---|---|---|
name | string | The custom name of the job. |
bucket_criteria | object | The property- and tag-based conditions that determine which S3 buckets are included or excluded from the job's analysis. Each time the job runs, the job uses these criteria to determine which buckets to analyze. A job's definition can contain a bucketCriteria object or a bucketDefinitions array, not both. |
bucket_definitions | array | An array of objects, one for each Amazon Web Services account that owns specific S3 buckets for the job 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. |
created_at | string (date-time) | The date and time, in UTC and extended ISO 8601 format, when the job was created. |
job_id | string | The unique identifier for the job. |
job_status | string | The status of a classification job. Possible values are: (RUNNING, PAUSED, CANCELLED, COMPLETE, IDLE, USER_PAUSED) |
job_type | string | The schedule for running a classification job. Valid values are: (ONE_TIME, SCHEDULED) |
last_run_error_status | object | Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run. |
user_paused_details | object | If the current status of the job is USER_PAUSED, specifies when the job was paused and when the job or job run will expire and be cancelled if it isn't resumed. This value is present only if the value for jobStatus is USER_PAUSED. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_classification_job | select | job_id, region | Retrieves the status and settings for a classification job. | |
list_classification_jobs | select | region | Retrieves a subset of information about one or more classification jobs. | |
create_classification_job | insert | region, clientToken, jobType, name, s3JobDefinition | Creates and defines the settings for a classification job. | |
update_classification_job | update | job_id, region, jobStatus | Changes the status of a classification job. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
job_id | string | The unique identifier for the classification job. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_classification_job
- list_classification_jobs
Retrieves the status and settings for a classification job.
SELECT
name,
allow_list_ids,
client_token,
created_at,
custom_data_identifier_ids,
description,
initial_run,
job_arn,
job_id,
job_status,
job_type,
last_run_error_status,
last_run_time,
managed_data_identifier_ids,
managed_data_identifier_selector,
s_3_job_definition,
sampling_percentage,
schedule_frequency,
statistics,
tags,
user_paused_details
FROM aws.macie2.classification_jobs
WHERE job_id = '{{ job_id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves a subset of information about one or more classification jobs.
SELECT
name,
bucket_criteria,
bucket_definitions,
created_at,
job_id,
job_status,
job_type,
last_run_error_status,
user_paused_details
FROM aws.macie2.classification_jobs
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_classification_job
- Manifest
Creates and defines the settings for a classification job.
INSERT INTO aws.macie2.classification_jobs (
allowListIds,
clientToken,
customDataIdentifierIds,
description,
initialRun,
jobType,
managedDataIdentifierIds,
managedDataIdentifierSelector,
name,
s3JobDefinition,
samplingPercentage,
scheduleFrequency,
tags,
region
)
SELECT
'{{ allowListIds }}',
'{{ clientToken }}' /* required */,
'{{ customDataIdentifierIds }}',
'{{ description }}',
{{ initialRun }},
'{{ jobType }}' /* required */,
'{{ managedDataIdentifierIds }}',
'{{ managedDataIdentifierSelector }}',
'{{ name }}' /* required */,
'{{ s3JobDefinition }}' /* required */,
{{ samplingPercentage }},
'{{ scheduleFrequency }}',
'{{ tags }}',
'{{ region }}'
RETURNING
job_arn,
job_id
;
# Description fields are for documentation purposes
- name: classification_jobs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the classification_jobs resource.
- name: allowListIds
value:
- "{{ allowListIds }}"
- name: clientToken
value: "{{ clientToken }}"
- name: customDataIdentifierIds
value:
- "{{ customDataIdentifierIds }}"
- name: description
value: "{{ description }}"
- name: initialRun
value: {{ initialRun }}
- name: jobType
value: "{{ jobType }}"
description: |
The schedule for running a classification job. Valid values are:
valid_values: ['ONE_TIME', 'SCHEDULED']
- name: managedDataIdentifierIds
value:
- "{{ managedDataIdentifierIds }}"
- name: managedDataIdentifierSelector
value: "{{ managedDataIdentifierSelector }}"
description: |
The selection type that determines which managed data identifiers a classification job uses to analyze data. Valid values are:
valid_values: ['ALL', 'EXCLUDE', 'INCLUDE', 'NONE', 'RECOMMENDED']
- name: name
value: "{{ name }}"
- name: s3JobDefinition
description: |
Specifies which S3 buckets contain the objects that a classification job analyzes, and the scope of that analysis. The bucket specification can be static (bucketDefinitions) or dynamic (bucketCriteria). If it's static, the job analyzes objects in the same predefined set of buckets each time the job runs. If it's dynamic, the job analyzes objects in any buckets that match the specified criteria each time the job starts to run.
value:
bucketCriteria:
excludes:
and:
- simpleCriterion:
comparator: "{{ comparator }}"
key: "{{ key }}"
values: "{{ values }}"
tagCriterion:
comparator: "{{ comparator }}"
tagValues: "{{ tagValues }}"
includes:
and:
- simpleCriterion:
comparator: "{{ comparator }}"
key: "{{ key }}"
values: "{{ values }}"
tagCriterion:
comparator: "{{ comparator }}"
tagValues: "{{ tagValues }}"
bucketDefinitions:
- accountId: "{{ accountId }}"
buckets: "{{ buckets }}"
scoping:
excludes:
and:
- simpleScopeTerm:
comparator: "{{ comparator }}"
key: "{{ key }}"
values: "{{ values }}"
tagScopeTerm:
comparator: "{{ comparator }}"
key: "{{ key }}"
tagValues: "{{ tagValues }}"
target: "{{ target }}"
includes:
and:
- simpleScopeTerm:
comparator: "{{ comparator }}"
key: "{{ key }}"
values: "{{ values }}"
tagScopeTerm:
comparator: "{{ comparator }}"
key: "{{ key }}"
tagValues: "{{ tagValues }}"
target: "{{ target }}"
- name: samplingPercentage
value: {{ samplingPercentage }}
- name: scheduleFrequency
description: |
Specifies the recurrence pattern for running a classification job.
value:
dailySchedule: "{{ dailySchedule }}"
monthlySchedule:
dayOfMonth: {{ dayOfMonth }}
weeklySchedule:
dayOfWeek: "{{ dayOfWeek }}"
- name: tags
value: "{{ tags }}"
description: |
A string-to-string map of key-value pairs that specifies the tags (keys and values) for an Amazon Macie resource.
UPDATE examples
- update_classification_job
Changes the status of a classification job.
UPDATE aws.macie2.classification_jobs
SET
jobStatus = '{{ jobStatus }}'
WHERE
job_id = '{{ job_id }}' --required
AND region = '{{ region }}' --required
AND jobStatus = '{{ jobStatus }}' --required;