Class: AwsIamUser

Inherits:
Object
  • Object
show all
Includes:
AwsSingularResourceMixin
Defined in:
lib/resources/aws/aws_iam_user.rb

Defined Under Namespace

Classes: Backend

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AwsSingularResourceMixin

#exists?, included

Methods included from AwsResourceMixin

#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner

Instance Attribute Details

#access_keysObject (readonly)

Returns the value of attribute access_keys.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def access_keys
  @access_keys
end

#attached_policy_arnsObject (readonly)

Returns the value of attribute attached_policy_arns.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def attached_policy_arns
  @attached_policy_arns
end

#attached_policy_namesObject (readonly)

Returns the value of attribute attached_policy_names.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def attached_policy_names
  @attached_policy_names
end

#has_console_passwordObject (readonly) Also known as: has_console_password?

Returns the value of attribute has_console_password.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def has_console_password
  @has_console_password
end

#has_mfa_enabledObject (readonly) Also known as: has_mfa_enabled?

Returns the value of attribute has_mfa_enabled.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def has_mfa_enabled
  @has_mfa_enabled
end

#inline_policy_namesObject (readonly)

Returns the value of attribute inline_policy_names.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def inline_policy_names
  @inline_policy_names
end

#usernameObject (readonly)

Returns the value of attribute username.



19
20
21
# File 'lib/resources/aws/aws_iam_user.rb', line 19

def username
  @username
end

Instance Method Details

#has_attached_policies?Boolean

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/resources/aws/aws_iam_user.rb', line 33

def has_attached_policies?
  return nil unless exists?

  !attached_policy_names.empty?
end

#has_inline_policies?Boolean

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/resources/aws/aws_iam_user.rb', line 39

def has_inline_policies?
  return nil unless exists?

  !inline_policy_names.empty?
end

#nameObject



24
25
26
27
# File 'lib/resources/aws/aws_iam_user.rb', line 24

def name
  Inspec.deprecate(:properties_aws_iam_user, "The aws_iam_user `name` property is deprecated. Please use `username` instead")
  username
end

#to_sObject



29
30
31
# File 'lib/resources/aws/aws_iam_user.rb', line 29

def to_s
  "IAM User #{username}"
end