Seleziona le tue preferenze relative ai cookie

Utilizziamo cookie essenziali e strumenti simili necessari per fornire il nostro sito e i nostri servizi. Utilizziamo i cookie prestazionali per raccogliere statistiche anonime in modo da poter capire come i clienti utilizzano il nostro sito e apportare miglioramenti. I cookie essenziali non possono essere disattivati, ma puoi fare clic su \"Personalizza\" o \"Rifiuta\" per rifiutare i cookie prestazionali.

Se sei d'accordo, AWS e le terze parti approvate utilizzeranno i cookie anche per fornire utili funzionalità del sito, ricordare le tue preferenze e visualizzare contenuti pertinenti, inclusa la pubblicità pertinente. Per continuare senza accettare questi cookie, fai clic su \"Continua\" o \"Rifiuta\". Per effettuare scelte più dettagliate o saperne di più, fai clic su \"Personalizza\".

GetRole

Modalità Focus
GetRole - AWS Identity and Access Management
Questa pagina non è tradotta nella tua lingua. Richiedi traduzione

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.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

RoleName

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\w+=,.@-]+

Required: Yes

Response Elements

The following element is returned by the service.

Role

A structure containing details about the IAM role.

Type: Role object

Errors

For information about the errors that are common to all actions, see Common Errors.

NoSuchEntity

The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

HTTP Status Code: 404

ServiceFailure

The request processing has failed because of an unknown error, exception or failure.

HTTP Status Code: 500

Examples

Example

This example illustrates one usage of GetRole.

Sample Request

https://iam.amazonaws.com/?Action=GetRole &RoleName=S3Access &Version=2010-05-08 &AUTHPARAMS

Sample Response

<GetRoleResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <GetRoleResult> <Role> <Path>/application_abc/component_xyz/</Path> <Arn>arn:aws:iam::123456789012:role/application_abc/component_xyz/S3Access</Arn> <RoleName>S3Access</RoleName> <AssumeRolePolicyDocument> {"Version":"2012-10-17","Statement":[{"Effect":"Allow", "Principal":{"Service":["ec2.amazonaws.com"]},"Action":["sts:AssumeRole"]}]} </AssumeRolePolicyDocument> <CreateDate>2012-05-08T23:34:01Z</CreateDate> <RoleId>AROADBQP57FF2AEXAMPLE</RoleId> <RoleLastUsed> <LastUsedDate>2019-11-20T17:09:20Z</LastUsedDate> <Region>us-east-1</Region> </RoleLastUsed> </Role> </GetRoleResult> <ResponseMetadata> <RequestId>df37e965-9967-11e1-a4c3-270EXAMPLE04</RequestId> </ResponseMetadata> </GetRoleResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

Argomento successivo:

GetRolePolicy

Argomento precedente:

GetPolicyVersion

In questa pagina

PrivacyCondizioni del sitoPreferenze cookie
© 2025, Amazon Web Services, Inc. o società affiliate. Tutti i diritti riservati.