-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathevent_source_mapping.go
213 lines (204 loc) · 10.6 KB
/
event_source_mapping.go
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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.
// Code generated by ack-generate. DO NOT EDIT.
package v1alpha1
import (
ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EventSourceMappingSpec defines the desired state of EventSourceMapping.
type EventSourceMappingSpec struct {
// Specific configuration settings for an Amazon Managed Streaming for Apache
// Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig *AmazonManagedKafkaEventSourceConfig `json:"amazonManagedKafkaEventSourceConfig,omitempty"`
// The maximum number of records in each batch that Lambda pulls from your stream
// or queue and sends to your function. Lambda passes all of the records in
// the batch to the function in a single call, up to the payload limit for synchronous
// invocation (6 MB).
//
// - Amazon Kinesis – Default 100. Max 10,000.
//
// - Amazon DynamoDB Streams – Default 100. Max 10,000.
//
// - Amazon Simple Queue Service – Default 10. For standard queues the
// max is 10,000. For FIFO queues the max is 10.
//
// - Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
//
// - Self-managed Apache Kafka – Default 100. Max 10,000.
//
// - Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
//
// - DocumentDB – Default 100. Max 10,000.
BatchSize *int64 `json:"batchSize,omitempty"`
// (Kinesis and DynamoDB Streams only) If the function returns an error, split
// the batch in two and retry.
BisectBatchOnFunctionError *bool `json:"bisectBatchOnFunctionError,omitempty"`
// (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration
// object that specifies the destination of an event after Lambda processes
// it.
DestinationConfig *DestinationConfig `json:"destinationConfig,omitempty"`
// When true, the event source mapping is active. When false, Lambda pauses
// polling and invocation.
//
// Default: True
Enabled *bool `json:"enabled,omitempty"`
// The Amazon Resource Name (ARN) of the event source.
//
// - Amazon Kinesis – The ARN of the data stream or a stream consumer.
//
// - Amazon DynamoDB Streams – The ARN of the stream.
//
// - Amazon Simple Queue Service – The ARN of the queue.
//
// - Amazon Managed Streaming for Apache Kafka – The ARN of the cluster
// or the ARN of the VPC connection (for cross-account event source mappings
// (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
//
// - Amazon MQ – The ARN of the broker.
//
// - Amazon DocumentDB – The ARN of the DocumentDB change stream.
EventSourceARN *string `json:"eventSourceARN,omitempty"`
EventSourceRef *ackv1alpha1.AWSResourceReferenceWrapper `json:"eventSourceRef,omitempty"`
// An object that defines the filter criteria that determine whether Lambda
// should process an event. For more information, see Lambda event filtering
// (https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
FilterCriteria *FilterCriteria `json:"filterCriteria,omitempty"`
// The name or ARN of the Lambda function.
//
// Name formats
//
// - Function name – MyFunction.
//
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
//
// - Version or Alias ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.
//
// - Partial ARN – 123456789012:function:MyFunction.
//
// The length constraint applies only to the full ARN. If you specify only the
// function name, it's limited to 64 characters in length.
FunctionName *string `json:"functionName,omitempty"`
FunctionRef *ackv1alpha1.AWSResourceReferenceWrapper `json:"functionRef,omitempty"`
// (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type
// enums applied to the event source mapping.
FunctionResponseTypes []*string `json:"functionResponseTypes,omitempty"`
// The maximum amount of time, in seconds, that Lambda spends gathering records
// before invoking the function. You can configure MaximumBatchingWindowInSeconds
// to any value from 0 seconds to 300 seconds in increments of seconds.
//
// For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching
// window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ,
// and DocumentDB event sources, the default batching window is 500 ms. Note
// that because you can only change MaximumBatchingWindowInSeconds in increments
// of seconds, you cannot revert back to the 500 ms default batching window
// after you have changed it. To restore the default batching window, you must
// create a new event source mapping.
//
// Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when
// you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds
// to at least 1.
MaximumBatchingWindowInSeconds *int64 `json:"maximumBatchingWindowInSeconds,omitempty"`
// (Kinesis and DynamoDB Streams only) Discard records older than the specified
// age. The default value is infinite (-1).
MaximumRecordAgeInSeconds *int64 `json:"maximumRecordAgeInSeconds,omitempty"`
// (Kinesis and DynamoDB Streams only) Discard records after the specified number
// of retries. The default value is infinite (-1). When set to infinite (-1),
// failed records are retried until the record expires.
MaximumRetryAttempts *int64 `json:"maximumRetryAttempts,omitempty"`
// (Kinesis and DynamoDB Streams only) The number of batches to process from
// each shard concurrently.
ParallelizationFactor *int64 `json:"parallelizationFactor,omitempty"`
QueueRefs []*ackv1alpha1.AWSResourceReferenceWrapper `json:"queueRefs,omitempty"`
// (MQ) The name of the Amazon MQ broker destination queue to consume.
Queues []*string `json:"queues,omitempty"`
// (Amazon SQS only) The scaling configuration for the event source. For more
// information, see Configuring maximum concurrency for Amazon SQS event sources
// (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
ScalingConfig *ScalingConfig `json:"scalingConfig,omitempty"`
// The self-managed Apache Kafka cluster to receive records from.
SelfManagedEventSource *SelfManagedEventSource `json:"selfManagedEventSource,omitempty"`
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig *SelfManagedKafkaEventSourceConfig `json:"selfManagedKafkaEventSourceConfig,omitempty"`
// An array of authentication protocols or VPC components required to secure
// your event source.
SourceAccessConfigurations []*SourceAccessConfiguration `json:"sourceAccessConfigurations,omitempty"`
// The position in a stream from which to start reading. Required for Amazon
// Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported
// only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed
// Apache Kafka.
StartingPosition *string `json:"startingPosition,omitempty"`
// With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
// StartingPositionTimestamp cannot be in the future.
StartingPositionTimestamp *metav1.Time `json:"startingPositionTimestamp,omitempty"`
// The name of the Kafka topic.
Topics []*string `json:"topics,omitempty"`
// (Kinesis and DynamoDB Streams only) The duration in seconds of a processing
// window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds
// indicates no tumbling window.
TumblingWindowInSeconds *int64 `json:"tumblingWindowInSeconds,omitempty"`
}
// EventSourceMappingStatus defines the observed state of EventSourceMapping
type EventSourceMappingStatus struct {
// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
// that is used to contain resource sync state, account ownership,
// constructed ARN for the resource
// +kubebuilder:validation:Optional
ACKResourceMetadata *ackv1alpha1.ResourceMetadata `json:"ackResourceMetadata"`
// All CRs managed by ACK have a common `Status.Conditions` member that
// contains a collection of `ackv1alpha1.Condition` objects that describe
// the various terminal states of the CR and its backend AWS service API
// resource
// +kubebuilder:validation:Optional
Conditions []*ackv1alpha1.Condition `json:"conditions"`
// The ARN of the Lambda function.
// +kubebuilder:validation:Optional
FunctionARN *string `json:"functionARN,omitempty"`
// The date that the event source mapping was last updated or that its state
// changed.
// +kubebuilder:validation:Optional
LastModified *metav1.Time `json:"lastModified,omitempty"`
// The result of the last Lambda invocation of your function.
// +kubebuilder:validation:Optional
LastProcessingResult *string `json:"lastProcessingResult,omitempty"`
// The state of the event source mapping. It can be one of the following: Creating,
// Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
// +kubebuilder:validation:Optional
State *string `json:"state,omitempty"`
// Indicates whether a user or Lambda made the last change to the event source
// mapping.
// +kubebuilder:validation:Optional
StateTransitionReason *string `json:"stateTransitionReason,omitempty"`
// The identifier of the event source mapping.
// +kubebuilder:validation:Optional
UUID *string `json:"uuid,omitempty"`
}
// EventSourceMapping is the Schema for the EventSourceMappings API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
type EventSourceMapping struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec EventSourceMappingSpec `json:"spec,omitempty"`
Status EventSourceMappingStatus `json:"status,omitempty"`
}
// EventSourceMappingList contains a list of EventSourceMapping
// +kubebuilder:object:root=true
type EventSourceMappingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EventSourceMapping `json:"items"`
}
func init() {
SchemeBuilder.Register(&EventSourceMapping{}, &EventSourceMappingList{})
}