Class: Aws::IAM::AccountPasswordPolicy
- Inherits:
-
Object
- Object
- Aws::IAM::AccountPasswordPolicy
- Extended by:
- Deprecations
- Defined in:
- sig/account_password_policy.rbs,
lib/aws-sdk-iam/account_password_policy.rb
Overview
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#allow_users_to_change_password ⇒ Boolean
Specifies whether IAM users are allowed to change their own password.
-
#expire_passwords ⇒ Boolean
Indicates whether passwords in the account expire.
-
#hard_expiry ⇒ Boolean
Specifies whether IAM users are prevented from setting a new password via the Amazon Web Services Management Console after their password has expired.
-
#max_password_age ⇒ Integer
The number of days that an IAM user password is valid.
-
#minimum_password_length ⇒ Integer
Minimum length to require for IAM user passwords.
-
#password_reuse_prevention ⇒ Integer
Specifies the number of previous passwords that IAM users are prevented from reusing.
-
#require_lowercase_characters ⇒ Boolean
Specifies whether IAM user passwords must contain at least one lowercase character (a to z).
-
#require_numbers ⇒ Boolean
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
-
#require_symbols ⇒ Boolean
Specifies whether IAM user passwords must contain at least one of the following symbols:.
-
#require_uppercase_characters ⇒ Boolean
Specifies whether IAM user passwords must contain at least one uppercase character (A to Z).
Actions collapse
- #delete(options = {}) ⇒ EmptyStructure
- #identifiers ⇒ Object deprecated private Deprecated.
- #update(options = {}) ⇒ EmptyStructure
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::PasswordPolicy
Returns the data for this AccountPasswordPolicy.
-
#data_loaded? ⇒ Boolean
Returns
trueif this resource is loaded. -
#initialize(options = {}) ⇒ AccountPasswordPolicy
constructor
A new instance of AccountPasswordPolicy.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current AccountPasswordPolicy.
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::IAM::Client] #wait_until instead
Constructor Details
#initialize(options = {}) ⇒ AccountPasswordPolicy
Returns a new instance of AccountPasswordPolicy.
13 |
# File 'sig/account_password_policy.rbs', line 13
def initialize: (Hash[Symbol, untyped] args) -> void
|
Instance Method Details
#allow_users_to_change_password ⇒ Boolean
Specifies whether IAM users are allowed to change their own password.
Gives IAM users permissions to iam:ChangePassword for only their
user and to the iam:GetAccountPasswordPolicy action. This option
does not attach a permissions policy to each user, rather the
permissions are applied at the account-level for all users by IAM.
31 |
# File 'sig/account_password_policy.rbs', line 31
def allow_users_to_change_password: () -> bool
|
#client ⇒ Client
108 |
# File 'lib/aws-sdk-iam/account_password_policy.rb', line 108
def client: () -> Client
|
#data ⇒ Types::PasswordPolicy
Returns the data for this Aws::IAM::AccountPasswordPolicy. Calls
Client#get_account_password_policy if #data_loaded? is false.
52 |
# File 'sig/account_password_policy.rbs', line 52
def data: () -> Types::PasswordPolicy
|
#data_loaded? ⇒ Boolean
55 |
# File 'sig/account_password_policy.rbs', line 55
def data_loaded?: () -> bool
|
#delete(options = {}) ⇒ EmptyStructure
59 60 |
# File 'sig/account_password_policy.rbs', line 59
def delete: () -> ::Aws::EmptyStructure
| (?Hash[Symbol, untyped]) -> ::Aws::EmptyStructure
|
#expire_passwords ⇒ Boolean
Indicates whether passwords in the account expire. Returns true if
MaxPasswordAge contains a value greater than 0. Returns false if
MaxPasswordAge is 0 or not present.
34 |
# File 'sig/account_password_policy.rbs', line 34
def expire_passwords: () -> bool
|
#hard_expiry ⇒ Boolean
Specifies whether IAM users are prevented from setting a new password
via the Amazon Web Services Management Console after their password
has expired. The IAM user cannot access the console until an
administrator resets the password. IAM users with iam:ChangePassword
permission and active access keys can reset their own expired console
password using the CLI or API.
43 |
# File 'sig/account_password_policy.rbs', line 43
def hard_expiry: () -> bool
|
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
362 363 364 |
# File 'lib/aws-sdk-iam/account_password_policy.rb', line 362 def identifiers {} end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::IAM::AccountPasswordPolicy.
Returns self making it possible to chain methods.
account_password_policy.reload.data
48 |
# File 'sig/account_password_policy.rbs', line 48
def load: () -> self
|
#max_password_age ⇒ Integer
The number of days that an IAM user password is valid.
37 |
# File 'sig/account_password_policy.rbs', line 37
def max_password_age: () -> ::Integer
|
#minimum_password_length ⇒ Integer
Minimum length to require for IAM user passwords.
16 |
# File 'sig/account_password_policy.rbs', line 16
def minimum_password_length: () -> ::Integer
|
#password_reuse_prevention ⇒ Integer
Specifies the number of previous passwords that IAM users are prevented from reusing.
40 |
# File 'sig/account_password_policy.rbs', line 40
def password_reuse_prevention: () -> ::Integer
|
#require_lowercase_characters ⇒ Boolean
Specifies whether IAM user passwords must contain at least one lowercase character (a to z).
28 |
# File 'sig/account_password_policy.rbs', line 28
def require_lowercase_characters: () -> bool
|
#require_numbers ⇒ Boolean
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
22 |
# File 'sig/account_password_policy.rbs', line 22
def require_numbers: () -> bool
|
#require_symbols ⇒ Boolean
Specifies whether IAM user passwords must contain at least one of the following symbols:
! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
19 |
# File 'sig/account_password_policy.rbs', line 19
def require_symbols: () -> bool
|
#require_uppercase_characters ⇒ Boolean
Specifies whether IAM user passwords must contain at least one uppercase character (A to Z).
25 |
# File 'sig/account_password_policy.rbs', line 25
def require_uppercase_characters: () -> bool
|
#update(options = {}) ⇒ EmptyStructure
63 |
# File 'sig/account_password_policy.rbs', line 63
def update: (
|
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::IAM::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/aws-sdk-iam/account_password_policy.rb', line 222 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new().wait({}) end end |