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 user.
You use this operation to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy.
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide.
For more information about policies, see Managed policies and inline policies in the IAM User Guide.
Synopsis
- data AttachUserPolicy = AttachUserPolicy' {}
- newAttachUserPolicy :: Text -> Text -> AttachUserPolicy
- attachUserPolicy_userName :: Lens' AttachUserPolicy Text
- attachUserPolicy_policyArn :: Lens' AttachUserPolicy Text
- data AttachUserPolicyResponse = AttachUserPolicyResponse' {
- newAttachUserPolicyResponse :: AttachUserPolicyResponse
Creating a Request
data AttachUserPolicy Source #
See: newAttachUserPolicy
smart constructor.
AttachUserPolicy' | |
|
Instances
Create a value of AttachUserPolicy
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:userName:AttachUserPolicy'
, attachUserPolicy_userName
- The name (friendly name, not ARN) of the IAM user 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:AttachUserPolicy'
, attachUserPolicy_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
attachUserPolicy_userName :: Lens' AttachUserPolicy Text Source #
The name (friendly name, not ARN) of the IAM user 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: _+=,.@-
attachUserPolicy_policyArn :: Lens' AttachUserPolicy 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 AttachUserPolicyResponse Source #
See: newAttachUserPolicyResponse
smart constructor.
Instances
Eq AttachUserPolicyResponse Source # | |
Defined in Amazonka.IAM.AttachUserPolicy | |
Read AttachUserPolicyResponse Source # | |
Show AttachUserPolicyResponse Source # | |
Defined in Amazonka.IAM.AttachUserPolicy showsPrec :: Int -> AttachUserPolicyResponse -> ShowS # show :: AttachUserPolicyResponse -> String # showList :: [AttachUserPolicyResponse] -> ShowS # | |
Generic AttachUserPolicyResponse Source # | |
Defined in Amazonka.IAM.AttachUserPolicy type Rep AttachUserPolicyResponse :: Type -> Type # | |
NFData AttachUserPolicyResponse Source # | |
Defined in Amazonka.IAM.AttachUserPolicy rnf :: AttachUserPolicyResponse -> () # | |
type Rep AttachUserPolicyResponse Source # | |
newAttachUserPolicyResponse :: AttachUserPolicyResponse Source #
Create a value of AttachUserPolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.