public static class SparkAWSCredentials.Builder
extends Object
SparkAWSCredentials instances.
 | Constructor and Description | 
|---|
Builder()  | 
| Modifier and Type | Method and Description | 
|---|---|
SparkAWSCredentials.Builder | 
basicCredentials(String accessKeyId,
                String secretKey)
Use a basic AWS keypair for long-lived authorization. 
 | 
SparkAWSCredentials | 
build()
Returns the appropriate instance of  
SparkAWSCredentials given the configured
 parameters. | 
SparkAWSCredentials.Builder | 
stsCredentials(String roleArn,
              String sessionName)
Use STS to assume an IAM role for temporary session-based authentication. 
 | 
SparkAWSCredentials.Builder | 
stsCredentials(String roleArn,
              String sessionName,
              String externalId)
Use STS to assume an IAM role for temporary session-based authentication. 
 | 
public SparkAWSCredentials.Builder basicCredentials(String accessKeyId, String secretKey)
accessKeyId - AWS access key IDsecretKey - AWS secret keySparkAWSCredentials.Builderpublic SparkAWSCredentials build()
SparkAWSCredentials given the configured
 parameters.
 
 - The long-lived credentials will either be DefaultCredentials or BasicCredentials
   if they were provided.
 
- If STS credentials were provided, the configured long-lived credentials will be added to them and the result will be returned.
- The long-lived credentials will be returned otherwise.
SparkAWSCredentials to use for configured parameterspublic SparkAWSCredentials.Builder stsCredentials(String roleArn, String sessionName)
roleArn - ARN of IAM role to assume via STSsessionName - Name to use for the STS sessionSparkAWSCredentials.Builderpublic SparkAWSCredentials.Builder stsCredentials(String roleArn, String sessionName, String externalId)
roleArn - ARN of IAM role to assume via STSsessionName - Name to use for the STS sessionexternalId - External ID to validate against assumed IAM role's trust policySparkAWSCredentials.Builder