英文:
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")
获取用户,但这里没有直接的功能来获取控制台访问的状态。我在这里寻找一个直接的函数:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html
英文:
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
答案1
得分: 1
如果您指的是IAM用户登录到AWS Web控制台的访问权限,而不是其他类似创建SSH或SSM连接到EC2实例的能力,那么您需要使用get_login_profile。
登录配置文件是在为用户创建密码以访问Amazon Web Services管理控制台时创建的。如果用户不存在或没有密码,该操作将返回404(NoSuchEntity)错误。
英文:
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.
答案2
得分: 0
使用 get_login_profile()
,我可以检查控制台访问权限。这有点间接,只有具有控制台访问权限的用户才会收到此调用的响应,而其他用户会收到404错误,因为配置文件不会加载。
英文:
Using get_login_profile()
, I am able to to check console access. It's somewhat indirect. Like only users with console access will get a response to this call, while others will get a 404 error since the profile won't be loaded.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论