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

Class: Aws::IAM::Resource

Inherits:
Resources::Resource show all
Defined in:
aws-sdk-resources/lib/aws-sdk-resources/services/iam.rb

Overview

This class provides a resource oriented interface for IAM. To create a resource object:

resource = Aws::IAM::Resource.new

You can supply a client object with custom configuration that will be used for all resource operations. If you do not pass :client, a default client will be constructed.

client = Aws::IAM::Client.new(region: 'us-west-2')
resource = Aws::IAM::Resource.new(client: client)

Resource Resource Classes

Aws::IAM::Resource has the following resource classes:

Instance Attribute Summary

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Method Details

#account_password_policyAccountPasswordPolicy

#account_summaryAccountSummary

Returns:

#change_password(options = {}) ⇒ Struct

Changes the password of the IAM user who is calling this action. The root account password is not affected by this action.

To change the password for a different user, see UpdateLoginProfile. For more information about modifying passwords, see Managing Passwords in the IAM User Guide.

Examples:

Request syntax example with placeholder values


iam.change_password({
  old_password: "passwordType", # required
  new_password: "passwordType", # required
})

Options Hash (options):

  • :old_password (required, String)

    The IAM user\'s current password.

  • :new_password (required, String)

    The new password. The new password must conform to the AWS account\'s password policy, if one exists.

    The regex pattern used to validate this parameter is a string of characters consisting of almost any printable ASCII character from the space (\u0020) through the end of the ASCII character range (\u00FF). You can also include the tab (\u0009), line feed (\u000A), and carriage return (\u000D) characters. Although any of these characters are valid in a password, note that many tools, such as the AWS Management Console, might restrict the ability to enter certain characters because they have special meaning within that tool.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_account_alias(options = {}) ⇒ Struct

Creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in the IAM User Guide.

Examples:

Request syntax example with placeholder values


iam.({
  account_alias: "accountAliasType", # required
})

Options Hash (options):

  • :account_alias (required, String)

    The account alias to create.

    This parameter allows (per its regex pattern) a string of characters consisting of lowercase letters, digits, and dashes. You cannot start or finish with a dash, nor can you have two dashes in a row.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_account_password_policy(options = {}) ⇒ AccountPasswordPolicy

Examples:

Request syntax example with placeholder values


iam.({
  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,
})

Basic usage

accountpasswordpolicy = iam.create_account_password_policy(options)
accountpasswordpolicy.
#=> "accountpasswordpolicy-"

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:

See Also:

#create_group(options = {}) ⇒ Group

Examples:

Request syntax example with placeholder values


iam.create_group({
  path: "pathType",
  group_name: "groupNameType", # required
})

Basic usage

group = iam.create_group(options)
group.name
#=> "group-name"

Options Hash (options):

  • :path (String)

    The path to the group. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :group_name (required, String)

    The name of the group to create. Do not include the path in this value.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-. The group name must be unique within the account. Group names are not distinguished by case. For example, you cannot create groups named both \"ADMINS\" and \"admins\".

Returns:

See Also:

#create_instance_profile(options = {}) ⇒ InstanceProfile

Examples:

Request syntax example with placeholder values


iam.create_instance_profile({
  instance_profile_name: "instanceProfileNameType", # required
  path: "pathType",
})

Basic usage

instanceprofile = iam.create_instance_profile(options)
instanceprofile.name
#=> "instanceprofile-name"

Options Hash (options):

  • :instance_profile_name (required, String)

    The name of the instance profile to create.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-

  • :path (String)

    The path to the instance profile. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

Returns:

See Also:

#create_policy(options = {}) ⇒ Policy

Examples:

Request syntax example with placeholder values


iam.create_policy({
  policy_name: "policyNameType", # required
  path: "policyPathType",
  policy_document: "policyDocumentType", # required
  description: "policyDescriptionType",
})

Basic usage

policy = iam.create_policy(options)
policy.arn
#=> "policy-arn"

Options Hash (options):

  • :policy_name (required, String)

    The friendly name of the policy.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-+

  • :path (String)

    The path for the policy.

    For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :policy_document (required, String)

    The JSON policy document that you want to use as the content for the new policy.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

  • :description (String)

    A friendly description of the policy.

    Typically used to store information about the permissions defined in the policy. For example, \"Grants access to production DynamoDB tables.\"

    The policy description is immutable. After a value is assigned, it cannot be changed.

Returns:

See Also:

#create_role(options = {}) ⇒ Role

Examples:

Request syntax example with placeholder values


iam.create_role({
  path: "pathType",
  role_name: "roleNameType", # required
  assume_role_policy_document: "policyDocumentType", # required
  description: "roleDescriptionType",
})

Basic usage

role = iam.create_role(options)
role.name
#=> "role-name"

Options Hash (options):

  • :path (String)

    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :role_name (required, String)

    The name of the role to create.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    Role names are not distinguished by case. For example, you cannot create roles named both \"PRODROLE\" and \"prodrole\".

  • :assume_role_policy_document (required, String)

    The trust relationship policy document that grants an entity permission to assume the role.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

  • :description (String)

    A customer-provided description of the role.

Returns:

See Also:

#create_saml_provider(options = {}) ⇒ SamlProvider

Examples:

Request syntax example with placeholder values


iam.create_saml_provider({
  saml_metadata_document: "SAMLMetadataDocumentType", # required
  name: "SAMLProviderNameType", # required
})

Basic usage

samlprovider = iam.create_saml_provider(options)
samlprovider.arn
#=> "samlprovider-arn"

Options Hash (options):

  • :saml_metadata_document (required, String)

    An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer\'s name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization\'s IdP.

    For more information, see About SAML 2.0-based Federation in the IAM User Guide

  • :name (required, String)

    The name of the provider to create.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-

Returns:

See Also:

#create_server_certificate(options = {}) ⇒ ServerCertificate

Examples:

Request syntax example with placeholder values


iam.create_server_certificate({
  path: "pathType",
  server_certificate_name: "serverCertificateNameType", # required
  certificate_body: "certificateBodyType", # required
  private_key: "privateKeyType", # required
  certificate_chain: "certificateChainType",
})

Basic usage

servercertificate = iam.create_server_certificate(options)
servercertificate.name
#=> "servercertificate-name"

Options Hash (options):

  • :path (String)

    The path for the server certificate. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/). This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

    If you are uploading a server certificate specifically for use with Amazon CloudFront distributions, you must specify a path using the --path option. The path must begin with /cloudfront and must include a trailing slash (for example, /cloudfront/test/).

  • :server_certificate_name (required, String)

    The name for the server certificate. Do not include the path in this value. The name of the certificate cannot contain any spaces.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-

  • :certificate_body (required, String)

    The contents of the public key certificate in PEM-encoded format.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

  • :private_key (required, String)

    The contents of the private key in PEM-encoded format.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

  • :certificate_chain (String)

    The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

Returns:

See Also:

#create_signing_certificate(options = {}) ⇒ SigningCertificate

Examples:

Request syntax example with placeholder values


iam.create_signing_certificate({
  user_name: "existingUserNameType",
  certificate_body: "certificateBodyType", # required
})

Basic usage

signingcertificate = iam.create_signing_certificate(options)
signingcertificate.id
#=> "signingcertificate-id"

Options Hash (options):

  • :user_name (String)

    The name of the user the signing certificate is for.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-

  • :certificate_body (required, String)

    The contents of the signing certificate.

    The regex pattern used to validate this parameter is a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range as well as the printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).

Returns:

See Also:

#create_user(options = {}) ⇒ User

Examples:

Request syntax example with placeholder values


iam.create_user({
  path: "pathType",
  user_name: "userNameType", # required
})

Basic usage

user = iam.create_user(options)
user.name
#=> "user-name"

Options Hash (options):

  • :path (String)

    The path for the user name. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :user_name (required, String)

    The name of the user to create.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-. User names are not distinguished by case. For example, you cannot create users named both \"TESTUSER\" and \"testuser\".

Returns:

See Also:

#create_virtual_mfa_device(options = {}) ⇒ VirtualMfaDevice

Examples:

Request syntax example with placeholder values


iam.create_virtual_mfa_device({
  path: "pathType",
  virtual_mfa_device_name: "virtualMFADeviceName", # required
})

Basic usage

virtualmfadevice = iam.create_virtual_mfa_device(options)
virtualmfadevice.serial_number
#=> "virtualmfadevice-serial-number"

Options Hash (options):

  • :path (String)

    The path for the virtual MFA device. For more information about paths, see IAM Identifiers in the IAM User Guide.

    This parameter is optional. If it is not included, it defaults to a slash (/).

    This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :virtual_mfa_device_name (required, String)

    The name of the virtual MFA device. Use with path to uniquely identify a virtual MFA device.

    This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: =,.@-

Returns:

See Also:

#current_userCurrentUser

Returns:

#delete_account_aliasSeahorse::Client::Response, false

Returns the response from Client#delete_account_alias if an alias was deleted. Returns false if this account had no alias to remove.

Returns:

See Also:



9
10
11
12
13
14
15
# File 'aws-sdk-resources/lib/aws-sdk-resources/services/iam.rb', line 9

def 
  if name = @client...first
    @client.(account_alias: name)
  else
    false
  end
end

#group(name) ⇒ Group

Parameters:

Returns:

See Also:

#groups(options = {}) ⇒ Collection<Group>

Returns a Collection of Group resources. No API requests are made until you call an enumerable method on the collection. Client#list_groups will be called multiple times until every Group has been yielded.

Examples:

Request syntax example with placeholder values


iam.groups({
  path_prefix: "pathPrefixType",
  marker: "markerType",
  max_items: 1,
})

Enumerating Group resources.

iam.groups.each do |group|
  # yields each group
end

Enumerating Group resources with a limit.

iam.groups.limit(10).each do |group|
  # yields at most 10 groups
end

Options Hash (options):

  • :path_prefix (String)

    The path prefix for filtering the results. For example, the prefix /division_abc/subdivision_xyz/ gets all groups whose path starts with /division_abc/subdivision_xyz/.

    This parameter is optional. If it is not included, it defaults to a slash (/), listing all groups. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

See Also:

#instance_profile(name) ⇒ InstanceProfile

Parameters:

Returns:

See Also:

#instance_profiles(options = {}) ⇒ Collection<InstanceProfile>

Returns a Collection of InstanceProfile resources. No API requests are made until you call an enumerable method on the collection. Client#list_instance_profiles will be called multiple times until every InstanceProfile has been yielded.

Examples:

Request syntax example with placeholder values


iam.instance_profiles({
  path_prefix: "pathPrefixType",
  marker: "markerType",
  max_items: 1,
})

Enumerating InstanceProfile resources.

iam.instance_profiles.each do |instanceprofile|
  # yields each instanceprofile
end

Enumerating InstanceProfile resources with a limit.

iam.instance_profiles.limit(10).each do |instanceprofile|
  # yields at most 10 instance_profiles
end

Options Hash (options):

  • :path_prefix (String)

    The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all instance profiles whose path starts with /application_abc/component_xyz/.

    This parameter is optional. If it is not included, it defaults to a slash (/), listing all instance profiles. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

See Also:

#policies(options = {}) ⇒ Collection<Policy>

Returns a Collection of Policy resources. No API requests are made until you call an enumerable method on the collection. Client#list_policies will be called multiple times until every Policy has been yielded.

Examples:

Request syntax example with placeholder values


iam.policies({
  scope: "All", # accepts All, AWS, Local
  only_attached: false,
  path_prefix: "policyPathType",
  marker: "markerType",
  max_items: 1,
})

Enumerating Policy resources.

iam.policies.each do |policy|
  # yields each policy
end

Enumerating Policy resources with a limit.

iam.policies.limit(10).each do |policy|
  # yields at most 10 policies
end

Options Hash (options):

  • :scope (String)

    The scope to use for filtering the results.

    To list only AWS managed policies, set Scope to AWS. To list only the customer managed policies in your AWS account, set Scope to Local.

    This parameter is optional. If it is not included, or if it is set to All, all policies are returned.

  • :only_attached (Boolean)

    A flag to filter the results to only the attached policies.

    When OnlyAttached is true, the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached is false, or when the parameter is not included, all policies are returned.

  • :path_prefix (String)

    The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

See Also:

#policy(arn) ⇒ Policy

Parameters:

Returns:

See Also:

#role(name) ⇒ Role

Parameters:

Returns:

See Also:

#roles(options = {}) ⇒ Collection<Role>

Returns a Collection of Aws::IAM::Role resources. No API requests are made until you call an enumerable method on the collection. Client#list_roles will be called multiple times until every Aws::IAM::Role has been yielded.

Examples:

Request syntax example with placeholder values


iam.roles({
  path_prefix: "pathPrefixType",
  marker: "markerType",
  max_items: 1,
})

Enumerating Aws::IAM::Role resources.

iam.roles.each do |role|
  # yields each role
end

Enumerating Aws::IAM::Role resources with a limit.

iam.roles.limit(10).each do |role|
  # yields at most 10 roles
end

Options Hash (options):

  • :path_prefix (String)

    The path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/ gets all roles whose path starts with /application_abc/component_xyz/.

    This parameter is optional. If it is not included, it defaults to a slash (/), listing all roles. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

  • (Collection<Role>)

See Also:

#saml_provider(arn) ⇒ SamlProvider

Parameters:

Returns:

See Also:

#saml_providersCollection<SamlProvider>

Returns a Collection of SamlProvider resources. No API requests are made until you call an enumerable method on the collection. Client#list_saml_providers will be called multiple times until every SamlProvider has been yielded.

Examples:

Request syntax example with placeholder values


iam.saml_providers()

Enumerating SamlProvider resources.

iam.saml_providers.each do |samlprovider|
  # yields each samlprovider
end

Enumerating SamlProvider resources with a limit.

iam.saml_providers.limit(10).each do |samlprovider|
  # yields at most 10 saml_providers
end

Returns:

See Also:

#server_certificate(name) ⇒ ServerCertificate

Parameters:

Returns:

See Also:

#server_certificates(options = {}) ⇒ Collection<ServerCertificate>

Returns a Collection of ServerCertificate resources. No API requests are made until you call an enumerable method on the collection. Client#list_server_certificates will be called multiple times until every ServerCertificate has been yielded.

Examples:

Request syntax example with placeholder values


iam.server_certificates({
  path_prefix: "pathPrefixType",
  marker: "markerType",
  max_items: 1,
})

Enumerating ServerCertificate resources.

iam.server_certificates.each do |servercertificate|
  # yields each servercertificate
end

Enumerating ServerCertificate resources with a limit.

iam.server_certificates.limit(10).each do |servercertificate|
  # yields at most 10 server_certificates
end

Options Hash (options):

  • :path_prefix (String)

    The path prefix for filtering the results. For example: /company/servercerts would get all server certificates for which the path starts with /company/servercerts.

    This parameter is optional. If it is not included, it defaults to a slash (/), listing all server certificates. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

See Also:

#user(name) ⇒ User

Parameters:

  • name (String)

    The User#name identifier.

Returns:

See Also:

#users(options = {}) ⇒ Collection<User>

Returns a Collection of User resources. No API requests are made until you call an enumerable method on the collection. Client#list_users will be called multiple times until every User has been yielded.

Examples:

Request syntax example with placeholder values


iam.users({
  path_prefix: "pathPrefixType",
  marker: "markerType",
  max_items: 1,
})

Enumerating User resources.

iam.users.each do |user|
  # yields each user
end

Enumerating User resources with a limit.

iam.users.limit(10).each do |user|
  # yields at most 10 users
end

Options Hash (options):

  • :path_prefix (String)

    The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/, which would get all user names whose path starts with /division_abc/subdivision_xyz/.

    This parameter is optional. If it is not included, it defaults to a slash (/), listing all user names. This paramater allows (per its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes, containing any ASCII character from the ! (\u0021) thru the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

  • (Collection<User>)

See Also:

#virtual_mfa_device(serial_number) ⇒ VirtualMfaDevice

Parameters:

Returns:

See Also:

#virtual_mfa_devices(options = {}) ⇒ Collection<VirtualMfaDevice>

Returns a Collection of VirtualMfaDevice resources. No API requests are made until you call an enumerable method on the collection. Client#list_virtual_mfa_devices will be called multiple times until every VirtualMfaDevice has been yielded.

Examples:

Request syntax example with placeholder values


iam.virtual_mfa_devices({
  assignment_status: "Assigned", # accepts Assigned, Unassigned, Any
  marker: "markerType",
  max_items: 1,
})

Enumerating VirtualMfaDevice resources.

iam.virtual_mfa_devices.each do |virtualmfadevice|
  # yields each virtualmfadevice
end

Enumerating VirtualMfaDevice resources with a limit.

iam.virtual_mfa_devices.limit(10).each do |virtualmfadevice|
  # yields at most 10 virtual_mfa_devices
end

Options Hash (options):

  • :assignment_status (String)

    The status (Unassigned or Assigned) of the devices to list. If you do not specify an AssignmentStatus, the action defaults to Any which lists both assigned and unassigned virtual MFA devices.

  • :marker (String)

    Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker element in the response that you received to indicate where the next call should start.

  • :max_items (Integer) — default: Optional

    Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.

    If you do not include this parameter, it defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the IsTruncated response element returns true and Marker contains a value to include in the subsequent call that tells the service where to continue from.

Returns:

See Also: