amazonka-iam-1.3.3: Amazon Identity and Access Management SDK.

Copyright(c) 2013-2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <>
Portabilitynon-portable (GHC extensions)
Safe HaskellNone




Attaches the specified managed policy to the specified role.

When you attach a managed policy to a role, the managed policy is used as the role's access (permissions) 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 API to attach a managed policy to a role. To embed an inline policy in a role, use PutRolePolicy. For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide.

See: AWS API Reference for AttachRolePolicy.


Creating a Request

attachRolePolicy Source

Creates a value of AttachRolePolicy with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

Request Lenses

arpRoleName :: Lens' AttachRolePolicy Text Source

The name (friendly name, not ARN) of the role to attach the policy to.

Destructuring the Response

attachRolePolicyResponse :: AttachRolePolicyResponse Source

Creates a value of AttachRolePolicyResponse with the minimum fields required to make a request.