Method: AWS::IAM::UserCollection#create

Defined in:
lib/aws/iam/user_collection.rb

#create(name, options = {}) ⇒ User

Returns the newly created user.

Parameters:

  • name (String)

    Name of the user to create.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

Returns:

  • (User)

    Returns the newly created user.



65
66
67
68
69
70
71
72
# File 'lib/aws/iam/user_collection.rb', line 65

def create name, options = {}
  create_opts = {}
  create_opts[:user_name] = name
  create_opts[:path] = options[:path] if options[:path]
  resp = client.create_user(create_opts)
  User.new_from(:create_user, resp.user, 
    resp.user.user_name, :config => config)
end