Last active
August 29, 2015 14:17
-
-
Save maimai-swap/0378202e6fa651fa0545 to your computer and use it in GitHub Desktop.
AWS cliでiamユーザー作ってグループに入れる。
This file contains 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
#!/bin/sh | |
# 環境のaws cli profile | |
AWS_PROFILE_NAME=$1 | |
# 環境のaws cli profileをアカウント名のsuffixにする | |
AWS_SYSTEM_ID=$AWS_PROFILE_NAME | |
# ユーザー名 | |
USER_NAME=$2 | |
# パスワード | |
PASSWORD=$3 | |
# グループ名 | |
GROUP_NAME=$4 | |
aws configure list --profile $AWS_PROFILE_NAME | |
# aws iam list-groups --profile $AWS_PROFILE_NAME | |
aws iam create-user --user-name $USER_NAME@$AWS_SYSTEM_ID --path / --profile $AWS_PROFILE_NAME | |
aws iam create-login-profile --user-name $USER_NAME@$AWS_SYSTEM_ID --password $PASSWORD --password-reset-required --profile $AWS_PROFILE_NAME | |
aws iam add-user-to-group --group-name $GROUP_NAME --user-name $USER_NAME@$AWS_SYSTEM_ID --profile $AWS_PROFILE_NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment