[PYTHON] Get a list of IAM users with Boto3

When I decided to study aws and python, I found something called Boto3! First, I created a list process for IAM users. (Leave the code terrible)

I'm still studying so I want to be able to write more

# -*- coding: utf-8 -*-

import boto3
from boto3.session import Session

client = boto3.client('iam')

# def
def user_list():
  response = client.list_users()
  for user in response["Users"]:
    print(user["UserName"])

# main
if __name__ == "__main__":
  user_list()

from : https://github.com/handa3/study/blob/master/aws/iam/user_list.py

Recommended Posts

Get a list of IAM users with Boto3
Get a list of purchased DMM eBooks with Python + Selenium
[python] Get a list of instance variables
[Python] Get a list of folders only
Get a list of files in a folder with python without a path
Get a list of CloudWatch Metrics and a correspondence table for Unit units with Python boto
Get a list of packages installed in your current environment with python
Get a list of Qiita likes by scraping
How to get a list of files in the same directory with python
[Boto3] Search for Cognito users with the List Users API
A script that outputs a list of SoftLayer portal users
Python: Get a list of methods for an object
Get the value of a specific key in a list from the dictionary type in the list with Python
I quarantined my environment with virtualenv, but I get a lot of packages with pip list
Get the id of a GPU with low memory usage
Get UNIXTIME at the beginning of today with a command
[Command] Command to get a list of files containing double-byte characters
Get the number of specific elements in a python list
Since Python 1.5 of Discord, I can't get a list of members
How to display a list of installable versions with pyenv
How to get a list of built-in exceptions in python
How to get a list of links from a page from wikipedia
Get AWS account ID with boto3
Get Redmine User list with DataFrame
Generate a list of consecutive characters
Try to get a list of breaking news threads in Python.
If you give a list with the default argument of the function ...
I tried to create a list of prime numbers with python
Here's a brief summary of how to get started with Django
Get the URL of a JIRA ticket created with the jira-python library
For Windows: Get a list of directories and files under a specific directory.
Get the number of searches with a regular expression. SeleniumBasic VBA Python
Display a list of alphabets in Python 3
Get a distributed representation of words in Fast with fastText on Facebook
Get the column list & data list of CASTable
Generate a list packed with the number of days in the current month.
Get a local DynamoDB environment with Docker
[Introduction to Python] How to sort the contents of a list efficiently with list sort
[Linux] Command to get a list of commands executed in the past
String conversion of a list containing numbers
Use Bucket (). Objects.filter instead of list_objects_v2 when outputting S3 list with Boto3
Receive a list of the results of parallel processing in Python with starmap
Get the filename of a directory (glob)
Get the average salary of a job with specified conditions from indeed.com
Get a list of camera parameters that can be set with cv2.VideoCapture and make it a dictionary type
Get lots of your tweets with Tweepy
Python script to get a list of input examples for the AtCoder contest
Get the stock price of a Japanese company with Python and make a graph
[Introduction to Python] How to get the index of data with a for statement
[Python / DynamoDB / boto3] List of operations I tried
Get a lot of Twitter tweets at once
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
[Python] Get the files in a folder with Python
Get a ticket for a theme park with python
[python] Create a list of various character types
Get the caller of a function in Python
Make a copy of the list in Python
Solve A ~ D of yuki coder 247 with python
Get only the subclass elements in a list
[Python] Get rid of dating with regular expressions
I get a UnicodeDecodeError when running with mod_wsgi