document_classifiers
Creates, updates, deletes or gets a document_classifier
resource or lists document_classifiers
in a region
Overview
Name | document_classifiers |
Type | Resource |
Description | Document Classifier enables training document classifier models. |
Id | aws.comprehend.document_classifiers |
Fields
Name | Datatype | Description |
---|---|---|
data_access_role_arn | string | |
input_data_config | object | |
output_data_config | object | |
language_code | string | |
model_kms_key_id | string | |
model_policy | string | |
document_classifier_name | string | |
mode | string | |
tags | array | |
version_name | string | |
volume_kms_key_id | string | |
vpc_config | object | |
arn | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DocumentClassifierName, DataAccessRoleArn, InputDataConfig, LanguageCode, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all document_classifiers
in a region.
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 aws.comprehend.document_classifiers
WHERE region = 'us-east-1';
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 aws.comprehend.document_classifiers
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new document_classifier
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.comprehend.document_classifiers (
DataAccessRoleArn,
InputDataConfig,
LanguageCode,
DocumentClassifierName,
region
)
SELECT
'{{ DataAccessRoleArn }}',
'{{ InputDataConfig }}',
'{{ LanguageCode }}',
'{{ DocumentClassifierName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.comprehend.document_classifiers (
DataAccessRoleArn,
InputDataConfig,
OutputDataConfig,
LanguageCode,
ModelKmsKeyId,
ModelPolicy,
DocumentClassifierName,
Mode,
Tags,
VersionName,
VolumeKmsKeyId,
VpcConfig,
region
)
SELECT
'{{ DataAccessRoleArn }}',
'{{ InputDataConfig }}',
'{{ OutputDataConfig }}',
'{{ LanguageCode }}',
'{{ ModelKmsKeyId }}',
'{{ ModelPolicy }}',
'{{ DocumentClassifierName }}',
'{{ Mode }}',
'{{ Tags }}',
'{{ VersionName }}',
'{{ VolumeKmsKeyId }}',
'{{ VpcConfig }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: document_classifier
props:
- name: DataAccessRoleArn
value: '{{ DataAccessRoleArn }}'
- name: InputDataConfig
value:
AugmentedManifests:
- AttributeNames:
- '{{ AttributeNames[0] }}'
S3Uri: '{{ S3Uri }}'
Split: '{{ Split }}'
DataFormat: '{{ DataFormat }}'
LabelDelimiter: '{{ LabelDelimiter }}'
DocumentType: '{{ DocumentType }}'
Documents:
S3Uri: null
TestS3Uri: null
DocumentReaderConfig:
DocumentReadAction: '{{ DocumentReadAction }}'
DocumentReadMode: '{{ DocumentReadMode }}'
FeatureTypes:
- '{{ FeatureTypes[0] }}'
S3Uri: null
TestS3Uri: null
- name: OutputDataConfig
value:
KmsKeyId: '{{ KmsKeyId }}'
S3Uri: null
- name: LanguageCode
value: '{{ LanguageCode }}'
- name: ModelKmsKeyId
value: null
- name: ModelPolicy
value: '{{ ModelPolicy }}'
- name: DocumentClassifierName
value: '{{ DocumentClassifierName }}'
- name: Mode
value: '{{ Mode }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: VersionName
value: '{{ VersionName }}'
- name: VolumeKmsKeyId
value: null
- name: VpcConfig
value:
SecurityGroupIds:
- '{{ SecurityGroupIds[0] }}'
Subnets:
- '{{ Subnets[0] }}'
DELETE
example
/*+ delete */
DELETE FROM aws.comprehend.document_classifiers
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the document_classifiers
resource, the following permissions are required:
Create
iam:PassRole,
comprehend:CreateDocumentClassifier,
comprehend:DescribeDocumentClassifier,
comprehend:DescribeResourcePolicy,
comprehend:ListTagsForResource,
textract:DetectDocumentText
Read
comprehend:DescribeDocumentClassifier,
comprehend:DescribeResourcePolicy,
comprehend:ListTagsForResource
Update
iam:PassRole,
comprehend:PutResourcePolicy,
comprehend:DeleteResourcePolicy,
comprehend:DescribeResourcePolicy,
comprehend:DescribeDocumentClassifier,
comprehend:ListTagsForResource,
comprehend:TagResource,
comprehend:UntagResource
Delete
comprehend:DescribeDocumentClassifier,
comprehend:DeleteDocumentClassifier
List
comprehend:ListDocumentClassifiers