def main()

in radlab-launcher/radlab.py [0:0]


def main(varcontents={}, module_name=None, action=None, projid=None, tfbucket=None, check=None):
    orgid = ""
    folderid = ""
    billing_acc = ""
    currentusr = ""

    setup_path = os.getcwd()

    # Setting "gcloud auth application-default" to deploy RAD Lab Modules
    currentusr = radlabauth(currentusr)

    # Setting up Project-ID
    projid = set_proj(projid)

    # Checking for User Permissions
    if check == True:
        launcherperm(projid, currentusr)

    # Listing / Selecting from available RAD Lab modules
    if module_name is None:
        module_name = list_modules()

    # Checking Module specific permissions
    if check == True:
        moduleperm(projid, module_name, currentusr)

    # Validating user input Terraform variables against selected module
    validate_tfvars(varcontents, module_name)

    # Select Action to perform
    if action is None or action == "":
        action = select_action().strip()

    # Setting up required attributes for any RAD Lab module deployment
    env_path, tfbucket, orgid, billing_acc, folderid, randomid = module_deploy_common_settings(action, module_name, setup_path, varcontents, projid, tfbucket)

    # Utilizing Terraform Wrapper for init / apply / destroy
    env(action, orgid, billing_acc, folderid, env_path, randomid, tfbucket, projid)

    print("\nGCS Bucket storing Terrafrom Configs: " + tfbucket + "\n")
    print("\nTERRAFORM DEPLOYMENT COMPLETED!!!\n")