Skip to main content

document_classifiers

Creates, updates, deletes or gets a document_classifier resource or lists document_classifiers in a region

Overview

Namedocument_classifiers
TypeResource
DescriptionDocument Classifier enables training document classifier models.
Idawscc.comprehend.document_classifiers

Fields

NameDatatypeDescription
data_access_role_arnstring
input_data_configobject
output_data_configobject
language_codestring
model_kms_key_idstring
model_policystring
document_classifier_namestring
modestring
tagsarray
version_namestring
vpc_configobject
arnstring
regionstringAWS region.

For more information, see AWS::Comprehend::DocumentClassifier.

Methods

NameResourceAccessible byRequired Params
create_resourcedocument_classifiersINSERTDocumentClassifierName, DataAccessRoleArn, InputDataConfig, LanguageCode, region
delete_resourcedocument_classifiersDELETEIdentifier, region
update_resourcedocument_classifiersUPDATEIdentifier, PatchDocument, region
list_resourcesdocument_classifiers_list_onlySELECTregion
get_resourcedocument_classifiersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual document_classifier.

SELECT
region,
data_access_role_arn,
input_data_config,
output_data_config,
language_code,
model_kms_key_id,
model_policy,
document_classifier_name,
mode,
tags,
version_name,
volume_kms_key_id,
vpc_config,
arn
FROM awscc.comprehend.document_classifiers
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new document_classifier resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.comprehend.document_classifiers (
DataAccessRoleArn,
InputDataConfig,
LanguageCode,
DocumentClassifierName,
region
)
SELECT
'{{ data_access_role_arn }}',
'{{ input_data_config }}',
'{{ language_code }}',
'{{ document_classifier_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a document_classifier resource, using stack-deploy.

/*+ update */
UPDATE awscc.comprehend.document_classifiers
SET PatchDocument = string('{{ {
"ModelPolicy": model_policy,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.comprehend.document_classifiers
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the document_classifiers resource, the following permissions are required:

iam:PassRole,
comprehend:CreateDocumentClassifier,
comprehend:DescribeDocumentClassifier,
comprehend:DescribeResourcePolicy,
comprehend:ListTagsForResource,
textract:DetectDocumentText