This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/master by this push: new 23b509b AWS S3 Sink Kamelet 23b509b is described below commit 23b509b6050fe61cb4a12578f8bd8e8157042d49 Author: Claudio Miranda <clau...@claudius.com.br> AuthorDate: Tue Mar 30 00:20:31 2021 -0300 AWS S3 Sink Kamelet --- aws-s3-sink.kamelet.yaml | 94 ++++++++++++++++++++++ .../ROOT/assets/images/kamelets/aws-s3-sink.svg | 1 + docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/aws-s3-sink.adoc | 71 ++++++++++++++++ 4 files changed, 167 insertions(+) diff --git a/aws-s3-sink.kamelet.yaml b/aws-s3-sink.kamelet.yaml new file mode 100644 index 0000000..5caafb2 --- /dev/null +++ b/aws-s3-sink.kamelet.yaml @@ -0,0 +1,94 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: aws-s3-sink + annotations: + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjAiIHk9IjAiIHZpZXdCb3g9IjAgMCAyNDguMiAzMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3QyOHtmaWxsOiM4YzMxMjN9LnN0Mjl7ZmlsbDojZTA1MjQzfTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MjgiIGQ9Ik0yMCA1Mi4xTDAgNjJ2MTc1LjVsMjAgOS45LjEtLjFWNTIuMmwtLjEtLjEiLz48cGF0aCBjbGFzcz0ic3QyOSIgZD0iTTEyNyAyMjJMMjAgMjQ3LjVWNTIuMUwxMjcgNzd2MTQ1Ii8+PHBhdGggY2xhc3M9InN0MjgiIG [...] + camel.apache.org/provider: "Apache Software Foundation" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "AWS S3 Sink" + description: |- + Upload data to AWS S3. + + The Kamelet expects the following headers to be set: + + - `file` / `ce-file`: as the file name to upload + + If the header won't be set the exchange ID will be used as file name. + required: + - bucketNameOrArn + - accessKey + - secretKey + - region + properties: + bucketNameOrArn: + title: Bucket Name + description: The S3 Bucket name or ARN. + type: string + accessKey: + title: Access Key + description: The access key obtained from AWS. + type: string + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password + secretKey: + title: Secret Key + description: The secret key obtained from AWS. + type: string + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password + region: + title: AWS Region + description: The AWS region to connect to. + type: string + example: eu-west-1 + overrideEndpoint: + title: Override Endpoint + description: Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride. + type: boolean + default: false + uriEndpointOverride: + title: Override Endpoint URI + description: Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option. + type: string + example: "http://another-s3-endpoint:9000" + autoCreateBucket: + title: Autocreate bucket + description: Setting the autocreation of the S3 bucket bucketName. + type: boolean + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' + default: false + flow: + from: + uri: "kamelet:source" + steps: + - choice: + when: + - simple: "${header[file]}" + steps: + - set-header: + name: CamelAwsS3Key + simple: "${header[file]}" + - simple: "${header[ce-file]}" + steps: + - set-header: + name: CamelAwsS3Key + simple: "${header[ce-file]}" + otherwise: + steps: + - set-header: + name: CamelAwsS3Key + simple: "${exchangeId}" + - to: + uri: "aws2-s3:{{bucketNameOrArn}}" + parameters: + secretKey: "{{secretKey}}" + accessKey: "{{accessKey}}" + region: "{{region}}" + uriEndpointOverride: "{{uriEndpointOverride}}" + overrideEndpoint: "{{overrideEndpoint}}" + autoCreateBucket: "{{autoCreateBucket}}" diff --git a/docs/modules/ROOT/assets/images/kamelets/aws-s3-sink.svg b/docs/modules/ROOT/assets/images/kamelets/aws-s3-sink.svg new file mode 100644 index 0000000..1d0f76b --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/aws-s3-sink.svg @@ -0,0 +1 @@ +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 248.2 300" xml:space="preserve"><style>.st28{fill:#8c3123}.st29{fill:#e05243}</style><path class="st28" d="M20 52.1L0 62v175.5l20 9.9.1-.1V52.2l-.1-.1"/><path class="st29" d="M127 222L20 247.5V52.1L127 77v145"/><path class="st28" d="M78.7 182.1l45.4 5.8.3-.7.3-74.4-.5-.6-45.4 5.7-.1 64.2"/><path class="st28" d="M124.1 222.3l104.1 25.2.2-.3V52.1l-.2-.2-104.1 25.4v145"/><path class="st29" d="M169.5 [...] \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index cc46cb9..d282f0d 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -3,6 +3,7 @@ * xref:ROOT:aws-kinesis-firehose-sink.adoc[image:kamelets/aws-kinesis-firehose-sink.svg[] AWS Kinesis Firehose Sink] * xref:ROOT:aws-kinesis-source.adoc[image:kamelets/aws-kinesis-source.svg[] AWS Kinesis Source] * xref:ROOT:aws-lambda-sink.adoc[image:kamelets/aws-lambda-sink.svg[] AWS Lambda Sink] +* 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-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] diff --git a/docs/modules/ROOT/pages/aws-s3-sink.adoc b/docs/modules/ROOT/pages/aws-s3-sink.adoc new file mode 100644 index 0000000..9918009 --- /dev/null +++ b/docs/modules/ROOT/pages/aws-s3-sink.adoc @@ -0,0 +1,71 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/aws-s3-sink.svg[] AWS S3 Sink + +*Provided by: "Apache Software Foundation"* + +Send data to AWS S3. + +== Configuration Options + +The following table summarizes the configuration options available for the `aws-s3-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| | +| *bucketNameOrArn {empty}* *| Bucket Name| The S3 Bucket name or ARN.| string| | +| *filename {empty}* *| Filename (S3 Key)| The target filename created on S3.| 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| | +| autoCreateBucket| Autocreate bucket| Setting the autocreation of the S3 bucket bucketName.| boolean| `false`| +| overrideEndpoint| Override Endpoint| Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride.| boolean| `false`| +| uriEndpointOverride| Override Endpoint URI| Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option.| string| | `"http://another-s3-endpoint:9000"` +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `aws-s3-sink` can be used in various contexts. + +=== Knative Sink + +The `aws-s3-sink` Kamelet can be used as Knative sink by binding it to a Knative object. + +.aws-s3-sink-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: aws-s3-sink-binding +spec: + source: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + sink: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: aws-s3-sink + properties: + accessKey: "The Access Key" + bucketNameOrArn: "The Bucket Name" + filename: "The Filename (S3 Key)" + region: "eu-west-1" + secretKey: "The Secret Key" + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `aws-s3-sink-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the sink using the following command: + +[source,shell] +---- +kubectl apply -f aws-s3-sink-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT