Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
Synopsis
- data AttachRolePolicy = AttachRolePolicy' {}
- newAttachRolePolicy :: Text -> Text -> AttachRolePolicy
- attachRolePolicy_roleName :: Lens' AttachRolePolicy Text
- attachRolePolicy_policyArn :: Lens' AttachRolePolicy Text
- data AttachRolePolicyResponse = AttachRolePolicyResponse' {
- newAttachRolePolicyResponse :: AttachRolePolicyResponse
Creating a Request
data AttachRolePolicy Source #
See: newAttachRolePolicy
smart constructor.
AttachRolePolicy' | |
|
Instances
Create a value of AttachRolePolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:roleName:AttachRolePolicy'
, attachRolePolicy_roleName
- The name (friendly name, not ARN) of the role to attach the policy to.
This parameter allows (through 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: _+=,.@-
$sel:policyArn:AttachRolePolicy'
, attachRolePolicy_policyArn
- The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
Request Lenses
attachRolePolicy_roleName :: Lens' AttachRolePolicy Text Source #
The name (friendly name, not ARN) of the role to attach the policy to.
This parameter allows (through 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: _+=,.@-
attachRolePolicy_policyArn :: Lens' AttachRolePolicy Text Source #
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
Destructuring the Response
data AttachRolePolicyResponse Source #
See: newAttachRolePolicyResponse
smart constructor.
Instances
Eq AttachRolePolicyResponse Source # | |
Defined in Amazonka.IAM.AttachRolePolicy | |
Read AttachRolePolicyResponse Source # | |
Show AttachRolePolicyResponse Source # | |
Defined in Amazonka.IAM.AttachRolePolicy showsPrec :: Int -> AttachRolePolicyResponse -> ShowS # show :: AttachRolePolicyResponse -> String # showList :: [AttachRolePolicyResponse] -> ShowS # | |
Generic AttachRolePolicyResponse Source # | |
Defined in Amazonka.IAM.AttachRolePolicy type Rep AttachRolePolicyResponse :: Type -> Type # | |
NFData AttachRolePolicyResponse Source # | |
Defined in Amazonka.IAM.AttachRolePolicy rnf :: AttachRolePolicyResponse -> () # | |
type Rep AttachRolePolicyResponse Source # | |
newAttachRolePolicyResponse :: AttachRolePolicyResponse Source #
Create a value of AttachRolePolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.