Skip to content
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

AWS Secrets Manager Sink Kamelet #586

Merged
merged 9 commits into from
Nov 26, 2021
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* xref:ROOT:aws-s3-sink.adoc[image:kamelets/aws-s3-sink.svg[] AWS S3 Sink]
* xref:ROOT:aws-s3-source.adoc[image:kamelets/aws-s3-source.svg[] AWS S3 Source]
* xref:ROOT:aws-s3-streaming-upload-sink.adoc[image:kamelets/aws-s3-streaming-upload-sink.svg[] AWS S3 Streaming upload Sink]
* xref:ROOT:aws-secrets-manager-sink.adoc[image:kamelets/aws-secrets-manager-sink.svg[] AWS Secrets Manager Sink]
* xref:ROOT:aws-sns-fifo-sink.adoc[image:kamelets/aws-sns-fifo-sink.svg[] AWS SNS FIFO Sink]
* xref:ROOT:aws-sns-sink.adoc[image:kamelets/aws-sns-sink.svg[] AWS SNS Sink]
* xref:ROOT:aws-sqs-batch-sink.adoc[image:kamelets/aws-sqs-batch-sink.svg[] AWS SQS Batch Sink]
Expand Down
158 changes: 158 additions & 0 deletions docs/modules/ROOT/pages/aws-secrets-manager-sink.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT

= image:kamelets/aws-secrets-manager-sink.svg[] AWS Secrets Manager Sink

*Provided by: "Apache Software Foundation"*

*Support Level for this Kamelet is: "Preview"*

Create a secret in AWS Secrets Manager

The Kamelet expects the following headers to be set:

- `secret-name` / `ce-secret-name`: as the secret name to create.

If the header won't be set the exchange ID will be used as secret name.

== Configuration Options

The following table summarizes the configuration options available for the `aws-secrets-manager-sink` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *accessKey {empty}* *| Access Key| The access key obtained from AWS.| string| |
| *region {empty}* *| AWS Region| The AWS region to connect to.| string| | `"eu-west-1"`
| *secretKey {empty}* *| Secret Key| The secret key obtained from AWS.| string| |
|===

NOTE: Fields marked with an asterisk ({empty}*) are mandatory.


== Dependencies

At runtime, the `aws-secrets-manager-sink` Kamelet relies upon the presence of the following dependencies:

- camel:aws-secrets-manager
- camel:kamelet

== Usage

This section describes how you can use the `aws-secrets-manager-sink`.

=== Knative Sink

You can use the `aws-secrets-manager-sink` Kamelet as a Knative sink by binding it to a Knative object.

.aws-secrets-manager-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: aws-secrets-manager-sink-binding
spec:
source:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: aws-secrets-manager-sink
properties:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"

----

==== *Prerequisite*

You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.

==== *Procedure for using the cluster CLI*

. Save the `aws-secrets-manager-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.

. Run the sink by using the following command:
+
[source,shell]
----
kubectl apply -f aws-secrets-manager-sink-binding.yaml
----

==== *Procedure for using the Kamel CLI*

Configure and run the sink by using the following command:

[source,shell]
----
kamel bind channel:mychannel aws-secrets-manager-sink -p "sink.accessKey=The Access Key" -p "sink.region=eu-west-1" -p "sink.secretKey=The Secret Key"
----

This command creates the KameletBinding in the current namespace on the cluster.

=== Kafka Sink

You can use the `aws-secrets-manager-sink` Kamelet as a Kafka sink by binding it to a Kafka topic.

.aws-secrets-manager-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: aws-secrets-manager-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: aws-secrets-manager-sink
properties:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"

----

==== *Prerequisites*

* You've installed https://strimzi.io/[Strimzi].
* You've created a topic named `my-topic` in the current namespace.
* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.

==== *Procedure for using the cluster CLI*

. Save the `aws-secrets-manager-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.

. Run the sink by using the following command:
+
[source,shell]
----
kubectl apply -f aws-secrets-manager-sink-binding.yaml
----

==== *Procedure for using the Kamel CLI*

Configure and run the sink by using the following command:

[source,shell]
----
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic aws-secrets-manager-sink -p "sink.accessKey=The Access Key" -p "sink.region=eu-west-1" -p "sink.secretKey=The Secret Key"
----

This command creates the KameletBinding in the current namespace on the cluster.

== Kamelet source file

https://github.com/apache/camel-kamelets/blob/main/aws-secrets-manager-sink.kamelet.yaml

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
81 changes: 81 additions & 0 deletions kamelets/aws-secrets-manager-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: aws-secrets-manager-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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd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DIyLjgxLDAsMCwwLDUxLDU2LjJaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNMTguODUsNTFsMS42Mi0xLjE4YTIwLjcsMjAuNywwLDAsMS0zLjkzLTExLjMyaDJ2LTJoLTJhMjAuODYsMjAuODYsMCwwLDEsMy45My0xMS4yNmwtMS42Mi0xLjE4YTIyLjg3LDIyLjg3LDAsMCwwLTQuMzEsMTIuNDRoLTJ2MmgyQTIyLjcyLDIyLjcyLDAsMCwwLDE4Ljg1LDUxWiIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTQyLjM5LDI0LjI1YTcuNSw3LjUsMCwwLDAtNC44OS0xLjczaDBjLTMuODYsMC03LDIuNzMtNyw2LjA5djQuOTFoLTJhMSwxLDAsMCwwLTEsMXYxNGExLDEsMCwwLDAsLjI5LjcxLDEsMSwwLDAsMCwuNzEuMjloMThhMSwxLDAsMCwwLDEtMXYtMTRhMSwxLDAsMCwwLS4yOS0uNywxLDEsMCwwLDAtLjcxLS4zaC0ydi00LjlBNS43MSw1LjcxLDAsMCwwLDQyLjM5LDI0LjI1Wk0zMi41LDI4LjYxYzAtMi4yNiwyLjI1LTQuMDksNS00LjA5aDBhNS41NSw1LjU1LDAsMCwxLDMuNiwxLjI1LDMuNzYsMy43NiwwLDAsMSwxLjQxLDIuODV2NC45aC0xMFptMTMsOS45MWgtM3YyaDN2MmgtM3YyaDN2M2gtMTZ2LTEyaDE2WiIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTM2LjUsNDIuNzZ2Mi43NmgyVjQyLjc2YTIuOTMsMi45MywwLDEsMC0yLDBabTEtMy44MkExLjA4LDEuMDgsMCwxLDEsMzYuNDMsNDAsMS4wNywxLjA3LDAsMCwxLDM3LjUsMzguOTRaIi8+PC9nPjwvZz48L3N2Zz4K"
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "AWS Secrets Manager"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "AWS Secrets Manager Sink"
description: |-
Create a secret in AWS Secrets Manager

The Kamelet expects the following headers to be set:

- `secret-name` / `ce-secret-name`: as the secret name to create.

If the header won't be set the exchange ID will be used as secret name.
required:
- accessKey
- secretKey
- region
type: object
properties:
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
dependencies:
- "camel:aws-secrets-manager"
- "camel:kamelet"
flow:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[secret-name]}"
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${header[secret-name]}"
- simple: "${header[ce-secret-name]}"
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${header[ce-secret-name]}"
otherwise:
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${exchangeId}"
- to:
uri: "aws-secrets-manager:kamelet"
parameters:
secretKey: "{{secretKey}}"
accessKey: "{{accessKey}}"
region: "{{region}}"
operation: "createSecret"
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: aws-secrets-manager-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,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNzUgNzUiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6dXJsKCNSZW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jAuODYsMjAuODYsMCwwLDEsMy45My0xMS4yNmwtMS42Mi0xLjE4YTIyLjg3LDIyLjg3LDAsMCwwLTQuMzEsMTIuNDRoLTJ2MmgyQTIyLjcyLDIyLjcyLDAsMCwwLDE4Ljg1LDUxWiIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTQyLjM5LDI0LjI1YTcuNSw3LjUsMCwwLDAtNC44OS0xLjczaDBjLTMuODYsMC03LDIuNzMtNyw2LjA5djQuOTFoLTJhMSwxLDAsMCwwLTEsMXYxNGExLDEsMCwwLDAsLjI5LjcxLDEsMSwwLDAsMCwuNzEuMjloMThhMSwxLDAsMCwwLDEtMXYtMTRhMSwxLDAsMCwwLS4yOS0uNywxLDEsMCwwLDAtLjcxLS4zaC0ydi00LjlBNS43MSw1LjcxLDAsMCwwLDQyLjM5LDI0LjI1Wk0zMi41LDI4LjYxYzAtMi4yNiwyLjI1LTQuMDksNS00LjA5aDBhNS41NSw1LjU1LDAsMCwxLDMuNiwxLjI1LDMuNzYsMy43NiwwLDAsMSwxLjQxLDIuODV2NC45aC0xMFptMTMsOS45MWgtM3YyaDN2MmgtM3YyaDN2M2gtMTZ2LTEyaDE2WiIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0iTTM2LjUsNDIuNzZ2Mi43NmgyVjQyLjc2YTIuOTMsMi45MywwLDEsMC0yLDBabTEtMy44MkExLjA4LDEuMDgsMCwxLDEsMzYuNDMsNDAsMS4wNywxLjA3LDAsMCwxLDM3LjUsMzguOTRaIi8+PC9nPjwvZz48L3N2Zz4K"
camel.apache.org/provider: "Apache Software Foundation"
camel.apache.org/kamelet.group: "AWS Secrets Manager"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "AWS Secrets Manager Sink"
description: |-
Create a secret in AWS Secrets Manager

The Kamelet expects the following headers to be set:

- `secret-name` / `ce-secret-name`: as the secret name to create.

If the header won't be set the exchange ID will be used as secret name.
required:
- accessKey
- secretKey
- region
type: object
properties:
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
dependencies:
- "camel:aws-secrets-manager"
- "camel:kamelet"
flow:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[secret-name]}"
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${header[secret-name]}"
- simple: "${header[ce-secret-name]}"
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${header[ce-secret-name]}"
otherwise:
steps:
- set-header:
name: CamelAwsSecretsManagerSecretName
simple: "${exchangeId}"
- to:
uri: "aws-secrets-manager:kamelet"
parameters:
secretKey: "{{secretKey}}"
accessKey: "{{accessKey}}"
region: "{{region}}"
operation: "createSecret"
20 changes: 20 additions & 0 deletions templates/bindings/camel-k/aws-secrets-manager-sink-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: aws-secrets-manager-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: aws-secrets-manager-sink
properties:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"

14 changes: 14 additions & 0 deletions templates/bindings/core/aws-secrets-manager-sink-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 1000
message: "Hello Camel JBang"
steps:
- to:
uri: "kamelet:aws-secrets-manager-sink"
parameters:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"