amazon web services - AWS Ruby-sdk: How can I create a IAM user with auto generated password -


i using aws ruby-sdk create iam user specifying username. password should auto-generated. couldn't find related in api docs (http://docs.aws.amazon.com/sdkforruby/api/index.html)

iam not have auto-generate password feature in api. web console providing functionality on behalf of users. create password user using aws sdk ruby, can following:

require 'aws-sdk'  iam = aws::iam::resource.new user = iam.create_user(user_name: 'name') user.create_login_profile(password: 'randompassword', password_reset_required: false) 

you can of course use method prefer randomize password. simple mechanism use securerandom ruby's standard library:

# creates random password of 10 hex characters (length 2x given n) require 'securerandom' password = securerandom.hex(5)  #=> "764d9308a3" 

Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -