Afaik you can't get the account number from the provider object. You'll have to get it from AWS (as @millions-furniture-75402 suggests) or store it separately (which is what I do: I generate my providers from values in my config, and expose things like account alias and account id using those same values).