Last active
April 16, 2022 20:52
-
-
Save cliffano/3f9320fc03f1e8ec8ea361bcec5174f5 to your computer and use it in GitHub Desktop.
Simple shell script to create a user on AWS with an initial password (required to be changed) and a group
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/bash | |
set -e | |
aws_username=<your_username> | |
aws_password=<your_password> | |
create_user() { | |
user=${1} | |
password=${2} | |
group=${3} | |
aws iam create-user --user-name ${user} | |
aws iam create-login-profile --user-name ${user} --password ${password} --password-reset-required | |
aws iam add-user-to-group --user-name ${user} --group-name ${group} | |
} | |
AWS_PROFILE=<your_profile> create_user ${aws_username} ${aws_password} <your_group> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
do u have any script for password change ?