Github user brkyvz commented on a diff in the pull request:
https://github.com/apache/spark/pull/17250#discussion_r107295179
--- Diff:
external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/SerializableCredentialsProvider.scala
---
@@ -83,3 +84,146 @@ private[kinesis] final case class
STSCredentialsProvider(
}
}
}
+
[email protected]
+object SerializableCredentialsProvider {
+ /**
+ * Builder for [[SerializableCredentialsProvider]] instances.
+ *
+ * @since 2.2.0
+ */
+ @InterfaceStability.Stable
+ class Builder {
+ private var awsAccessKeyId: Option[String] = None
+ private var awsSecretKey: Option[String] = None
+ private var stsRoleArn: Option[String] = None
+ private var stsSessionName: Option[String] = None
+ private var stsExternalId: Option[String] = None
+
+
+ /**
+ * Sets the AWS access key ID when using a basic AWS keypair for
long-lived authorization
+ * credentials. A value must also be provided for the AWS secret key.
+ *
+ * @param accessKeyId AWS access key ID
+ * @return Reference to this
[[SerializableCredentialsProvider.Builder]]
+ */
+ def awsAccessKeyId(accessKeyId: String): Builder = {
+ awsAccessKeyId = Option(accessKeyId)
+ this
+ }
+
+ /**
+ * Sets the AWS secret key when using a basic AWS keypair for
long-lived authorization
+ * credentials. A value must also be provided for the AWS access key
ID.
+ *
+ * @param secretKey AWS secret key
+ * @return Reference to this
[[SerializableCredentialsProvider.Builder]]
+ */
+ def awsSecretKey(secretKey: String): Builder = {
+ awsSecretKey = Option(secretKey)
+ this
+ }
+
+ /**
+ * Sets the ARN of the IAM role to assume when using AWS STS for
temporary session-based
+ * authentication. A value must also be provided for the STS session
name.
+ *
+ * @param roleArn ARN of IAM role to assume via STS
+ * @return Reference to this
[[SerializableCredentialsProvider.Builder]]
+ */
+ def stsRoleArn(roleArn: String): Builder = {
--- End diff --
same here:
```scala
def withSts(roleArn: String, sessionName: String)
def withSts(roleArn: String, sessionName: String, externalId: String)
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]