function assignInstanceProfile() {
    const config = readSetupJson();

    const env = {
        AWS_ACCESS_KEY_ID: config["iam_auth_ec2_instance_account"],
        AWS_SECRET_ACCESS_KEY: config["iam_auth_ec2_instance_secret_access_key"],
    };

    const instanceProfileName = config["iam_auth_ec2_instance_profile"];
    const python_command = getPython3Binary() +
        ` -u lib/aws_assign_instance_profile.py --instance_profile_arn=${instanceProfileName}`;

    const ret = runShellCmdWithEnv(python_command, env);
    if (ret == 2) {
        print("WARNING: Request limit exceeded for AWS API");
        return false;
    }

    assert.eq(ret, 0, "Failed to assign an instance profile to the current machine");
    return true;
}
Verify the AWS IAM EC2 hosted auth works