title: How to use AWS generated password to create IAM user on AWS CLI properly?
body: <p>I wrote a script to: 1) generate random password 2) create new IAM user 3) set up login profile for that user using the generated password.
  Below is my code in bash:</p>
  
  <pre><code>RANDOM_PASS=$(aws secretsmanager get-random-password --include-space --password-length 20 --require-each-included-type | jq '.RandomPassword' | tr -d '"')
  
  aws iam create-user --user-name $USERID
  aws iam create-login-profile --user-name $USERID --password $RANDOM_PASS --password-reset-required
  </code></pre>
  
  <p>as you can see, I used jq to get that specific password string and then truncated the " so I can put it in the create-login-profile.  But it doesn't look very elegant and I feel there must be a better way to do this.  Any suggestions?</p>