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.AttachRolePolicy

Description

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

Creating a Request

data AttachRolePolicy Source #

See: newAttachRolePolicy smart constructor.

Constructors

AttachRolePolicy' 

Fields

  • roleName :: Text

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

  • 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 AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Read AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Show AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Generic AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Associated Types

type Rep AttachRolePolicy :: Type -> Type #

NFData AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Methods

rnf :: AttachRolePolicy -> () #

Hashable AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

AWSRequest AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Associated Types

type AWSResponse AttachRolePolicy #

ToHeaders AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

ToPath AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

ToQuery AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

type Rep AttachRolePolicy Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

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

Defined in Amazonka.IAM.AttachRolePolicy

newAttachRolePolicy Source #

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

Instances details
Eq AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Read AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Show AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Generic AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

Associated Types

type Rep AttachRolePolicyResponse :: Type -> Type #

NFData AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

type Rep AttachRolePolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.AttachRolePolicy

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

newAttachRolePolicyResponse :: AttachRolePolicyResponse Source #

Create a value of AttachRolePolicyResponse with all optional fields omitted.

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