libZSservicesZSamazonka-iamZSamazonka-iam
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.IAM.AttachUserPolicy

Description

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

Creating a Request

data AttachUserPolicy Source #

See: newAttachUserPolicy smart constructor.

Constructors

AttachUserPolicy' 

Fields

  • userName :: Text

    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: _+=,.@-

  • policyArn :: Text

    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.

Instances

Instances details
Eq AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Read AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Show AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Generic AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Associated Types

type Rep AttachUserPolicy :: Type -> Type #

NFData AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Methods

rnf :: AttachUserPolicy -> () #

Hashable AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

AWSRequest AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Associated Types

type AWSResponse AttachUserPolicy #

ToHeaders AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

ToPath AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

ToQuery AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

type Rep AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

type Rep AttachUserPolicy = D1 ('MetaData "AttachUserPolicy" "Amazonka.IAM.AttachUserPolicy" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "AttachUserPolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse AttachUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

newAttachUserPolicy Source #

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

Instances details
Eq AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Read AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Show AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Generic AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

Associated Types

type Rep AttachUserPolicyResponse :: Type -> Type #

NFData AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

type Rep AttachUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachUserPolicy

type Rep AttachUserPolicyResponse = D1 ('MetaData "AttachUserPolicyResponse" "Amazonka.IAM.AttachUserPolicy" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "AttachUserPolicyResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newAttachUserPolicyResponse :: AttachUserPolicyResponse Source #

Create a value of AttachUserPolicyResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.