Search code examples
amazon-web-servicesboto3amazon-iam

How do we get he console access status of an AWS IAM user? boto3 doesn't have a direct program for it?


client = boto3.client("iam")

gets the users but there is no direct function here to get the status of the console access

I am looking here for a direct function: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html


Solution

  • If you are referring to an IAM user's access to login to the AWS web console, and not something else such as the ability to create an SSH or SSM connection to an EC2 instance, then you are looking for get_login_profile.

    A login profile is created when you create a password for the user to access the Amazon Web Services Management Console. If the user does not exist or does not have a password, the operation returns a 404 ( NoSuchEntity) error.