flip_api.utils.get_secrets ========================== .. py:module:: flip_api.utils.get_secrets Functions --------- .. autoapisummary:: flip_api.utils.get_secrets.get_secrets flip_api.utils.get_secrets.get_secret Module Contents --------------- .. py:function:: get_secrets(secret_name: str = '', region_name: str = '') -> dict Retrieve secrets from AWS Secrets Manager. :param secret_name: The name of the secret to retrieve. :type secret_name: str :param region_name: The AWS region where the secret is stored. :type region_name: str :returns: The retrieved secret as a dictionary. :rtype: dict :raises ClientError: If the AWS Secrets Manager API call fails. :raises ValueError: If the secret does not contain a ``SecretString``, is not valid JSON, or is not a JSON object. .. py:function:: get_secret(secret_key: str, secret_name: str = '', region_name: str = '') -> str Retrieve a specific secret value from an AWS Secrets Manager secret. :param secret_key: The key of the secret to retrieve. :type secret_key: str :param secret_name: The name of the secret to retrieve. :type secret_name: str :param region_name: The AWS region where the secret is stored. :type region_name: str :returns: The value of the requested secret. :rtype: str :raises KeyError: If ``secret_key`` is not present in the retrieved secret. :raises ClientError: If the AWS Secrets Manager API call fails. :raises ValueError: If the secret payload is malformed (see :func:`get_secrets`).