# ---------------------------------------------------------------------------
# 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-kinesis-firehose-sink
  annotations:
    camel.apache.org/kamelet.support.level: "Stable"
    camel.apache.org/catalog.version: "4.10.2"
    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgODUgODUiIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjx1c2UgeGxpbms6aHJlZj0iI0EiIHg9IjIuNSIgeT0iMi41Ii8+PHN5bWJvbCBpZD0iQSIgb3ZlcmZsb3c9InZpc2libGUiPjxnIHN0cm9rZT0ibm9uZSI+PHBhdGggZD0iTTEzLjc2NiAzLjEyaDUyLjQ2OGMzLjY1MSAwIDcuMTUyIDEuMzYzIDkuNzM0IDMuNzg4UzgwIDEyLjYyNCA4MCAxNi4wNTR2MjEuNjk4Yy0yLjcxNy0xLjMxOS04LjY2NC0yLjcyMy0xNy40NjQtMi43MjMtMy4zNy0uMDEzLTYuNzM3LjIyNC0xMC4wNjguNzA5LTUuOTMyLjkyMi05LjA1NyA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OC44MjN2Mi4xODRsNC4yNTYtLjQ0TDY5LjcyIDIwLjQyMnptLTU3LjU2OS0uMDAxdjE0LjE4MmgyMC44M1YxMC40NTJINy42MDh2NS43MTV6bTUuODExIDMzLjUxMnYxNC4xODJoMjAuODNWNDMuOTY0aC0yMC44M3Y1LjcxNXoiLz48L2c+PC9zeW1ib2w+PC9zdmc+"
    camel.apache.org/provider: "Apache Software Foundation"
    camel.apache.org/kamelet.group: "AWS Kinesis Firehose"
    camel.apache.org/kamelet.namespace: "AWS"
  labels:
    camel.apache.org/kamelet.type: sink
spec:
  definition:
    title: AWS Kinesis Firehose Sink
    description: Send message to an AWS Kinesis Firehose Stream.
    required:
      - streamName
      - region
    type: object
    properties:
      streamName:
        title: Stream Name
        description: The name of the stream we want to send to data to
        type: string
      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: ["ap-south-1", "eu-south-1", "us-gov-east-1", "me-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-northeast-2", "ap-northeast-1", "me-south-1", "sa-east-1", "ap-east-1", "cn-north-1", "us-gov-west-1", "ap-southeast-1", "ap-southeast-2", "us-iso-east-1", "ap-southeast-3", "us-east-1", "us-east-2", "cn-northwest-1", "us-isob-east-1", "aws-global", "aws-cn-global", "aws-us-gov-global", "aws-iso-global", "aws-iso-b-global"]
      useDefaultCredentialsProvider:
        title: Default Credentials Provider
        description: Set whether the Kinesis Firehose client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.
        type: boolean
        default: false
      useProfileCredentialsProvider:
        title: Profile Credentials Provider
        description: Set whether the Kinesis Firehose client should expect to load credentials through a profile credentials provider.
        type: boolean
        default: false
      useSessionCredentials:
        title: Session Credentials
        description: Set whether the Kinesis Firehose client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Kinesis Firehose.
        type: boolean
        default: false
      profileCredentialsName:
        title: Profile Credentials Name
        description: If using a profile credentials provider this parameter will set the profile name.
        type: string
      sessionToken:
        title: Session Token
        description: Amazon AWS Session Token used when the user needs to assume a IAM role.
        type: string
        format: password
        x-descriptors:
        - urn:camel:group:credentials
      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:aws2-kinesis"
    - "camel:kamelet"
  template:
    from:
      uri: kamelet:source
      steps:
      - to:
          uri: "aws2-kinesis-firehose:{{streamName}}"
          parameters:
            accessKey: "{{?accessKey}}"
            secretKey: "{{?secretKey}}"
            region: "{{region}}"
            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
            useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}"
            useSessionCredentials: "{{useSessionCredentials}}"
            uriEndpointOverride: "{{?uriEndpointOverride}}"
            profileCredentialsName: "{{?profileCredentialsName}}"
            sessionToken: "{{?sessionToken}}"
            overrideEndpoint: "{{overrideEndpoint}}"