Skip to content

Get Role

iam_get_role R Documentation

Retrieves information about the specified role, including the role's path, GUID, ARN, and the role's trust policy that grants permission to assume the role

Description

Retrieves information about the specified role, including the role's path, GUID, ARN, and the role's trust policy that grants permission to assume the role. For more information about roles, see IAM roles in the IAM User Guide.

Policies returned by this operation are URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

Usage

iam_get_role(RoleName)

Arguments

RoleName

[required] The name of the IAM role to get information about.

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

Value

A list with the following syntax:

list(
  Role = list(
    Path = "string",
    RoleName = "string",
    RoleId = "string",
    Arn = "string",
    CreateDate = as.POSIXct(
      "2015-01-01"
    ),
    AssumeRolePolicyDocument = "string",
    Description = "string",
    MaxSessionDuration = 123,
    PermissionsBoundary = list(
      PermissionsBoundaryType = "PermissionsBoundaryPolicy",
      PermissionsBoundaryArn = "string"
    ),
    Tags = list(
      list(
        Key = "string",
        Value = "string"
      )
    ),
    RoleLastUsed = list(
      LastUsedDate = as.POSIXct(
        "2015-01-01"
      ),
      Region = "string"
    )
  )
)

Request syntax

svc$get_role(
  RoleName = "string"
)

Examples

## Not run: 
# The following command gets information about the role named Test-Role.
svc$get_role(
  RoleName = "Test-Role"
)

## End(Not run)