Example usage for com.amazonaws.services.securitytoken AWSSecurityTokenService getCallerIdentity

List of usage examples for com.amazonaws.services.securitytoken AWSSecurityTokenService getCallerIdentity

Introduction

In this page you can find the example usage for com.amazonaws.services.securitytoken AWSSecurityTokenService getCallerIdentity.

Prototype

GetCallerIdentityResult getCallerIdentity(GetCallerIdentityRequest getCallerIdentityRequest);

Source Link

Document

Returns details about the IAM user or role whose credentials are used to call the operation.

Usage

From source file:jp.classmethod.aws.gradle.AwsPluginExtension.java

License:Apache License

public String getAccountId() {
    AWSSecurityTokenService sts = createClient(AWSSecurityTokenServiceClient.class, profileName);
    return sts.getCallerIdentity(new GetCallerIdentityRequest()).getAccount();
}

From source file:jp.classmethod.aws.gradle.AwsPluginExtension.java

License:Apache License

public String getUserArn() {
    AWSSecurityTokenService sts = createClient(AWSSecurityTokenServiceClient.class, profileName);
    return sts.getCallerIdentity(new GetCallerIdentityRequest()).getArn();
}