You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::IAM::AccountPasswordPolicy

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb

Defined Under Namespace

Classes: Collection

Actions collapse

Read-Only Attributes collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ AccountPasswordPolicy

Returns a new instance of AccountPasswordPolicy

Options Hash (options):



15
16
17
18
19
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 15

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#allow_users_to_change_passwordBoolean

Specifies whether IAM users are allowed to change their own password.

Returns:

  • (Boolean)


57
58
59
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 57

def allow_users_to_change_password
  data.allow_users_to_change_password
end

#clientClient

Returns:



92
93
94
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 92

def client
  @client
end

#dataTypes::PasswordPolicy

Returns:



112
113
114
115
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 112

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



120
121
122
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 120

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


.delete()

Parameters:

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

    ({})

Returns:

  • (EmptyStructure)


131
132
133
134
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 131

def delete(options = {})
  resp = @client.(options)
  resp.data
end

#expire_passwordsBoolean

Indicates whether passwords in the account expire. Returns true if MaxPasswordAge is contains a value greater than 0. Returns false if MaxPasswordAge is 0 or not present.

Returns:

  • (Boolean)


65
66
67
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 65

def expire_passwords
  data.expire_passwords
end

#hard_expiryBoolean

Specifies whether IAM users are prevented from setting a new password after their password has expired.

Returns:

  • (Boolean)


85
86
87
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 85

def hard_expiry
  data.hard_expiry
end

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::IAM::AccountPasswordPolicy. Returns self making it possible to chain methods.

.reload.data

Returns:

  • (self)


102
103
104
105
106
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 102

def load
  resp = @client.
  @data = resp.password_policy
  self
end

#max_password_ageInteger

The number of days that an IAM user password is valid.

Returns:

  • (Integer)


71
72
73
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 71

def max_password_age
  data.max_password_age
end

#minimum_password_lengthInteger

Minimum length to require for IAM user passwords.

Returns:

  • (Integer)


25
26
27
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 25

def minimum_password_length
  data.minimum_password_length
end

#password_reuse_preventionInteger

Specifies the number of previous passwords that IAM users are prevented from reusing.

Returns:

  • (Integer)


78
79
80
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 78

def password_reuse_prevention
  data.password_reuse_prevention
end

#require_lowercase_charactersBoolean

Specifies whether to require lowercase characters for IAM user passwords.

Returns:

  • (Boolean)


51
52
53
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 51

def require_lowercase_characters
  data.require_lowercase_characters
end

#require_numbersBoolean

Specifies whether to require numbers for IAM user passwords.

Returns:

  • (Boolean)


37
38
39
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 37

def require_numbers
  data.require_numbers
end

#require_symbolsBoolean

Specifies whether to require symbols for IAM user passwords.

Returns:

  • (Boolean)


31
32
33
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 31

def require_symbols
  data.require_symbols
end

#require_uppercase_charactersBoolean

Specifies whether to require uppercase characters for IAM user passwords.

Returns:

  • (Boolean)


44
45
46
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 44

def require_uppercase_characters
  data.require_uppercase_characters
end

#update(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


.update({
  minimum_password_length: 1,
  require_symbols: false,
  require_numbers: false,
  require_uppercase_characters: false,
  require_lowercase_characters: false,
  allow_users_to_change_password: false,
  max_password_age: 1,
  password_reuse_prevention: 1,
  hard_expiry: false,
})

Parameters:

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

    ({})

Options Hash (options):

  • :minimum_password_length (Integer)

    The minimum number of characters allowed in an IAM user password.

    Default value: 6

  • :require_symbols (Boolean)

    Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:

    ! @ # $ % ^ & * ( ) _ + - = [ ] \{ \} | '

    Default value: false

  • :require_numbers (Boolean)

    Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).

    Default value: false

  • :require_uppercase_characters (Boolean)

    Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).

    Default value: false

  • :require_lowercase_characters (Boolean)

    Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).

    Default value: false

  • :allow_users_to_change_password (Boolean)

    Allows all IAM users in your account to use the AWS Management Console to change their own passwords. For more information, see Letting IAM Users Change Their Own Passwords in the IAM User Guide.

    Default value: false

  • :max_password_age (Integer)

    The number of days that an IAM user password is valid. The default value of 0 means IAM user passwords never expire.

    Default value: 0

  • :password_reuse_prevention (Integer)

    Specifies the number of previous passwords that IAM users are prevented from reusing. The default value of 0 means IAM users are not prevented from reusing previous passwords.

    Default value: 0

  • :hard_expiry (Boolean)

    Prevents IAM users from setting a new password after their password has expired.

    Default value: false

Returns:

  • (EmptyStructure)


203
204
205
206
# File 'gems/aws-sdk-iam/lib/aws-sdk-iam/account_password_policy.rb', line 203

def update(options = {})
  resp = @client.(options)
  resp.data
end