Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* xref:aws-bedrock-text-sink.adoc[]
* xref:aws-cloudtrail-source.adoc[]
* xref:aws-cloudwatch-sink.adoc[]
* xref:aws-comprehend-sink.adoc[]
* xref:aws-ddb-sink.adoc[]
* xref:aws-ddb-streams-source.adoc[]
* xref:aws-ec2-sink.adoc[]
Expand Down
42 changes: 42 additions & 0 deletions docs/modules/ROOT/partials/aws-comprehend-sink-description.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
== AWS Comprehend Sink Kamelet Description

=== Authentication methods

In this Kamelet you can avoid using explicit static credentials by specifying the `useDefaultCredentialsProvider` option and set it to `true`.

The order of evaluation for Default Credentials Provider is the following:

- Java system properties - `aws.accessKeyId` and `aws.secretKey`.
- Environment variables - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
- Web Identity Token from AWS STS.
- The shared credentials and config files.
- Amazon ECS container credentials - loaded from the Amazon ECS if the environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is set.
- Amazon EC2 Instance profile credentials.

You can also use the Profile Credentials Provider, by setting the `useProfileCredentialsProvider` option to `true` and `profileCredentialsName` to the profile name.

Only one of access key/secret key or default credentials provider could be used

For more information, see the https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html[AWS credentials documentation]

=== Operations

The kamelet supports the following operations:

- *detectDominantLanguage* (default) - Detects the dominant language of the input text.
- *detectEntities* - Detects named entities (people, places, organizations, etc.) in the input text.
- *detectKeyPhrases* - Detects key noun phrases in the input text.
- *detectSentiment* - Detects the sentiment (positive, negative, neutral, mixed) of the input text.
- *detectSyntax* - Detects the parts of speech (nouns, verbs, adjectives, etc.) in the input text.
- *detectPiiEntities* - Detects personally identifiable information (PII) in the input text.
- *detectToxicContent* - Detects toxic content in the input text.
- *classifyDocument* - Classifies the input text using a custom document classifier endpoint.
- *containsPiiEntities* - Checks whether the input text contains PII entities.

=== Language Code

The `languageCode` parameter is required for all operations except `detectDominantLanguage`. Use a 2-letter ISO 639-1 code (e.g., `en` for English, `es` for Spanish).

=== Document Classification

For the `classifyDocument` operation, you must provide the `endpointArn` parameter pointing to your custom classifier endpoint.
130 changes: 130 additions & 0 deletions kamelets/aws-comprehend-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: aws-comprehend-sink
annotations:
camel.apache.org/kamelet.support.level: "Preview"
camel.apache.org/catalog.version: "4.18.0-SNAPSHOT"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgZGF0YS1uYW1lPSJMYXllciAxIiBpZD0iTGF5ZXJfMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQzMC40MiwxOTYuMzJjOC0xMS4zOSwyMS4xNS0zOC4zMywwLTcyLjEzYTUyLjc5LDUyLjc5LDAsMCwwLTE3LjA2LTE3LjMxYy0xLjUzLTgtNy41N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2Zz4="
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "AWS Comprehend"
camel.apache.org/kamelet.namespace: "AWS"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "AWS Comprehend Sink"
description: Send data to AWS Comprehend for natural language processing.
required:
- region
type: object
properties:
operation:
title: Operation
description: The operation to perform on the input text.
type: string
default: detectDominantLanguage
enum: ["detectDominantLanguage", "detectEntities", "detectKeyPhrases", "detectSentiment", "detectSyntax", "detectPiiEntities", "detectToxicContent", "classifyDocument", "containsPiiEntities"]
languageCode:
title: Language Code
description: The language code of the input text. Required for all operations except detectDominantLanguage. Use a 2-letter ISO 639-1 code (e.g., 'en' for English, 'es' for Spanish).
type: string
endpointArn:
title: Endpoint ARN
description: The Amazon Resource Name (ARN) of the endpoint to use for document classification. Required for classifyDocument operation.
type: string
accessKey:
title: Access Key
description: The access key obtained from AWS.
type: string
format: password
x-descriptors:
- urn:camel:group:credentials
secretKey:
title: Secret Key
description: The secret key obtained from AWS.
type: string
format: password
x-descriptors:
- urn:camel:group:credentials
region:
title: AWS Region
description: The AWS region to access.
type: string
enum: ["ap-south-1", "eu-south-1", "us-gov-east-1", "me-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-northeast-2", "ap-northeast-1", "me-south-1", "sa-east-1", "ap-east-1", "cn-north-1", "us-gov-west-1", "ap-southeast-1", "ap-southeast-2", "us-iso-east-1", "ap-southeast-3", "us-east-1", "us-east-2", "cn-northwest-1", "us-isob-east-1", "aws-global", "aws-cn-global", "aws-us-gov-global", "aws-iso-global", "aws-iso-b-global"]
useDefaultCredentialsProvider:
title: Default Credentials Provider
description: If true, the Comprehend client loads credentials through a default credentials provider. If false, it uses the basic authentication method (access key and secret key).
type: boolean
default: false
useProfileCredentialsProvider:
title: Profile Credentials Provider
description: Set whether the Comprehend client should expect to load credentials through a profile credentials provider.
type: boolean
default: false
useSessionCredentials:
title: Session Credentials
description: Set whether the Comprehend client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Comprehend.
type: boolean
default: false
profileCredentialsName:
title: Profile Credentials Name
description: If using a profile credentials provider this parameter sets the profile name.
type: string
sessionToken:
title: Session Token
description: Amazon AWS Session Token used when the user needs to assume an IAM role.
type: string
format: password
x-descriptors:
- urn:camel:group:credentials
uriEndpointOverride:
title: Overwrite Endpoint URI
description: The overriding endpoint URI. To use this option, you must also select the `overrideEndpoint` option.
type: string
overrideEndpoint:
title: Endpoint Overwrite
description: Select this option to override the endpoint URI. To use this option, you must also provide a URI for the `uriEndpointOverride` option.
type: boolean
default: false
dependencies:
- "camel:core"
- "camel:aws2-comprehend"
- "camel:kamelet"
template:
from:
uri: "kamelet:source"
steps:
- to:
uri: "aws2-comprehend:comprehend"
parameters:
secretKey: "{{?secretKey}}"
accessKey: "{{?accessKey}}"
region: "{{region}}"
operation: "{{operation}}"
languageCode: "{{?languageCode}}"
endpointArn: "{{?endpointArn}}"
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}"
useSessionCredentials: "{{useSessionCredentials}}"
uriEndpointOverride: "{{?uriEndpointOverride}}"
profileCredentialsName: "{{?profileCredentialsName}}"
sessionToken: "{{?sessionToken}}"
overrideEndpoint: "{{overrideEndpoint}}"
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void testGetKameletsByGroup() throws Exception {
void testGetKameletsByNamespace() throws Exception {
List<Kamelet> c = catalog.getKameletsByNamespace("AWS");
assertFalse(c.isEmpty());
assertEquals(29, c.size());
assertEquals(30, c.size());
c = catalog.getKameletsByGroups("Not-existing-group");
assertTrue(c.isEmpty());
}
Expand Down
Loading
Loading