Skip to content

Add functionality to pass reference of AmazonManagedKafka (MSK) in EventSourceMapping resource #94

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

Merged
merged 1 commit into from
Jun 28, 2023
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
10 changes: 5 additions & 5 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ack_generate_info:
build_date: "2023-06-07T18:16:37Z"
build_hash: dcb9fd6c564ce817a48abd6f7b9ee4308aa1d13f
build_date: "2023-06-27T22:12:27Z"
build_hash: e9b68590da73ce9143ba1e4361cebdc1d876c81e
go_version: go1.19
version: v0.26.1-4-gdcb9fd6
api_directory_checksum: ca34c731b281f29e80984c872002e220ddee5133
version: v0.26.1-7-ge9b6859
api_directory_checksum: 5326aa7650a3899230ee809563bea350169fdca4
api_version: v1alpha1
aws_sdk_go_version: v1.44.181
generator_config_info:
file_checksum: d53a6ae44af0a12af854385908c6e09355b3a126
file_checksum: a9fdc0888330c561da4bf5f21d0f5afe48217935
original_file_name: generator.yaml
last_modification:
reason: API generation
3 changes: 2 additions & 1 deletion apis/v1alpha1/event_source_mapping.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ resources:
resource: Broker
path: Status.BrokerID
service_name: mq
EventSourceARN:
references:
resource: Cluster
path: Status.ACKResourceMetadata.ARN
service_name: kafka
UUID:
is_primary_key: true
FunctionName:
Expand Down
5 changes: 5 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/controller/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions config/crd/bases/lambda.services.k8s.aws_eventsourcemappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ spec:
Streaming for Apache Kafka – The ARN of the cluster. \n * Amazon
MQ – The ARN of the broker."
type: string
eventSourceRef:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name: my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
filterCriteria:
description: An object that defines the filter criteria that determine
whether Lambda should process an event. For more information, see
Expand Down
14 changes: 14 additions & 0 deletions config/rbac/cluster-role-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ rules:
verbs:
- get
- list
- apiGroups:
- kafka.services.k8s.aws
resources:
- clusters
verbs:
- get
- list
- apiGroups:
- kafka.services.k8s.aws
resources:
- clusters/status
verbs:
- get
- list
- apiGroups:
- kms.services.k8s.aws
resources:
Expand Down
5 changes: 5 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ resources:
resource: Broker
path: Status.BrokerID
service_name: mq
EventSourceARN:
references:
resource: Cluster
path: Status.ACKResourceMetadata.ARN
service_name: kafka
UUID:
is_primary_key: true
FunctionName:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.19

require (
github.com/aws-controllers-k8s/ec2-controller v0.0.21
github.com/aws-controllers-k8s/kafka-controller v0.0.0-20230615185632-102279061de1
github.com/aws-controllers-k8s/kms-controller v0.1.2
github.com/aws-controllers-k8s/mq-controller v0.0.22
github.com/aws-controllers-k8s/runtime v0.26.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aws-controllers-k8s/ec2-controller v0.0.21 h1:5O7/9aED2Tl9OT0TL2rWrc1Ix5V1UxYEgDKAhvFhPJQ=
github.com/aws-controllers-k8s/ec2-controller v0.0.21/go.mod h1:OMsmJeJ3iQZ1sJgs3hqnjBRnJ3hmTzJUO38W5rxnB5M=
github.com/aws-controllers-k8s/kafka-controller v0.0.0-20230615185632-102279061de1 h1:NvmtIsm6fVoGUOvMfevONJETf+PtRWAiD3XzZBtQ2WA=
github.com/aws-controllers-k8s/kafka-controller v0.0.0-20230615185632-102279061de1/go.mod h1:BHW00DFtXtugpsyn0nN0YdP32xmCN5p3lIJYP+Y0iVY=
github.com/aws-controllers-k8s/kms-controller v0.1.2 h1:9lb98jspqOpFpmIFHOJ6pRnOkC8kDEPIgTAb5QnVGZo=
github.com/aws-controllers-k8s/kms-controller v0.1.2/go.mod h1:6CoV0UMFd03EUF9dXgOTTScGdBhJzsWn9W0dw2n0kA4=
github.com/aws-controllers-k8s/mq-controller v0.0.22 h1:XxFSQL9yaaiiuZ6E/fh/+Y9C+3DG2c5oXWG/4ZNwd1w=
Expand Down
13 changes: 13 additions & 0 deletions helm/crds/lambda.services.k8s.aws_eventsourcemappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ spec:
Streaming for Apache Kafka – The ARN of the cluster. \n - Amazon
MQ – The ARN of the broker."
type: string
eventSourceRef:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference type to provide more user friendly syntax
for references using 'from' field Ex: APIIDRef: \n from: name: my-api"
properties:
from:
description: AWSResourceReference provides all the values necessary
to reference another k8s resource for finding the identifier(Id/ARN/Name)
properties:
name:
type: string
type: object
type: object
filterCriteria:
description: An object that defines the filter criteria that determine
whether Lambda should process an event. For more information, see
Expand Down
14 changes: 14 additions & 0 deletions helm/templates/cluster-role-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ rules:
verbs:
- get
- list
- apiGroups:
- kafka.services.k8s.aws
resources:
- clusters
verbs:
- get
- list
- apiGroups:
- kafka.services.k8s.aws
resources:
- clusters/status
verbs:
- get
- list
- apiGroups:
- kms.services.k8s.aws
resources:
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ deletionPolicy: delete
# controller reconciliation configurations
reconcile:
# The default duration, in seconds, to wait before resyncing desired state of custom resources.
defaultResyncPeriod: 0
defaultResyncPeriod: 36000 # 10 Hours
# An object representing the reconcile resync configuration for each specific resource.
resourceResyncPeriods: {}

Expand Down
3 changes: 3 additions & 0 deletions pkg/resource/event_source_mapping/delta.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions pkg/resource/event_source_mapping/references.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.