You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::IAM::RolePolicy
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::IAM::RolePolicy
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
-
#policy_document ⇒ String
readonly
The policy document.
-
#policy_name ⇒ String
readonly
The name of the policy.
-
#role_name ⇒ String
readonly
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#delete ⇒ Struct
Deletes the specified inline policy that is embedded in the specified IAM role.
A role can also have managed policies attached to it.
-
#initialize ⇒ Object
constructor
-
#put(options = {}) ⇒ Struct
Adds or updates an inline policy document that is embedded in the specified IAM role.
When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy.
-
#role ⇒ Role
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(role_name, name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object
Instance Attribute Details
#name ⇒ String (readonly)
#policy_document ⇒ String (readonly)
The policy document.
IAM stores policies in JSON format. However, resources that were created using AWS CloudFormation templates can be formatted in YAML. AWS CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
#policy_name ⇒ String (readonly)
The name of the policy.
#role_name ⇒ String (readonly)
Instance Method Details
#delete ⇒ Struct
Deletes the specified inline policy that is embedded in the specified IAM role.
A role can also have managed policies attached to it. To detach a managed policy from a role, use DetachRolePolicy. For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide.
#put(options = {}) ⇒ Struct
Adds or updates an inline policy document that is embedded in the specified IAM role.
When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role, using CreateRole. You can update a role's trust policy using UpdateAssumeRolePolicy. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities.
A role can also have a managed policy attached to it. To attach a managed policy to a role, use AttachRolePolicy. To create a new managed policy, use CreatePolicy. For information about policies, see Managed Policies and Inline Policies in the IAM User Guide.
For information about limits on the number of inline policies that you can embed with a role, see Limitations on IAM Entities in the IAM User Guide.
Because policy documents can be large, you should use POST rather than GET when calling PutRolePolicy
. For general information about using the Query API with IAM, go to Making Query Requests in the IAM User Guide.