endpoints
Creates, updates, deletes, gets or lists an endpoints resource.
Overview
| Name | endpoints |
| Type | Resource |
| Id | aws.comprehend.endpoints |
Fields
The following fields are returned by SELECT queries:
- describe_endpoint
- list_endpoints
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The creation date and time of the endpoint. |
current_inference_units | integer | The number of inference units currently used by the model using this endpoint. |
data_access_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId). (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
desired_data_access_role_arn | string | Data access role ARN to use in case the new model is encrypted with a customer KMS key. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
desired_inference_units | integer | The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second. |
desired_model_arn | string | ARN of the new model to use for updating an existing endpoint. This ARN is going to be different from the model ARN when the update is in progress (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
endpoint_arn | string | The Amazon Resource Number (ARN) of the endpoint. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier-endpoint|entity-recognizer-endpoint)/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
flywheel_arn | string | The Amazon Resource Number (ARN) of the flywheel (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:flywheel/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
last_modified_time | string (date-time) | The date and time that the endpoint was last modified. |
message | string | Specifies a reason for failure in cases of Failed status. |
model_arn | string | The Amazon Resource Number (ARN) of the model to which the endpoint is attached. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
status | string | Specifies the status of the endpoint. Because the endpoint updates and creation are asynchronous, so customers will need to wait for the endpoint to be Ready status before making inference requests. (CREATING, DELETING, FAILED, IN_SERVICE, UPDATING) |
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The creation date and time of the endpoint. |
current_inference_units | integer | The number of inference units currently used by the model using this endpoint. |
data_access_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId). (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
desired_data_access_role_arn | string | Data access role ARN to use in case the new model is encrypted with a customer KMS key. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
desired_inference_units | integer | The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second. |
desired_model_arn | string | ARN of the new model to use for updating an existing endpoint. This ARN is going to be different from the model ARN when the update is in progress (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
endpoint_arn | string | The Amazon Resource Number (ARN) of the endpoint. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier-endpoint|entity-recognizer-endpoint)/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
flywheel_arn | string | The Amazon Resource Number (ARN) of the flywheel (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:flywheel/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
last_modified_time | string (date-time) | The date and time that the endpoint was last modified. |
message | string | Specifies a reason for failure in cases of Failed status. |
model_arn | string | The Amazon Resource Number (ARN) of the model to which the endpoint is attached. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
status | string | Specifies the status of the endpoint. Because the endpoint updates and creation are asynchronous, so customers will need to wait for the endpoint to be Ready status before making inference requests. (CREATING, DELETING, FAILED, IN_SERVICE, UPDATING) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_endpoint | select | region | Gets the properties associated with a specific endpoint. Use this operation to get the status of an endpoint. For information about endpoints, see Managing endpoints. | |
list_endpoints | select | region | Gets a list of all existing endpoints that you've created. For information about endpoints, see Managing endpoints. | |
create_endpoint | insert | region, EndpointName, DesiredInferenceUnits | Creates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints. | |
update_endpoint | update | region, EndpointArn | Updates information about the specified endpoint. For information about endpoints, see Managing endpoints. | |
delete_endpoint | delete | region | Deletes a model-specific endpoint for a previously-trained custom model. All endpoints must be deleted in order for the model to be deleted. For information about endpoints, see Managing endpoints. | |
classify_document | exec | region, EndpointArn | Creates a classification request to analyze a single document in real-time. ClassifyDocument supports the following model types: Custom classifier - a custom model that you have created and trained. For input, you can provide plain text, a single-page document (PDF, Word, or image), or Amazon Textract API output. For more information, see Custom classification in the Amazon Comprehend Developer Guide. Prompt safety classifier - Amazon Comprehend provides a pre-trained model for classifying input prompts for generative AI applications. For input, you provide English plain text input. For prompt safety classification, the response includes only the Classes field. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide. If the system detects errors while processing a page in the input document, the API response includes an Errors field that describes the errors. If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_endpoint
- list_endpoints
Gets the properties associated with a specific endpoint. Use this operation to get the status of an endpoint. For information about endpoints, see Managing endpoints.
SELECT
creation_time,
current_inference_units,
data_access_role_arn,
desired_data_access_role_arn,
desired_inference_units,
desired_model_arn,
endpoint_arn,
flywheel_arn,
last_modified_time,
message,
model_arn,
status
FROM aws.comprehend.endpoints
WHERE region = '{{ region }}' -- required
;
Gets a list of all existing endpoints that you've created. For information about endpoints, see Managing endpoints.
SELECT
creation_time,
current_inference_units,
data_access_role_arn,
desired_data_access_role_arn,
desired_inference_units,
desired_model_arn,
endpoint_arn,
flywheel_arn,
last_modified_time,
message,
model_arn,
status
FROM aws.comprehend.endpoints
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_endpoint
- Manifest
Creates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints.
INSERT INTO aws.comprehend.endpoints (
EndpointName,
ModelArn,
DesiredInferenceUnits,
ClientRequestToken,
Tags,
DataAccessRoleArn,
FlywheelArn,
region
)
SELECT
'{{ EndpointName }}' /* required */,
'{{ ModelArn }}',
{{ DesiredInferenceUnits }} /* required */,
'{{ ClientRequestToken }}',
'{{ Tags }}',
'{{ DataAccessRoleArn }}',
'{{ FlywheelArn }}',
'{{ region }}'
RETURNING
endpoint_arn,
model_arn
;
# Description fields are for documentation purposes
- name: endpoints
props:
- name: region
value: "{{ region }}"
description: Required parameter for the endpoints resource.
- name: EndpointName
value: "{{ EndpointName }}"
description: |
This is the descriptive suffix that becomes part of the EndpointArn used for all subsequent requests to this resource.
- name: ModelArn
value: "{{ ModelArn }}"
description: |
The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.
- name: DesiredInferenceUnits
value: {{ DesiredInferenceUnits }}
description: |
The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
description: |
An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a ResourceInUseException.
- name: Tags
description: |
Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: DataAccessRoleArn
value: "{{ DataAccessRoleArn }}"
description: |
The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId).
- name: FlywheelArn
value: "{{ FlywheelArn }}"
description: |
The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached.
UPDATE examples
- update_endpoint
Updates information about the specified endpoint. For information about endpoints, see Managing endpoints.
UPDATE aws.comprehend.endpoints
SET
EndpointArn = '{{ EndpointArn }}',
DesiredModelArn = '{{ DesiredModelArn }}',
DesiredInferenceUnits = {{ DesiredInferenceUnits }},
DesiredDataAccessRoleArn = '{{ DesiredDataAccessRoleArn }}',
FlywheelArn = '{{ FlywheelArn }}'
WHERE
region = '{{ region }}' --required
AND EndpointArn = '{{ EndpointArn }}' --required
RETURNING
desired_model_arn;
DELETE examples
- delete_endpoint
Deletes a model-specific endpoint for a previously-trained custom model. All endpoints must be deleted in order for the model to be deleted. For information about endpoints, see Managing endpoints.
DELETE FROM aws.comprehend.endpoints
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- classify_document
Creates a classification request to analyze a single document in real-time. ClassifyDocument supports the following model types: Custom classifier - a custom model that you have created and trained. For input, you can provide plain text, a single-page document (PDF, Word, or image), or Amazon Textract API output. For more information, see Custom classification in the Amazon Comprehend Developer Guide. Prompt safety classifier - Amazon Comprehend provides a pre-trained model for classifying input prompts for generative AI applications. For input, you provide English plain text input. For prompt safety classification, the response includes only the Classes field. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide. If the system detects errors while processing a page in the input document, the API response includes an Errors field that describes the errors. If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide.
EXEC aws.comprehend.endpoints.classify_document
@region='{{ region }}' --required
@@json=
'{
"Text": "{{ Text }}",
"EndpointArn": "{{ EndpointArn }}",
"Bytes": "{{ Bytes }}",
"DocumentReaderConfig": "{{ DocumentReaderConfig }}"
}'
;