INNER CODE UNIT · Python

get_secret

aws-samples/aws-health-aware · handler.py:737

def get_secret(secret_name, client):
    try:
        get_secret_value_response = client.get_secret_value(SecretId=secret_name)
    except ClientError as e:
        print(f"There was an error with the {secret_name} secret: ", e.response)
        return "None"
    finally:
        if "SecretString" not in get_secret_value_response:
            return "None"

        return get_secret_value_response["SecretString"]


def describe_events(health_client):
    str_ddb_format_sec = "%s"
    # set hours to search back in time for events
    delta_hours = os.environ["EVENT_SEARCH_BACK"]
    health_event_type = os.environ["HEALTH_EVENT_TYPE"]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…