davsclaus opened a new pull request, #3290:
URL: https://github.com/apache/camel-kamelets/pull/3290

   ## What
   
   `aws-lambda-sink`, `aws-secrets-manager-sink` and `aws-translate-action` 
were the only AWS SDK based Kamelets without the endpoint override options (the 
other one without them, `aws-redshift-*`, uses JDBC). This adds to each of them:
   
   - `uriEndpointOverride` (string) and `overrideEndpoint` (boolean, `default: 
false`), with the title, description and example copied from `aws-sqs-sink`.
   - In the template, `overrideEndpoint: "{{overrideEndpoint}}"` and 
`uriEndpointOverride: "{{?uriEndpointOverride}}"`, as the siblings pass them 
(in the URI string for `aws-translate-action`, which builds its endpoint as one 
URI).
   
   With the default `overrideEndpoint: false` nothing changes for existing 
users.
   
   ## What was verified
   
   - The Camel catalog (4.24.0-SNAPSHOT) lists both `overrideEndpoint` 
(boolean, default false) and `uriEndpointOverride` (string) as endpoint 
parameters of `aws2-lambda`, `aws-secrets-manager` and `aws2-translate`.
   
   ## How it was tested
   
   - `aws-lambda-sink`: the existing test reached the Citrus HTTP stand-in 
through the `AWS_ENDPOINT_URL_LAMBDA` environment variable, because the Kamelet 
had no option. It now sets `overrideEndpoint`/`uriEndpointOverride` instead, 
with the environment variable removed, and still checks the call at 
`/2015-03-31/functions/enrich-order/invocations`.
   - `aws-secrets-manager-sink`: the same change; the existing test used 
`AWS_ENDPOINT_URL_SECRETS_MANAGER` to reach Floci and now uses the option. It 
checks through Floci that the secret was created with the body as its value.
   - `aws-translate-action` (new test `aws/translate`, new `AwsIT#awsTranslate` 
factory): points `uriEndpointOverride` at the Citrus HTTP server. The AWS SDK 
talks to Amazon Translate in the Smithy RPC v2 CBOR protocol, so the test 
checks the method, the path 
`/service/AWSShineFrontendService_20170701/operation/TranslateText` and the 
`smithy-protocol: rpc-v2-cbor` header, not the binary body. It answers with a 
CBOR `TranslateText` response (`{"TranslatedText":"Hello world",...}`, written 
through `ISO-8859-1` so that its one byte above 0x7F goes out as is), and 
checks that the body afterwards is the String `Hello world`.
   - In all three tests no environment variable sets the endpoint, so the 
request reaches the stand-in only through the new options (otherwise it would 
go to AWS and fail with the test credentials).
   - `./mvnw clean install -DskipITs` from the root, twice: BUILD SUCCESS (the 
library copies are included in this PR).
   - `./mvnw -o verify -pl tests/camel-kamelets-itest 
-Dit.test='AwsIT#awsLambda+awsSecretsManager+awsTranslate'`: 3 tests, 0 
failures.
   
   ## Overlap
   
   The draft PR #3285 also edits `kamelets/aws-lambda-sink.kamelet.yaml` (it 
adds `invocationType`/`logType`, in other lines than this PR) and adds the test 
`aws/lambda/aws-lambda-sink-async-route`. The `aws-lambda-sink` change here is 
kept minimal; whichever PR merges second merges main in. If the new async test 
uses `AWS_ENDPOINT_URL_LAMBDA`, it can switch to `uriEndpointOverride` then.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to