Created
March 25, 2015 11:28
-
-
Save maimai-swap/f5ec5412d60dac09500a to your computer and use it in GitHub Desktop.
ユーザーのグループへの追加、ユーザーのグループからの削除、ユーザー自体の削除
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ユーザーのグループへの追加 | |
AWS_PROFILE_NAME="AWS cli のProfile名" | |
USER_NAMES="ユーザー名" | |
GROUP_NAME="グループ名" | |
for USER_NAME in $USER_NAMES | |
do | |
aws iam add-user-to-group --group-name $GROUP_NAME --user-name $USER_NAME --profile $AWS_PROFILE_NAME | |
done | |
exit | |
# ユーザーのグループからの削除 | |
AWS_PROFILE_NAME="AWS cli のProfile名" | |
GROUP_NAME="グループ名" | |
USER_NAMES="ユーザー名" | |
for USER_NAME in $USER_NAMES | |
do | |
aws iam remove-user-from-group --group-name $GROUP_NAME --user-name $USER_NAME --profile $AWS_PROFILE_NAME | |
done | |
exit | |
# ユーザー自体の削除 | |
AWS_PROFILE_NAME="AWS cli のProfile名" | |
USER_NAMES="ユーザー名" | |
for USER_NAME in $USER_NAMES | |
do | |
# ログインプロファイルを削除してから | |
aws iam delete-login-profile --user-name $USER_NAME --profile $AWS_PROFILE_NAME | |
# ユーザー削除 | |
aws iam delete-user --user-name $USER_NAME --profile $AWS_PROFILE_NAME | |
done | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment