There are more AWS SDK examples available in the AWS Doc SDK Examples
Get an IAM user using an AWS SDK
The following code examples show how to get an IAM user.
To avoid security risks, don't use IAM users for authentication when developing purpose-built software or working with real data. Instead, use federation with an identity provider such as AWS IAM Identity Center (successor to AWS Single Sign-On).