You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::IAM::InstanceProfile
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::IAM::InstanceProfile
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#arn ⇒ String
readonly
The Amazon Resource Name (ARN) specifying the instance profile.
-
#create_date ⇒ Time
readonly
The date when the instance profile was created.
-
#instance_profile_id ⇒ String
readonly
The stable and unique string identifying the instance profile.
-
#instance_profile_name ⇒ String
readonly
The name identifying the instance profile.
-
#name ⇒ String
readonly
-
#path ⇒ String
readonly
The path to the instance profile.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#add_role(options = {}) ⇒ Struct
Adds the specified IAM role to the specified instance profile.
-
#delete ⇒ Struct
Deletes the specified instance profile.
-
#exists? ⇒ Boolean
Returns
true
if this InstanceProfile exists. -
#initialize ⇒ Object
constructor
-
#remove_role(options = {}) ⇒ Struct
Removes the specified IAM role from the specified EC2 instance profile.
Make sure that you do not have any Amazon EC2 instances running with the role you are about to remove from the instance profile.
-
#roles ⇒ Array<Role>?
-
#wait_until_exists {|waiter| ... } ⇒ InstanceProfile
Waits until this InstanceProfile is exists.
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(name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object
Instance Attribute Details
#arn ⇒ String (readonly)
The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM Identifiers in the IAM User Guide.
#create_date ⇒ Time (readonly)
The date when the instance profile was created.
#instance_profile_id ⇒ String (readonly)
The stable and unique string identifying the instance profile. For more information about IDs, see IAM Identifiers in the IAM User Guide.
#instance_profile_name ⇒ String (readonly)
The name identifying the instance profile.
#name ⇒ String (readonly)
#path ⇒ String (readonly)
The path to the instance profile. For more information about paths, see IAM Identifiers in the IAM User Guide.
Instance Method Details
#add_role(options = {}) ⇒ Struct
Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role. (The number and size of IAM resources in an AWS account are limited. For more information, see IAM and STS Quotas in the IAM User Guide.) You can remove the existing role and then add a different role to an instance profile. You must then wait for the change to appear across all of AWS because of eventual consistency. To force the change, you must disassociate the instance profile and then associate the instance profile, or you can stop your instance and then restart it.
The caller of this API must be granted the PassRole
permission on the IAM role by a permissions policy.
For more information about roles, go to Working with Roles. For more information about instance profiles, go to About Instance Profiles.
#delete ⇒ Struct
Deletes the specified instance profile. The instance profile must not have an associated role.
Make sure that you do not have any Amazon EC2 instances running with the instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.
For more information about instance profiles, go to About Instance Profiles.
#exists? ⇒ Boolean
Returns true
if this InstanceProfile exists. Returns false
otherwise.
#remove_role(options = {}) ⇒ Struct
Removes the specified IAM role from the specified EC2 instance profile.
Make sure that you do not have any Amazon EC2 instances running with the role you are about to remove from the instance profile. Removing a role from an instance profile that is associated with a running instance might break any applications running on the instance.
For more information about IAM roles, go to Working with Roles. For more information about instance profiles, go to About Instance Profiles.
#roles ⇒ Array<Role>?
#wait_until_exists {|waiter| ... } ⇒ InstanceProfile
Waits until this InstanceProfile is exists. This method waits by polling Client#get_instance_profile until successful. An error is raised after a configurable number of failed checks.
This waiter uses the following defaults:
Configuration | Default |
---|---|
#delay |
1 |
#max_attempts |
40 |
You can modify defaults and register callbacks by passing a block argument.