Skip to content
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

chore: terraform code refactoring #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kurianoff
Copy link

What does this PR do?

Refactors terraform code making it easier to add more CIS Alerts as json files in AWS EventBridge format.

What image or gif best represents this PR?

https://tenor.com/view/1u-industrial-industrial-workers-of-the-world-injury-iww-gif-17596638

Why is this needed?

Less code is always good.

How does it work?

  • You keep all Eventbridge events in the templates directory prefixed with event-, with a name of the event in the center (for example: console-login-without-mfa), and suffixed with .tmpl.json. Example file name: event-console-login-without-mfa.tmpl.json
  • During infrastructure rollout, terraform picks up all the files prefixed with event-, and creates corresponding EventBridge Rules and Targets for them

This way you can add/remove events dynamically to catch up with CIS requirements changes over time.

Please explain how this was tested

  • If applicable, have you wrote unit tests?

No unit tests were implemented, but I enjoy this solution on my client's environment, and want to say thank you very much for putting this together in the first place! This is amazing!!!

Screenshots (optional)

Documentation

  • Have you updated the appropriate documentation?

Anything Else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants