public final class AwsCredentials extends Base
SnsDestination and SqsDestination.
It allows the retrieval of the aws credentials from environment variables ofEnv(String, String) and
from the standard aws cli environment variables ofAwsCliEnv().| Modifier and Type | Field and Description |
|---|---|
static String |
AWS_ACCESS_KEY_ID_ENV
Constant to retrieve
accessKey from the standard AWS CLI environment variable. |
static String |
AWS_SECRET_ACCESS_KEY_ENV
Constant to retrieve
accessSecret from the standard AWS CLI environment variable. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessKey() |
String |
getAccessSecret() |
static AwsCredentials |
of(String accessKey,
String accessSecret) |
static AwsCredentials |
ofAwsCliEnv()
Creates the aws credentials based on the environment variable names used by the AWS CLI.
|
static AwsCredentials |
ofEnv(String accessKeyEnv,
String accessSecretEnv)
Creates the aws credentials based on the environment variable names given as parameters.
|
public static final String AWS_ACCESS_KEY_ID_ENV
accessKey from the standard AWS CLI environment variable.public static final String AWS_SECRET_ACCESS_KEY_ENV
accessSecret from the standard AWS CLI environment variable.public String getAccessKey()
public String getAccessSecret()
public static AwsCredentials ofEnv(String accessKeyEnv, String accessSecretEnv)
accessKeyEnv - the name of the environment variable to retrieve getAccessKey()accessSecretEnv - the name of the environment variable to retrieve getAccessSecret()System.getenv(String)public static AwsCredentials ofAwsCliEnv()
System.getenv(String)AWS_ACCESS_KEY_ID_ENV,
AWS_SECRET_ACCESS_KEY_ENV,
public static AwsCredentials of(String accessKey, String accessSecret)