-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: lambda update idp status #605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Giuseppe Gangemi <[email protected]>
logger.error("Invalid alarm type: %s", alarm_type) | ||
return {"statusCode": 400, "body": json.dumps("Invalid alarm type")} | ||
|
||
# Update the S3 asset file with latest IDP status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: this comment could be moved to line 201, over update_s3_asset_file
function invocation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR adds code for
oneid-lambda-update-idp-status
and the related Github Action to deploy it.This lambda is needed to keep track of IDP status according to the CloudWatch Alarms on the IDP errors.
In particular, it is triggered when the alarm
IDPErrorAlarm-{IDP}
related to a specific IDP passes to the stateIN_ALARM
. This action will update the state to "KO" for the specified IDP.To keep track of the come-back of the IDP, after this operation, the lambda enables actions (default disabled) for the
IDPSuccessAlarm-{IDP}
which is a trigger for the lambda when its status passes toIN_ALARM
(meaning that we have had some successful logins in the last datapoint), in this case the lambda will be triggered and will update the status to "OK" and at the end will disable theIDPSuccessAlarm-{IDP}
actions (meaning that the lambda will not be executed anymore for the IDPSuccessAlarm until it will be reactivated by a trigger of IDPErrorAlarm type).The IDP Status informations are stored inside a DynamoDB table and the "latest" status of each idp is also saved inside a .json file of the
assets
bucket to enable a quick retrieval from the frontend.