Skip to content

IAM  >  Operations  >  get_role

get_role

Operation

get_role async

get_role(input: GetRoleInput, plugins: list[Plugin] | None = None) -> GetRoleOutput

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.

Note

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, and some SDKs do this decoding automatically.

Parameters:

Name Type Description Default
input GetRoleInput

An instance of GetRoleInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
GetRoleOutput

An instance of GetRoleOutput.

Input

GetRoleInput dataclass

Bases: _SerdeShape

Dataclass for GetRoleInput structure.

Attributes

role_name class-attribute instance-attribute
role_name: str | None = ...

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

Output

GetRoleOutput dataclass

Bases: _SerdeShape

Contains the response to a successful GetRole request.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

role instance-attribute
role: Role

A structure containing details about the IAM role.