Module Smaws_Client_IAM.AttachRolePolicy

Attaches the specified managed policy to the specified IAM role. When you attach a managed policy to a role, the managed policy becomes part of the role's permission (access) policy.

You cannot use a managed policy as the role's trust 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.

Use this operation to attach a managed policy to a role. To embed an inline policy in a role, use PutRolePolicy. For more information about policies, see Managed policies and inline policies in the IAM User Guide.

As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide.

val error_to_string : [ Smaws_Lib.Protocols.AwsQuery.error | `InvalidInputException of Types.invalid_input_exception | `LimitExceededException of Types.limit_exceeded_exception | `NoSuchEntityException of Types.no_such_entity_exception | `PolicyNotAttachableException of Types.policy_not_attachable_exception | `ServiceFailureException of Types.service_failure_exception | `UnmodifiableEntityException of Types.unmodifiable_entity_exception ] -> string
val request : 'http_type Smaws_Lib.Context.t -> Types.attach_role_policy_request -> (Smaws_Lib.Smithy_api.Types.unit_, [> Smaws_Lib.Protocols.AwsQuery.error | `InvalidInputException of Types.invalid_input_exception | `LimitExceededException of Types.limit_exceeded_exception | `NoSuchEntityException of Types.no_such_entity_exception | `PolicyNotAttachableException of Types.policy_not_attachable_exception | `ServiceFailureException of Types.service_failure_exception | `UnmodifiableEntityException of Types.unmodifiable_entity_exception ]) Stdlib.result
val request_with_metadata : 'http_type Smaws_Lib.Context.t -> Types.attach_role_policy_request -> (Smaws_Lib.Smithy_api.Types.unit_ Smaws_Lib.Response.t, [> Smaws_Lib.Protocols.AwsQuery.error | `InvalidInputException of Types.invalid_input_exception | `LimitExceededException of Types.limit_exceeded_exception | `NoSuchEntityException of Types.no_such_entity_exception | `PolicyNotAttachableException of Types.policy_not_attachable_exception | `ServiceFailureException of Types.service_failure_exception | `UnmodifiableEntityException of Types.unmodifiable_entity_exception ] * Smaws_Lib.Response.metadata) Stdlib.result