-
Notifications
You must be signed in to change notification settings - Fork 26
/
aws-cloudwatch-sink.kamelet.yaml
185 lines (180 loc) · 9.13 KB
/
aws-cloudwatch-sink.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# ---------------------------------------------------------------------------
# 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-cloudwatch-sink
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIwNyIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI5MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzc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wyNy40MiA4LjIyNi43ODktLjg0OS0uMDIzLTYxLjg0OS0uNzg5LS43NTgtMjcuMzk3LTIuOTU4djU4LjE4OCIgZmlsbD0iIzRCNjEyQyIvPjxwYXRoIGQ9Ik0yMjAuMDM5IDE1NS42OTJsLTkyLjA3NCA4Ljk4LjAyMyA2My40NiA5Mi4wNTEtMjcuNzExdi00NC43MjkiIGZpbGw9IiM3NTlDM0UiLz48L3N2Zz4K"
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "AWS Cloudwatch"
camel.apache.org/kamelet.namespace: "AWS"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "AWS CloudWatch Metrics Sink"
description: |-
Send data to Amazon CloudWatch metrics.
The basic authentication method for the AWS CloudWatch metrics service is to specify an access key and a secret key. These parameters are optional because the Kamelet provides a default credentials provider.
If you use the default credentials provider, the CloudWatch client loads the credentials through this provider and doesn't use the basic authentication method.
You can set the following properties in the header:
`metric-name` / `ce-metricname` for the metric name.
`metric-value` / `ce-metricvalue` for the metric value.
`metric-unit` / `ce-metricunit` for the metric unit.
`metric-timestamp` / `ce-metrictimestamp` for the metric timestamp.
`metric-dimension-name` / `ce-metricdimensionname` for the dimension name.
`metric-dimension-value` / `ce-metricdimensionvalue` for the dimension value.
required:
- cwNamespace
- region
type: object
properties:
cwNamespace:
title: Cloud Watch Namespace
description: The CloudWatch metric namespace.
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 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: If true, the CloudWatch client loads credentials through a default credentials provider. If false, it uses the basic authentication method (access key and secret key).
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
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
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
dependencies:
- "camel:core"
- "camel:aws2-cw"
- "camel:kamelet"
template:
from:
uri: kamelet:source
steps:
- choice:
when:
- simple: "${header[metric-name]}"
steps:
- set-header:
name: CamelAwsCwMetricName
simple: "${header[metric-name]}"
- simple: "${header[ce-metricname]}"
steps:
- set-header:
name: CamelAwsCwMetricName
simple: "${header[ce-metricname]}"
- choice:
when:
- simple: "${header[metric-value]}"
steps:
- set-header:
name: CamelAwsCwMetricValue
simple: "${header[metric-value]}"
- simple: "${header[ce-metricvalue]}"
steps:
- set-header:
name: CamelAwsCwMetricValue
simple: "${header[ce-metricvalue]}"
- choice:
when:
- simple: "${header[metric-unit]}"
steps:
- set-header:
name: CamelAwsCwMetricUnit
simple: "${header[metric-unit]}"
- simple: "${header[ce-metricunit]}"
steps:
- set-header:
name: CamelAwsCwMetricUnit
simple: "${header[ce-metricunit]}"
- choice:
when:
- simple: "${header[metric-timestamp]}"
steps:
- set-header:
name: CamelAwsCwMetricTimestamp
simple: "${header[metric-timestamp]}"
- simple: "${header[ce-metrictimestamp]}"
steps:
- set-header:
name: CamelAwsCwMetricTimestamp
simple: "${header[ce-metrictimestamp]}"
- choice:
when:
- simple: "${header[metric-dimension-name]}"
steps:
- set-header:
name: CamelAwsCwMetricDimensionName
simple: "${header[metric-dimension-name]}"
- simple: "${header[ce-metricdimensionname]}"
steps:
- set-header:
name: CamelAwsCwMetricDimensionName
simple: "${header[ce-metricdimensionname]}"
- choice:
when:
- simple: "${header[metric-dimension-value]}"
steps:
- set-header:
name: CamelAwsCwMetricDimensionValue
simple: "${header[metric-dimension-value]}"
- simple: "${header[ce-metricdimensionvalue]}"
steps:
- set-header:
name: CamelAwsCwMetricDimensionValue
simple: "${header[ce-metricdimensionvalue]}"
- to:
uri: "aws2-cw:{{cwNamespace}}"
parameters:
secretKey: "{{?secretKey}}"
accessKey: "{{?accessKey}}"
region: "{{region}}"
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
uriEndpointOverride: "{{?uriEndpointOverride}}"
overrideEndpoint: "{{overrideEndpoint}}"