This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch 2725 in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 90929029dbf874fc97159c6737cd1df3a5a22652 Author: Andrea Cosentino <[email protected]> AuthorDate: Tue Feb 17 15:15:23 2026 +0100 Added an AWS Polly Sink Kamelet Signed-off-by: Andrea Cosentino <[email protected]> --- docs/modules/ROOT/nav.adoc | 1 + .../ROOT/partials/aws-polly-sink-description.adoc | 50 +++++++ kamelets/aws-polly-sink.kamelet.yaml | 149 +++++++++++++++++++++ .../resources/kamelets/aws-polly-sink.kamelet.yaml | 149 +++++++++++++++++++++ templates/pipes/camel-k/aws-polly-sink-pipe.yaml | 19 +++ templates/pipes/core/aws-polly-sink-pipe.yaml | 13 ++ 6 files changed, 381 insertions(+) diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 8d4451ae5..c1a4b43e9 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -14,6 +14,7 @@ * xref:aws-kinesis-sink.adoc[] * xref:aws-kinesis-source.adoc[] * xref:aws-lambda-sink.adoc[] +* xref:aws-polly-sink.adoc[] * xref:aws-redshift-sink.adoc[] * xref:aws-redshift-source.adoc[] * xref:aws-s3-event-based-source.adoc[] diff --git a/docs/modules/ROOT/partials/aws-polly-sink-description.adoc b/docs/modules/ROOT/partials/aws-polly-sink-description.adoc new file mode 100644 index 000000000..cadb1409a --- /dev/null +++ b/docs/modules/ROOT/partials/aws-polly-sink-description.adoc @@ -0,0 +1,50 @@ +== AWS Polly 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] + +=== Speech Synthesis + +The kamelet sends text to AWS Polly for speech synthesis and returns the audio stream in the configured output format. The message body should contain the text to synthesize. + +=== Voice Selection + +Use the `voiceId` parameter to select a specific voice (e.g., `Joanna`, `Matthew`, `Amy`, `Brian`). If not set, the voice ID can be provided via the `CamelAwsPollyVoiceId` message header. + +=== Engine Selection + +Amazon Polly supports multiple engines: + + - *standard* - Standard synthesis engine. + - *neural* - Neural synthesis engine for more natural sounding speech. + - *long-form* - Optimized for long-form content like articles and books. + - *generative* - Generative synthesis engine for the most expressive and natural speech. + +=== Output Formats + +The following output formats are supported: + + - *MP3* (default) - MP3 audio format. + - *OggVorbis* - Ogg Vorbis audio format. + - *Pcm* - Raw PCM audio format. + - *Json* - Speech marks in JSON format. + +=== SSML Support + +Set the `textType` parameter to `SSML` to use Speech Synthesis Markup Language for fine-grained control over pronunciation, volume, pitch, and speech rate. diff --git a/kamelets/aws-polly-sink.kamelet.yaml b/kamelets/aws-polly-sink.kamelet.yaml new file mode 100644 index 000000000..159f4dd78 --- /dev/null +++ b/kamelets/aws-polly-sink.kamelet.yaml @@ -0,0 +1,149 @@ +# --------------------------------------------------------------------------- +# 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-polly-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+PHBhdGggZD0iTTQzMC40MiwxOTYuMzJjOC0xMS4zOSwyMS4xNS0zOC4zMywwLTcyLjEzYTUyLjc5LDUyLjc5LDAsMCwwLTE3LjA2LTE3LjMxYy0xLjUzLTgtNy41NC0yNy4yNi0zMS40Mi00My45MUMzNTksNDcsMzI1LjUyLDQ5LjUzLDMxOS40NCw1MC4xNmE2NC4yNyw2NC4yNywwLDAsMC0xNi4wNy0yLjk0Yy0xNy4xNy0uODEtMzAuMzcsMy44OS0zOS43OCwxNC [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "AWS Polly" + camel.apache.org/kamelet.namespace: "AWS" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "AWS Polly Sink" + description: Synthesize speech from text using AWS Polly. + required: + - region + type: object + properties: + voiceId: + title: Voice Id + description: The voice ID to use for speech synthesis (e.g., Joanna, Matthew, Amy, Brian). + type: string + outputFormat: + title: Output Format + description: The audio format in which the resulting stream will be encoded. + type: string + default: MP3 + enum: ["MP3", "OggVorbis", "Pcm", "Json"] + textType: + title: Text Type + description: Specifies whether the input text is plain text or SSML. + type: string + default: TEXT + enum: ["TEXT", "SSML"] + engine: + title: Engine + description: Specifies the engine (standard, neural, long-form, generative) for Amazon Polly to use when processing input text for speech synthesis. + type: string + enum: ["standard", "neural", "long-form", "generative"] + sampleRate: + title: Sample Rate + description: The audio frequency in Hz. + type: string + languageCode: + title: Language Code + description: Optional language code for voice synthesis. This is only necessary if using a bilingual voice. + 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", "a [...] + useDefaultCredentialsProvider: + title: Default Credentials Provider + description: If true, the Polly 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 Polly client should expect to load credentials through a profile credentials provider. + type: boolean + default: false + useSessionCredentials: + title: Session Credentials + description: Set whether the Polly 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 Polly. + 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-polly" + - "camel:kamelet" + template: + from: + uri: "kamelet:source" + steps: + - to: + uri: "aws2-polly:polly" + parameters: + secretKey: "{{?secretKey}}" + accessKey: "{{?accessKey}}" + region: "{{region}}" + operation: synthesizeSpeech + voiceId: "{{?voiceId}}" + outputFormat: "{{outputFormat}}" + textType: "{{textType}}" + engine: "{{?engine}}" + sampleRate: "{{?sampleRate}}" + languageCode: "{{?languageCode}}" + useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}" + useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}" + useSessionCredentials: "{{useSessionCredentials}}" + uriEndpointOverride: "{{?uriEndpointOverride}}" + profileCredentialsName: "{{?profileCredentialsName}}" + sessionToken: "{{?sessionToken}}" + overrideEndpoint: "{{overrideEndpoint}}" diff --git a/library/camel-kamelets/src/main/resources/kamelets/aws-polly-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/aws-polly-sink.kamelet.yaml new file mode 100644 index 000000000..159f4dd78 --- /dev/null +++ b/library/camel-kamelets/src/main/resources/kamelets/aws-polly-sink.kamelet.yaml @@ -0,0 +1,149 @@ +# --------------------------------------------------------------------------- +# 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-polly-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+PHBhdGggZD0iTTQzMC40MiwxOTYuMzJjOC0xMS4zOSwyMS4xNS0zOC4zMywwLTcyLjEzYTUyLjc5LDUyLjc5LDAsMCwwLTE3LjA2LTE3LjMxYy0xLjUzLTgtNy41NC0yNy4yNi0zMS40Mi00My45MUMzNTksNDcsMzI1LjUyLDQ5LjUzLDMxOS40NCw1MC4xNmE2NC4yNyw2NC4yNywwLDAsMC0xNi4wNy0yLjk0Yy0xNy4xNy0uODEtMzAuMzcsMy44OS0zOS43OCwxNC [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "AWS Polly" + camel.apache.org/kamelet.namespace: "AWS" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "AWS Polly Sink" + description: Synthesize speech from text using AWS Polly. + required: + - region + type: object + properties: + voiceId: + title: Voice Id + description: The voice ID to use for speech synthesis (e.g., Joanna, Matthew, Amy, Brian). + type: string + outputFormat: + title: Output Format + description: The audio format in which the resulting stream will be encoded. + type: string + default: MP3 + enum: ["MP3", "OggVorbis", "Pcm", "Json"] + textType: + title: Text Type + description: Specifies whether the input text is plain text or SSML. + type: string + default: TEXT + enum: ["TEXT", "SSML"] + engine: + title: Engine + description: Specifies the engine (standard, neural, long-form, generative) for Amazon Polly to use when processing input text for speech synthesis. + type: string + enum: ["standard", "neural", "long-form", "generative"] + sampleRate: + title: Sample Rate + description: The audio frequency in Hz. + type: string + languageCode: + title: Language Code + description: Optional language code for voice synthesis. This is only necessary if using a bilingual voice. + 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", "a [...] + useDefaultCredentialsProvider: + title: Default Credentials Provider + description: If true, the Polly 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 Polly client should expect to load credentials through a profile credentials provider. + type: boolean + default: false + useSessionCredentials: + title: Session Credentials + description: Set whether the Polly 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 Polly. + 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-polly" + - "camel:kamelet" + template: + from: + uri: "kamelet:source" + steps: + - to: + uri: "aws2-polly:polly" + parameters: + secretKey: "{{?secretKey}}" + accessKey: "{{?accessKey}}" + region: "{{region}}" + operation: synthesizeSpeech + voiceId: "{{?voiceId}}" + outputFormat: "{{outputFormat}}" + textType: "{{textType}}" + engine: "{{?engine}}" + sampleRate: "{{?sampleRate}}" + languageCode: "{{?languageCode}}" + useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}" + useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}" + useSessionCredentials: "{{useSessionCredentials}}" + uriEndpointOverride: "{{?uriEndpointOverride}}" + profileCredentialsName: "{{?profileCredentialsName}}" + sessionToken: "{{?sessionToken}}" + overrideEndpoint: "{{overrideEndpoint}}" diff --git a/templates/pipes/camel-k/aws-polly-sink-pipe.yaml b/templates/pipes/camel-k/aws-polly-sink-pipe.yaml new file mode 100644 index 000000000..4cab2de93 --- /dev/null +++ b/templates/pipes/camel-k/aws-polly-sink-pipe.yaml @@ -0,0 +1,19 @@ +apiVersion: camel.apache.org/v1 +kind: Pipe +metadata: + name: aws-polly-sink-pipe +spec: + source: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + sink: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1 + name: aws-polly-sink + properties: + accessKey: "The Access Key" + secretKey: "The Secret Key" + region: "eu-west-1" diff --git a/templates/pipes/core/aws-polly-sink-pipe.yaml b/templates/pipes/core/aws-polly-sink-pipe.yaml new file mode 100644 index 000000000..4b0a9ccb0 --- /dev/null +++ b/templates/pipes/core/aws-polly-sink-pipe.yaml @@ -0,0 +1,13 @@ +- route: + from: + uri: "kamelet:timer-source" + parameters: + period: 1000 + message: "Hello from Camel" + steps: + - to: + uri: "kamelet:aws-polly-sink" + parameters: + accessKey: "The Access Key" + secretKey: "The Secret Key" + region: "eu-west-1"
