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
""" | |
Suspend an auto scaling group's scaling processes that can interfere with CodeDeploy deploys. | |
It assumes a single ASG per deployment group. | |
To use this: | |
* create a lambda function with this code, then hook up it up to an SNS topic that receives all deployment events (but not host events). | |
* attach that topic as a trigger in your deployment groups. | |
Unlike AWS's in-appspec approach, this supports arbitrary deploy concurrency. |
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
from contextlib import contextmanager | |
import logging | |
@contextmanager | |
def all_logging_disabled(highest_level=logging.CRITICAL): | |
""" | |
A context manager that will prevent any logging messages | |
triggered during the body from being processed. | |
:param highest_level: the maximum logging level in use. |
OlderNewer