def get_random_string()

in reference-architectures/automated-password-rotation/terraform/code/main.py [0:0]


def get_random_string(length):
    """Function to generate random string.
    Args:
        length: Length of the string to generate
    Returns:
        result_str: Random string
    """
    # choose from all lowercase letter
    letters = string.ascii_lowercase
    result_str = "".join(random.choice(letters) for i in range(length))
    return result_str