Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


Boto3 List CloudFormation Exports

07 Nov 2020 »
def list_exports(client_=None, nexttoken=""):
    rs = client_.list_exports(**({"NextToken": nexttoken} if nexttoken != "" else {}))
    nexttoken = rs.get("NextToken", "")
    ret = rs["Exports"]
    if nexttoken != "":
        return ret + list_exports(client_, nexttoken)
    else:
        return ret