-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kamelet aws-ddb-sink #819
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# --------------------------------------------------------------------------- | ||
# 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/v1alpha1 | ||
kind: Kamelet | ||
metadata: | ||
name: aws-ddb-sink | ||
annotations: | ||
camel.apache.org/kamelet.support.level: "Preview" | ||
camel.apache.org/catalog.version: "main-SNAPSHOT" | ||
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwMCIgd2lkdGg9IjEwMCIgeG1sbnM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k2bC0xLjg2Ny4wMjgtLjM1NS0uMDM0djcuNjE4bDIuMjIyIDEuMTk1djEuODU1bC0yLjEyOS4yMzUtLjA5My0uMDd2Ny42NTJsNy40OCA4Ljc2NFY2Ny41NjRsMTQuMzAzIDQuNDMySDU5LjgyOGwxNC4zNDUtNC40NDUgNy40MzgtNS4zNjctMi4yMjItLjI0NXYtMS44MThsLTUuMjE2IDIuODA1LTE0LjM0NSAzLjI5NXYuMDA0SDM5LjUwNnYtLjAwNGwtMTQuMzQ4LTMuMjk1LS4wMjUtLjA1MS4wNy4wMzdWNTEuOTY1bDE0LjMwMy41N3YuMDE0SDU5LjgyOHYtLjAxNGwxNC4zMDMtLjU3IDcuNDgtLjY1Ni0yLjIyMi0uMDMydi0zLjE5NnoiLz48L3N2Zz4=" | ||
camel.apache.org/provider: "Apache Software Foundation" | ||
camel.apache.org/kamelet.group: "AWS DynamoDB Streams" | ||
labels: | ||
camel.apache.org/kamelet.type: "sink" | ||
spec: | ||
definition: | ||
title: "AWS DynamoDB Sink" | ||
description: |- | ||
Send data to AWS DynamoDB service. The sent data will insert/update/delete an item on the given AWS DynamoDB table. | ||
|
||
Access Key/Secret Key are the basic method for authenticating to the AWS DynamoDB service. These parameters are optional, because the Kamelet provide also the 'useDefaultCredentialsProvider'. | ||
|
||
When using a default Credentials Provider the AWS DynamoDB client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet. | ||
|
||
This Kamelet expects a JSON as body. The mapping between the JSON fields and table attribute values is done by key, so if you have the input: | ||
|
||
'{"username":"oscerd", "city":"Rome"}' | ||
|
||
The Kamelet will insert/update an item in the given AWS DynamoDB table and set the attributes 'username' and 'city' respectively. Please note that the JSON object must include the primary key values that define the item. | ||
required: | ||
- table | ||
- region | ||
type: object | ||
properties: | ||
table: | ||
title: Table | ||
description: Name of the DynamoDB table to look at | ||
type: string | ||
accessKey: | ||
title: Access Key | ||
description: The access key obtained from AWS | ||
type: string | ||
format: password | ||
x-descriptors: | ||
- urn:alm:descriptor:com.tectonic.ui:password | ||
- urn:camel:group:credentials | ||
secretKey: | ||
title: Secret Key | ||
description: The secret key obtained from AWS | ||
type: string | ||
format: password | ||
x-descriptors: | ||
- urn:alm:descriptor:com.tectonic.ui:password | ||
- urn:camel:group:credentials | ||
region: | ||
title: AWS Region | ||
description: The AWS region to connect to | ||
type: string | ||
example: eu-west-1 | ||
operation: | ||
title: Operation | ||
description: The operation to perform (one of PutItem, UpdateItem, DeleteItem) | ||
type: string | ||
default: PutItem | ||
example: PutItem | ||
writeCapacity: | ||
title: Write Capacity | ||
description: The provisioned throughput to reserved for writing resources to your table | ||
type: integer | ||
default: 1 | ||
useDefaultCredentialsProvider: | ||
title: Default Credentials Provider | ||
description: Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | ||
type: boolean | ||
x-descriptors: | ||
- 'urn:alm:descriptor:com.tectonic.ui:checkbox' | ||
default: false | ||
uriEndpointOverride: | ||
title: Overwritte Endpoint URI | ||
description: Set the overriding endpoint URI. This option needs to be used in combination with overrideEndpoint option. | ||
type: string | ||
overrideEndpoint: | ||
title: Endpoint Overwrite | ||
description: Set the need for overiding the endpoint URI. This option needs to be used in combination with uriEndpointOverride setting. | ||
type: boolean | ||
x-descriptors: | ||
- 'urn:alm:descriptor:com.tectonic.ui:checkbox' | ||
default: false | ||
types: | ||
in: | ||
mediaType: application/json | ||
dependencies: | ||
- github:apache.camel-kamelets:camel-kamelets-utils:main-SNAPSHOT | ||
- "camel:core" | ||
- "camel:jackson" | ||
- "camel:aws2-ddb" | ||
- "camel:kamelet" | ||
template: | ||
from: | ||
uri: "kamelet:source" | ||
steps: | ||
- set-property: | ||
name: operation | ||
constant: "{{operation}}" | ||
- unmarshal: | ||
json: | ||
library: Jackson | ||
unmarshalType: com.fasterxml.jackson.databind.JsonNode | ||
- bean: "org.apache.camel.kamelets.utils.transform.aws.ddb.JsonToDdbModelConverter" | ||
- to: | ||
uri: "aws2-ddb:{{table}}" | ||
parameters: | ||
secretKey: "{{?secretKey}}" | ||
accessKey: "{{?accessKey}}" | ||
region: "{{region}}" | ||
operation: "{{operation}}" | ||
writeCapacity: "{{?writeCapacity}}" | ||
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}" | ||
uriEndpointOverride: "{{?uriEndpointOverride}}" | ||
overrideEndpoint: "{{overrideEndpoint}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having me as example :-)