True or false. Filters the users to include only those that have a console password (that is, they are able to login to the AWS web UI using a password).
Properties are used with the `its` test to obtain information about the matched users. Properties always return arrays, though they may be empty.
### attached\_policy\_arns
Array of strings. Each entry is the ARN of an IAM managed policy that is attached to at least one matched user. The list is de-duplicated, so if you have five users that are all attached to the same policy, `attached_policy_arns` will return only one ARN, not five.
# Service users should be attached to a custom service policy
describe aws_iam_users.where { username.start_with?('service') } do
its('attached_policy_arns') { should include 'arn:aws:iam::123456789012:policy/MyServicePolicy' }
end
### attached\_policy\_names
Array of strings. Each entry is the friendly name of an IAM managed policy that is attached to at least one matched user. The list is de-duplicated, so if you have five users that are all attached to the same policy, `attached_policy_names` will return only one name, not five.
# Service users should be attached to a custom service policy
# and not include Admin policy!
describe aws_iam_users.where { username.start_with?('service') } do
its('attached_policy_names') { should include 'MyServicePolicy' }
its('attached_policy_names') { should_not include 'AdministratorAccess' }
end
### inline\_policy\_names
Array of strings. Each entry is the name of an embedded policy that is embedded in at least one matched user. Keep in mind that each user has a copy of a policy (which can then be modified). This means that two users can have an embedded policy with the same name, but very different contents. The list is de-duplicated, so if you have five users that have an inline policy with the same name, `inline_policy_names` will return only one name, not five.
# Service users should have a bespoke policy
describe aws_iam_users.where { username.start_with?('service') } do
its('inline_policy_names') { should include 'some-bespoke-policy' }
end
### usernames
Array of strings. Each entry is the name of a user that matched. There will be exactly as many usernames here as there were users that matched, though it is possible to have non-unique usernames.
# 42 Users, including Bob, should have a password.
describe aws_iam_users.where(has_console_password: true) do
Your [Principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html#intro-structure-principal) will need the `iam:ListUsers`, `iam:GetLoginProfile`, `iam:ListMFADevices`, `iam:ListAccessKeys`, `iam:ListUserPolicies`, and `iam:ListAttachedUserPolicies` action with Effect set to Allow.
You can find detailed documentation at [Actions, Resources, and Condition Keys for Identity And Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_identityandaccessmanagement.html).