Class: AWS::IAM::LoginProfile
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::IAM::LoginProfile
- Defined in:
- lib/aws/iam/login_profile.rb
Overview
A login profile is a user name and password that enables a user to log in to the AWS Management Console. Without a login profile, a user cannot access the console. (For information about accessing and using the AWS Management Console, see Using the AWS Management Console.)
Instance Attribute Summary collapse
- #user ⇒ Object readonly
Attributes included from Core::Model
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes the login profile for the specified user, which terminates the user’s ability to access AWS services through the IAM login page.
-
#exists? ⇒ Boolean
True if a login profile exists for the user.
-
#initialize(user, opts = {}) ⇒ LoginProfile
constructor
A new instance of LoginProfile.
-
#password=(password) ⇒ Object
Sets a new password for the login profile, creating the profile if no profile currently exists for the user.
Methods inherited from Resource
prefix_update_attributes, update_prefix
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(user, opts = {}) ⇒ LoginProfile
Returns a new instance of LoginProfile.
34 35 36 37 |
# File 'lib/aws/iam/login_profile.rb', line 34 def initialize(user, opts = {}) @user = user super end |
Instance Attribute Details
#user ⇒ Object (readonly)
41 42 43 |
# File 'lib/aws/iam/login_profile.rb', line 41 def user @user end |
Instance Method Details
#delete ⇒ nil
Deleting a user’s login profile does not prevent a user from accessing IAM through the command line interface or the API. To prevent all user access you must also either make the access key inactive or delete it. For more information about making keys inactive or deleting them, see User#access_keys.
Deletes the login profile for the specified user, which terminates the user’s ability to access AWS services through the IAM login page.
73 74 75 76 |
# File 'lib/aws/iam/login_profile.rb', line 73 def delete client.delete_login_profile() nil end |
#exists? ⇒ Boolean
Returns True if a login profile exists for the user.
79 80 81 82 83 84 85 |
# File 'lib/aws/iam/login_profile.rb', line 79 def exists? client.get_login_profile() rescue Errors::NoSuchEntity => e false else true end |
#password=(password) ⇒ Object
Sets a new password for the login profile, creating the profile if no profile currently exists for the user.
51 52 53 54 55 56 57 58 |
# File 'lib/aws/iam/login_profile.rb', line 51 def password=(password) = (:password => password) client.update_login_profile() password rescue Errors::NoSuchEntity => e client.create_login_profile() password end |