INNER CODE UNIT · Python
resource
aws-samples/aws-health-aware · handler.py:45
def resource(self, resource_name):
logger.debug(f"Returning new boto3 resource for: {resource_name}")
return boto3.resource(resource_name)
def cache_clear(self):
self.client.cache_clear()
self.resource.cache_clear()
@lru_cache
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")