How to retrieve aws session token from pre-request script in Postman?

I’m looking for a way to retrieve the aws session token by writing a pre-request script. What is the recommended way of doing it?

@Johannesc2019 Have you succeeded with sending a request to AWS via pre-request script?