Skip to content

Adding EventInvokeConfig support for Function #92

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 7, 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-05-15T23:18:19Z"
build_hash: 8f3ba427974fd6e769926778d54834eaee3b81a3
build_date: "2023-06-07T18:16:37Z"
build_hash: dcb9fd6c564ce817a48abd6f7b9ee4308aa1d13f
go_version: go1.19
version: v0.26.1
api_directory_checksum: a9fcef68210dd72b4b2e37052f2c1a9e971326c6
version: v0.26.1-4-gdcb9fd6
api_directory_checksum: ca34c731b281f29e80984c872002e220ddee5133
api_version: v1alpha1
aws_sdk_go_version: v1.44.181
generator_config_info:
file_checksum: 095af1082df5c34cdc12296dc085bc6b2b7eadb9
file_checksum: d53a6ae44af0a12af854385908c6e09355b3a126
original_file_name: generator.yaml
last_modification:
reason: API generation
3 changes: 2 additions & 1 deletion apis/v1alpha1/function.go

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

4 changes: 4 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ resources:
from:
operation: GetFunction
path: Configuration.Layers
FunctionEventInvokeConfig:
from:
operation: PutFunctionEventInvokeConfig
path: .
renames:
operations:
CreateFunction:
Expand Down
18 changes: 15 additions & 3 deletions apis/v1alpha1/types.go

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

55 changes: 55 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.

31 changes: 31 additions & 0 deletions config/crd/bases/lambda.services.k8s.aws_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,37 @@ spec:
type: string
type: object
type: array
functionEventInvokeConfig:
properties:
destinationConfig:
description: A configuration object that specifies the destination
of an event after Lambda processes it.
properties:
onFailure:
description: A destination for events that failed processing.
properties:
destination:
type: string
type: object
onSuccess:
description: A destination for events that were processed
successfully.
properties:
destination:
type: string
type: object
type: object
functionName:
type: string
maximumEventAgeInSeconds:
format: int64
type: integer
maximumRetryAttempts:
format: int64
type: integer
qualifier:
type: string
type: object
handler:
description: The name of the method within your code that Lambda calls
to run your function. Handler is required if the deployment package
Expand Down
4 changes: 4 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ resources:
from:
operation: GetFunction
path: Configuration.Layers
FunctionEventInvokeConfig:
from:
operation: PutFunctionEventInvokeConfig
path: .
renames:
operations:
CreateFunction:
Expand Down
31 changes: 31 additions & 0 deletions helm/crds/lambda.services.k8s.aws_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,37 @@ spec:
type: string
type: object
type: array
functionEventInvokeConfig:
properties:
destinationConfig:
description: A configuration object that specifies the destination
of an event after Lambda processes it.
properties:
onFailure:
description: A destination for events that failed processing.
properties:
destination:
type: string
type: object
onSuccess:
description: A destination for events that were processed
successfully.
properties:
destination:
type: string
type: object
type: object
functionName:
type: string
maximumEventAgeInSeconds:
format: int64
type: integer
maximumRetryAttempts:
format: int64
type: integer
qualifier:
type: string
type: object
handler:
description: The name of the method within your code that Lambda calls
to run your function. Handler is required if the deployment package
Expand Down
15 changes: 14 additions & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- if .Values.deployment.annotations }}
annotations:
{{- range $key, $value := .Values.deployment.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down Expand Up @@ -104,11 +106,19 @@ spec:
value: {{ include "aws.credentials.path" . }}
- name: AWS_PROFILE
value: {{ .Values.aws.credentials.profile }}
{{- end }}
{{- if .Values.deployment.extraEnvVars -}}
{{ toYaml .Values.deployment.extraEnvVars | nindent 8 }}
{{- end }}
volumeMounts:
{{- if .Values.aws.credentials.secretName }}
- name: {{ .Values.aws.credentials.secretName }}
mountPath: {{ include "aws.credentials.secret_mount_path" . }}
readOnly: true
{{- end }}
{{- if .Values.deployment.extraVolumeMounts -}}
{{ toYaml .Values.deployment.extraVolumeMounts | nindent 12 }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
privileged: false
Expand All @@ -133,9 +143,12 @@ spec:
hostIPC: false
hostNetwork: false
hostPID: false
{{ if .Values.aws.credentials.secretName -}}
volumes:
{{- if .Values.aws.credentials.secretName -}}
- name: {{ .Values.aws.credentials.secretName }}
secret:
secretName: {{ .Values.aws.credentials.secretName }}
{{ end -}}
{{- if .Values.deployment.extraVolumes }}
{{ toYaml .Values.deployment.extraVolumes | indent 8}}
{{- end }}
9 changes: 9 additions & 0 deletions helm/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
},
"priorityClassName": {
"type": "string"
},
"extraVolumeMounts": {
"type": "array"
},
"extraVolumes": {
"type": "array"
},
"extraEnvVars": {
"type": "array"
}
},
"required": [
Expand Down
20 changes: 20 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ deployment:
# Which priorityClassName to set?
# See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority
priorityClassName: ""
extraVolumes: []
extraVolumeMounts: []

# Additional server container environment variables
#
# You specify this manually like you would a raw deployment manifest.
# This means you can bind in environment variables from secrets.
#
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
#
# e.g. secret environment variable:
# - name: USERNAME
# valueFrom:
# secretKeyRef:
# name: mysecret
# key: username
extraEnvVars: []


# If "installScope: cluster" then these labels will be applied to ClusterRole
role:
Expand Down
58 changes: 58 additions & 0 deletions pkg/resource/function/delta.go

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

Loading