//This article helped me put everything together - https://www.webhat.in/article/woocommerce-tutorial/how-product-attribute-are-stored-in-database/
global $wpdb;
$posts = $wpdb->get_results("SELECT DISTINCT name FROM $wpdb->terms WHERE term_id in (SELECT DISTINCT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'pa_yourattributename' AND count > 0)");
print_r(array_values($posts));