-
Notifications
You must be signed in to change notification settings - Fork 3.8k
S3 ingestion can assume role #10995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 ingestion can assume role #10995
Changes from all commits
4302300
1377be9
62f1177
c722ffa
05c60be
4ebf4fc
a599118
c54848c
0bcd4ca
5cd40b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,8 +115,8 @@ | |
| <dependency> | ||
| <groupId>com.amazonaws</groupId> | ||
| <artifactId>aws-java-sdk-sts</artifactId> | ||
| <scope>provided</scope> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| </dependency> | ||
| <version>${aws.sdk.version}</version> | ||
| </dependency> | ||
| <!-- Tests --> | ||
| <dependency> | ||
| <groupId>org.apache.druid</groupId> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,30 +34,50 @@ | |
| */ | ||
| public class S3InputSourceConfig | ||
| { | ||
| @JsonProperty | ||
| private String assumeRoleArn; | ||
| @JsonProperty | ||
| private String assumeRoleExternalId; | ||
| @JsonProperty | ||
| private PasswordProvider accessKeyId; | ||
| @JsonProperty | ||
| private PasswordProvider secretAccessKey; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. accessKeyId and SecretAccessKey are also nullable, Can we add annotation these as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added. |
||
|
|
||
| @JsonCreator | ||
| public S3InputSourceConfig( | ||
| @JsonProperty("accessKeyId") @Nullable PasswordProvider accessKeyId, | ||
| @JsonProperty("secretAccessKey") @Nullable PasswordProvider secretAccessKey | ||
| @JsonProperty("secretAccessKey") @Nullable PasswordProvider secretAccessKey, | ||
| @JsonProperty("assumeRoleArn") @Nullable String assumeRoleArn, | ||
| @JsonProperty("assumeRoleExternalId") @Nullable String assumeRoleExternalId | ||
| ) | ||
| { | ||
| this.assumeRoleArn = assumeRoleArn; | ||
| this.assumeRoleExternalId = assumeRoleExternalId; | ||
| if (accessKeyId != null || secretAccessKey != null) { | ||
| this.accessKeyId = Preconditions.checkNotNull(accessKeyId, "accessKeyId cannot be null if secretAccessKey is given"); | ||
| this.secretAccessKey = Preconditions.checkNotNull(secretAccessKey, "secretAccessKey cannot be null if accessKeyId is given"); | ||
| } | ||
| } | ||
|
|
||
| @JsonProperty | ||
| private PasswordProvider accessKeyId; | ||
|
|
||
| @JsonProperty | ||
| private PasswordProvider secretAccessKey; | ||
| @Nullable | ||
| public String getAssumeRoleArn() | ||
| { | ||
| return assumeRoleArn; | ||
| } | ||
|
|
||
| @Nullable | ||
| public String getAssumeRoleExternalId() | ||
| { | ||
| return assumeRoleExternalId; | ||
| } | ||
|
|
||
| @Nullable | ||
| public PasswordProvider getAccessKeyId() | ||
| { | ||
| return accessKeyId; | ||
| } | ||
|
|
||
| @Nullable | ||
| public PasswordProvider getSecretAccessKey() | ||
| { | ||
| return secretAccessKey; | ||
|
|
@@ -76,6 +96,8 @@ public String toString() | |
| return "S3InputSourceConfig{" + | ||
| "accessKeyId=" + accessKeyId + | ||
| ", secretAccessKey=" + secretAccessKey + | ||
| ", assumeRoleArn=" + assumeRoleArn + | ||
| ", assumeRoleExternalId=" + assumeRoleExternalId + | ||
| '}'; | ||
| } | ||
|
|
||
|
|
@@ -90,12 +112,14 @@ public boolean equals(Object o) | |
| } | ||
| S3InputSourceConfig that = (S3InputSourceConfig) o; | ||
| return Objects.equals(accessKeyId, that.accessKeyId) && | ||
| Objects.equals(secretAccessKey, that.secretAccessKey); | ||
| Objects.equals(secretAccessKey, that.secretAccessKey) && | ||
| Objects.equals(assumeRoleArn, that.assumeRoleArn) && | ||
| Objects.equals(assumeRoleExternalId, that.assumeRoleExternalId); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() | ||
| { | ||
| return Objects.hash(accessKeyId, secretAccessKey); | ||
| return Objects.hash(accessKeyId, secretAccessKey, assumeRoleArn, assumeRoleExternalId); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe above are some dummy IDs and roles and not some actual ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. All fake.