public class AmazonCredentials extends Object
| Constructor and Description |
|---|
AmazonCredentials(String accessKey,
String secretKey,
String sessionToken) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessKey() |
static AmazonCredentials |
getDefault()
Returns the default AWS credentials, fetched from the following sources in order:
The environment variables AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY),
AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY) and AWS_SESSION_TOKEN
The ECS container credentials service (ECS, EKS, Greengrass, Fargate)
The EC2 instance metadata service (IMDSv2)
|
String |
getSecretKey() |
String |
getSessionToken() |
static AmazonCredentials |
parse(String credentials)
Parses the concatenated AWS credentials
|
public AmazonCredentials(String accessKey, String secretKey, String sessionToken)
public String getAccessKey()
public static AmazonCredentials getDefault() throws IOException
IOExceptionpublic String getSecretKey()
public String getSessionToken()
public static AmazonCredentials parse(String credentials) throws IllegalArgumentException
credentials - accessKey|secretKey|sessionToken (the session token is optional)IllegalArgumentExceptionCopyright © 2012–2025. All rights reserved.