Skip to content

Instantly share code, notes, and snippets.

@dfenjves
Created October 23, 2019 17:11
Show Gist options
  • Save dfenjves/385759a1bbe7aced3e9f0301e676e4ab to your computer and use it in GitHub Desktop.
Save dfenjves/385759a1bbe7aced3e9f0301e676e4ab to your computer and use it in GitHub Desktop.
IFS=,
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read student_username
do
aws iam create-user --user-name $student_username
aws iam add-user-to-group --group-name students --user-name $student_username
aws iam create-login-profile --user-name $student_username --password temporarypassword123! --password-reset-required
sleep 10s
aws cloud9 create-environment-ec2 --name $student_username --instance-type t2.micro --owner-arn arn:aws:iam::1234567890:user/$student_username
done < $INPUT
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment