INNER CODE UNIT · Python
secretsmanager
aws-samples/aws-health-aware · handler.py:54
def secretsmanager(self, **kwargs):
client = boto3.client("secretsmanager", **kwargs)
return CachedSecrets(client)
print("boto3 version: ", boto3.__version__)
# query active health API endpoint
health_dns = socket.gethostbyname_ex("global.health.amazonaws.com")
(current_endpoint, global_endpoint, ip_endpoint) = health_dns
health_active_list = current_endpoint.split(".")
health_active_region = health_active_list[1]
print("current health region: ", health_active_region)
# create a boto3 health client w/ backoff/retry
config = Config(
region_name=health_active_region,
retries=dict(