-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support AWS EventBridge (#4188)
## Description This PR introduces the AWS EventBridge. The EventBridge can be enabled with the options `webhook_mode`, which can be set to either `direct` or `eventbridge`. In the direct mode the olds way of handling is still applied. When setting the mode to `eventbridge` events will publshed on the AWS EventBridge, which is not limited only to the event `workflow_job` with statues `queued` via a target rule events relevant for scaling a snet to the dispatcher lambda to distrute to a SQS queue for sacling. ## Todo - [x] Refactor lambda and add EventBridge - [x] Refactor webhook module (TF) to support EventBridge - [x] Test example default - [x] Test example multi runner - [x] Adjust docs - [x] Reduce permissions on webhook and dispatcher lambda for eventbridge mode - [x] Add configuration for allowed events on the EventBridge - [ ] Add support for CMK (encruption) to EventBridge #4192 ## MIgration directions The change is backwards compatible but will recreate resources managed by the internal module webhook. The only resource contianing data is the CloudWatch LogGroup. To retain the log geroup you can run a terraform state move. Or add a `moved` block to your deployemnt. ### Migrating to this version With module defaults or eventbridge is not eanavbled ```hcl # log group moved { from = module.<runner-module-name>.module.webhook.aws_cloudwatch_log_group.webhook to = module.<runner-module-name>.module.webhook.module.direct[0].aws_cloudwatch_log_group.webhook } # lambda moved { from = module.<runner-module-name>.module.webhook.aws_lambda_function.webhook to = module.<runner-module-name>.module.webhook.module.direct[0].aws_lambda_function.webhook } ``` Or with `webhook_mode = eventbridge` ```hcl # log group moved { from = module.<runner-module-name>.module.webhook.aws_cloudwatch_log_group.webhook to = module.<runner-module-name>.module.webhook.module.direct[0].aws_cloudwatch_log_group.webhook } # lambda moved { from = module.<runner-module-name>.module.webhook.aws_lambda_function.webhook to = module.<runner-module-name>.module.webhook.module.direct[0].aws_lambda_function.webhook } ``` ### When switching between direct and eventbridge When enable mode `eventbridge` ```hcl # log group moved { from = module.runners.module.webhook.module.direct[0].aws_cloudwatch_log_group.webhook to = module.runners.module.webhook.module.eventbridge[0].aws_cloudwatch_log_group.webhook } # lambda moved { from = module.runners.module.webhook.module.direct[0].aws_lambda_function.webhook to = module.runners.module.webhook.module.eventbridge[0].aws_lambda_function.webhook } ``` Or vice versa for moving from `eventbride` to `webhook` --------- Co-authored-by: philips-labs-pr|bot <philips-labs-pr[bot]@users.noreply.github.com> Co-authored-by: Marco Pas <marco.pasopas@gmail.com> Co-authored-by: Stuart Pearson <1926002+stuartp44@users.noreply.github.com>
- Loading branch information
1 parent
556f00b
commit 9607ca6
Showing
60 changed files
with
2,540 additions
and
482 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.