Python to list users in AWS

Posted OS Knowledge Base

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python to list users in AWS相关的知识,希望对你有一定的参考价值。

code

import boto3
c1=boto3.client(iam)
#list_users will be a dict
users=c1.list_users()
#transfer dict to list
user_list=list(( r.get(UserName) for r in users.get(Users) ))
#print list
print(user_list)
#transfer list to string
for user_name in user_list:
   print(user_name)

refer

https://www.w3schools.com/python/default.asp

 

以上是关于Python to list users in AWS的主要内容,如果未能解决你的问题,请参考以下文章