Conversation
…oudWatch Event format Both okta_sync and security_alerts EventBridge targets were sending a raw JSON payload via `input` that the Lambda UniversalHandler did not recognize, causing all scheduled invocations to fail with "unknown lambda event type". Replace `input` with `input_transformer` to preserve the native EventBridge envelope (source, detail-type, time, region) while injecting the correct action in the detail field, matching the CloudWatchEvent structure that the Lambda handler expects. Closes #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inputwithinput_transformeron bothokta_syncandsecurity_alertsEventBridge targets so the Lambda receives a properCloudWatchEventenvelope instead of a raw JSON payload it cannot routeinput_transformerpreserves native EventBridge fields (source,detail-type,time,region) and injects{"action": "<name>"}indetail, matching theapp.ScheduledEventstruct theEventBridgeHandlerexpectsProblem
Both
aws_cloudwatch_event_targetresources usedinputwith a custom JSON shape:{"path": "/scheduled/okta-sync", "httpMethod": "POST", "headers": {}, "body": ""}The Lambda entrypoint (
cmd/lambda/main.go) routes events by deserializing into:APIGatewayV2HTTPRequest— matches whenRequestContext.HTTP.Method != ""CloudWatchEvent— matches whenDetailType != ""The raw JSON matched neither, so every scheduled invocation failed with
"unknown lambda event type".Affected Resources
aws_cloudwatch_event_target.okta_syncaws_cloudwatch_event_target.security_alertsCloses #5