This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 113b8dd7e Fix #1938: add an AWS Bedrock Agent sink Kamelet (#2997)
113b8dd7e is described below

commit 113b8dd7ef75023695f692e5acacebd88c94ba69
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Sep 3 18:33:44 2026 +0200

    Fix #1938: add an AWS Bedrock Agent sink Kamelet (#2997)
    
    * Fix #1938: add an AWS Bedrock Agent sink Kamelet
    
    The catalog already covers aws-bedrock (aws-bedrock-text-sink) and
    aws-bedrock-agent-runtime (aws-bedrock-agent-runtime-sink). The
    aws-bedrock-agent component had no Kamelet, which is the gap this closes:
    managing the data source ingestion jobs of a knowledge base via
    startIngestionJob, listIngestionJobs and getIngestionJob.
    
    BedrockAgentProducer.determineOperation reads CamelAwsBedrockAgentOperation
    from the message before falling back to the endpoint, and knowledgeBaseId
    and dataSourceId are header-overridable the same way. A sink that pins
    those three as properties therefore has to strip the family, or an inbound
    header could redirect the call to a different knowledge base or a different
    operation. Same shape as the aws-ec2-sink strip.
    
    CamelAwsBedrockAgentIngestionJobId is excluded from the strip: it is the
    one input the Kamelet deliberately takes from the message, since
    getIngestionJob has to name a job.
    
    Marked Preview, no Citrus test: exercising this needs a real Bedrock
    knowledge base and there is no emulator for it in the project's toolchain.
    
    Verified with `camel run` against the real component -- the route starts
    with every parameter bound -- and the strip verified with the terminal
    endpoint swapped for a log:
    
      in:  Operation=listIngestionJobs, KnowledgeBaseId=attacker-kb,
           DataSourceId=attacker-ds, IngestionJobId=job-42, keepMe=yes
      out: CamelAwsBedrockAgentIngestionJobId=job-42, keepMe=yes
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    
    * Fix #1938: update the AWS namespace count in KameletsCatalogTest
    
    KameletsCatalogTest.testGetKameletsByNamespace asserts an exact count for
    the AWS namespace, so adding aws-bedrock-agent-sink takes it from 31 to
    32 and the catalog module's tests fail.
    
    Verified against the tree rather than just following the CI delta: 31
    kamelets carry kamelet.namespace "AWS" on main, 32 with this branch.
    
    Only the AWS namespace is count-asserted, which is why the SMPP and SNMP
    Kamelets added in #2988, #2989 and #2990 did not trip it.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 docs/modules/ROOT/nav.adoc                         |   1 +
 kamelets/aws-bedrock-agent-sink.kamelet.yaml       | 142 +++++++++++++++++++++
 .../kamelets/catalog/KameletsCatalogTest.java      |   2 +-
 .../kamelets/aws-bedrock-agent-sink.kamelet.yaml   | 142 +++++++++++++++++++++
 4 files changed, 286 insertions(+), 1 deletion(-)

diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 5f50081d3..a3d0047e7 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -2,6 +2,7 @@
 * xref:avro-deserialize-action.adoc[]
 * xref:avro-serialize-action.adoc[]
 * xref:aws-bedrock-agent-runtime-sink.adoc[]
+* xref:aws-bedrock-agent-sink.adoc[]
 * xref:aws-bedrock-text-sink.adoc[]
 * xref:aws-cloudtrail-source.adoc[]
 * xref:aws-cloudwatch-sink.adoc[]
diff --git a/kamelets/aws-bedrock-agent-sink.kamelet.yaml 
b/kamelets/aws-bedrock-agent-sink.kamelet.yaml
new file mode 100644
index 000000000..a9a87441a
--- /dev/null
+++ b/kamelets/aws-bedrock-agent-sink.kamelet.yaml
@@ -0,0 +1,142 @@
+# ---------------------------------------------------------------------------
+# 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-bedrock-agent-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "4.22.1-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 Bedrock"
+    camel.apache.org/kamelet.namespace: "AWS"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS Bedrock Agent Sink"
+    description: |-
+      Manage the data source ingestion jobs of an AWS Bedrock knowledge base.
+
+      Use startIngestionJob to kick off an ingestion of the configured data 
source, listIngestionJobs to list the jobs of a knowledge base, or 
getIngestionJob to look one up. For getIngestionJob the job id is taken from 
the CamelAwsBedrockAgentIngestionJobId header.
+    required:
+      - knowledgeBaseId
+      - region
+    type: object
+    properties:
+      knowledgeBaseId:
+        title: Knowledge Base Id
+        description: The Knowledge Base the ingestion job belongs to.
+        type: string
+      dataSourceId:
+        title: Data Source Id
+        description: The data source to ingest. Required by the 
startIngestionJob operation.
+        type: string
+      operation:
+        title: Operation
+        description: The ingestion job operation to perform.
+        type: string
+        default: startIngestionJob
+        enum: ["startIngestionJob", "listIngestionJobs", "getIngestionJob"]
+      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: ["us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", 
"ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", 
"ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", 
"eu-west-2", "eu-west-3", "sa-east-1"]
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: If true, the SDK looks for credentials through the 
default provider chain rather than the accessKey and secretKey properties.
+        type: boolean
+        default: false
+      useProfileCredentialsProvider:
+        title: Profile Credentials Provider
+        description: Set whether the Bedrock client should expect to load 
credentials through a profile credentials provider.
+        type: boolean
+        default: false
+      useSessionCredentials:
+        title: Session Credentials
+        description: Set whether the Bedrock client should expect to use 
session credentials. This is useful in a session token scenario.
+        type: boolean
+        default: false
+      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
+      profileCredentialsName:
+        title: Profile Credentials Name
+        description: If using a profile credentials provider, this parameter 
states the profile name.
+        type: string
+      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:aws-bedrock"
+    - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      # Strip the camel-aws-bedrock-agent header family up-front, before the
+      # endpoint below is reached: the operation, knowledge base and data 
source
+      # are all pinned by the properties above, and every one of them is
+      # overridable by an inbound CamelAwsBedrockAgent* header. The ingestion 
job
+      # id is the one input this Kamelet deliberately takes from the message, 
so
+      # it is excluded. A pattern also covers keys the component may add later.
+      - removeHeaders:
+          pattern: "CamelAwsBedrockAgent*"
+          excludePattern: "CamelAwsBedrockAgentIngestionJobId"
+      - to:
+          uri: "aws-bedrock-agent:bedrock-agent"
+          parameters:
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
+            region: "{{region}}"
+            operation: "{{operation}}"
+            knowledgeBaseId: "{{knowledgeBaseId}}"
+            dataSourceId: "{{?dataSourceId}}"
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
+            useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}"
+            useSessionCredentials: "{{useSessionCredentials}}"
+            uriEndpointOverride: "{{?uriEndpointOverride}}"
+            profileCredentialsName: "{{?profileCredentialsName}}"
+            sessionToken: "{{?sessionToken}}"
+            overrideEndpoint: "{{overrideEndpoint}}"
diff --git 
a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
 
b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
index aa1a67f65..7ff4cd89f 100644
--- 
a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
+++ 
b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
@@ -121,7 +121,7 @@ public class KameletsCatalogTest {
     void testGetKameletsByNamespace() throws Exception {
         List<Kamelet> c = catalog.getKameletsByNamespace("AWS");
         assertFalse(c.isEmpty());
-        assertEquals(31, c.size());
+        assertEquals(32, c.size());
         c = catalog.getKameletsByGroups("Not-existing-group");
         assertTrue(c.isEmpty());
     }
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-agent-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-agent-sink.kamelet.yaml
new file mode 100644
index 000000000..a9a87441a
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/aws-bedrock-agent-sink.kamelet.yaml
@@ -0,0 +1,142 @@
+# ---------------------------------------------------------------------------
+# 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-bedrock-agent-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "4.22.1-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 Bedrock"
+    camel.apache.org/kamelet.namespace: "AWS"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS Bedrock Agent Sink"
+    description: |-
+      Manage the data source ingestion jobs of an AWS Bedrock knowledge base.
+
+      Use startIngestionJob to kick off an ingestion of the configured data 
source, listIngestionJobs to list the jobs of a knowledge base, or 
getIngestionJob to look one up. For getIngestionJob the job id is taken from 
the CamelAwsBedrockAgentIngestionJobId header.
+    required:
+      - knowledgeBaseId
+      - region
+    type: object
+    properties:
+      knowledgeBaseId:
+        title: Knowledge Base Id
+        description: The Knowledge Base the ingestion job belongs to.
+        type: string
+      dataSourceId:
+        title: Data Source Id
+        description: The data source to ingest. Required by the 
startIngestionJob operation.
+        type: string
+      operation:
+        title: Operation
+        description: The ingestion job operation to perform.
+        type: string
+        default: startIngestionJob
+        enum: ["startIngestionJob", "listIngestionJobs", "getIngestionJob"]
+      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: ["us-east-1", "us-east-2", "us-west-2", "us-gov-west-1", 
"ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", 
"ap-southeast-2", "ca-central-1", "eu-central-1", "eu-central-2", "eu-west-1", 
"eu-west-2", "eu-west-3", "sa-east-1"]
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: If true, the SDK looks for credentials through the 
default provider chain rather than the accessKey and secretKey properties.
+        type: boolean
+        default: false
+      useProfileCredentialsProvider:
+        title: Profile Credentials Provider
+        description: Set whether the Bedrock client should expect to load 
credentials through a profile credentials provider.
+        type: boolean
+        default: false
+      useSessionCredentials:
+        title: Session Credentials
+        description: Set whether the Bedrock client should expect to use 
session credentials. This is useful in a session token scenario.
+        type: boolean
+        default: false
+      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
+      profileCredentialsName:
+        title: Profile Credentials Name
+        description: If using a profile credentials provider, this parameter 
states the profile name.
+        type: string
+      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:aws-bedrock"
+    - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      # Strip the camel-aws-bedrock-agent header family up-front, before the
+      # endpoint below is reached: the operation, knowledge base and data 
source
+      # are all pinned by the properties above, and every one of them is
+      # overridable by an inbound CamelAwsBedrockAgent* header. The ingestion 
job
+      # id is the one input this Kamelet deliberately takes from the message, 
so
+      # it is excluded. A pattern also covers keys the component may add later.
+      - removeHeaders:
+          pattern: "CamelAwsBedrockAgent*"
+          excludePattern: "CamelAwsBedrockAgentIngestionJobId"
+      - to:
+          uri: "aws-bedrock-agent:bedrock-agent"
+          parameters:
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
+            region: "{{region}}"
+            operation: "{{operation}}"
+            knowledgeBaseId: "{{knowledgeBaseId}}"
+            dataSourceId: "{{?dataSourceId}}"
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
+            useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}"
+            useSessionCredentials: "{{useSessionCredentials}}"
+            uriEndpointOverride: "{{?uriEndpointOverride}}"
+            profileCredentialsName: "{{?profileCredentialsName}}"
+            sessionToken: "{{?sessionToken}}"
+            overrideEndpoint: "{{overrideEndpoint}}"

Reply via email to