Learn R Programming

paws.security.identity (version 0.1.12)

iam_attach_user_policy: Attaches the specified managed policy to the specified user

Description

Attaches the specified managed policy to the specified user.

You use this API to attach a managed policy to a user. To embed an inline policy in a user, use put_user_policy.

For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide.

Usage

iam_attach_user_policy(UserName, PolicyArn)

Value

An empty list.

Arguments

UserName

[required] 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

[required] The Amazon Resource Name (ARN) of the IAM policy you want to attach.

For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Request syntax

svc$attach_user_policy(
  UserName = "string",
  PolicyArn = "string"
)

Examples

Run this code
if (FALSE) {
# The following command attaches the AWS managed policy named
# AdministratorAccess to the IAM user named Alice.
svc$attach_user_policy(
  PolicyArn = "arn:aws:iam::aws:policy/AdministratorAccess",
  UserName = "Alice"
)
}

Run the code above in your browser using DataLab