kubectl get node -ojson | jq -r '.items[].spec.providerID' | cut -d/ -f5 | tr -d '"'
jq
to iterate over the objects to fetch the providerID
which will be in form of originally : aws:///<zone>/i-0123456789
cut
command to split the string with /
as delimiter and extract the 5th field.tr
finally to remove the trailing "
(by deleting all occurences of "
)