use of software.amazon.awssdk.services.sts.model.GetCallerIdentityResponse in project aws-doc-sdk-examples by awsdocs.
the class GetCallerIdentity method getCallerId.
// snippet-start:[sts.java2.get_call_id.main]
public static void getCallerId(StsClient stsClient) {
try {
GetCallerIdentityResponse response = stsClient.getCallerIdentity();
System.out.println("The user id is" + response.userId());
System.out.println("The ARN value is" + response.arn());
} catch (StsException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations