shinesolutions / aem-stack-manager-cloud

AEM Stack Manager Lambda functions
Apache License 2.0
2 stars 7 forks source link

When error put failed state to dynamodb #14

Open mbloch1986 opened 6 years ago

mbloch1986 commented 6 years ago

When the Lambda function offline_sapshot or stack_manager raise an error it doesn't update or put a state to the DynamoDB. It only send a message to syslog e.g.

aem_offline_snapshot.py Line 650:

Unhealthy Stack: RuntimeError
Traceback (most recent call last):
File "/var/task/aem_offline_snapshot.py", line 658, in sns_message_processor
raise RuntimeError('Unhealthy Stack')
RuntimeError: Unhealthy Stack

If we call the lambda function via stack-manager-messenger and it raise an error, we don't get informed nor can't we query for the state of the call we made. The messenger returns an error only after the timeout of 1h.

Instead of raising an error the lambda function should update the dynamodb item to the call we made. It might be a good idea to use the message_id as an unique identifier, since we are using it to query for the state of command.

aem_stack_manager.py line 475 aem_offline_snapshot.py leine ~633