How to create IAM user and use it's Access Key and Secret key in Lambda environment variables?



I’d like to create a new IAM user (for programmatic access) with certain policies attached to it and get this user’s access key and secret key in some usable format (e.g. exported to be used within other serverless templates).

How can I achieve that?