Browse Source

add py/IAM-Create.py.

xdc 5 years ago
parent
commit
d78f20c30a
1 changed files with 11 additions and 0 deletions
  1. 11 0
      py/IAM-Create.py

+ 11 - 0
py/IAM-Create.py

@@ -0,0 +1,11 @@
+import boto3
+client  = boto3.client('iam')
+
+client.create_user(UserName='heheda')
+
+response = client.attach_user_policy(
+    UserName='heheda',
+    PolicyArn='arn:aws-cn:iam::aws:policy/AdministratorAccess')
+
+client.create_login_profile(UserName='heheda',Password='heheda')
+