Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions awss3-storage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ dependencies {

implementation "com.amazonaws:aws-java-sdk-s3:${revAwsSdk}"
implementation "org.apache.commons:commons-lang3"
implementation 'software.amazon.awssdk:s3:2.20.146'
implementation 'software.amazon.awssdk:sts:2.20.146'
implementation 'com.amazonaws:aws-java-sdk-sts:1.12.782'
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.netflix.conductor.core.utils.IDGenerator;
import com.netflix.conductor.s3.storage.S3PayloadStorage;

import com.amazonaws.auth.WebIdentityTokenCredentialsProvider;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;

Expand All @@ -41,6 +42,11 @@ public ExternalPayloadStorage s3ExternalPayloadStorage(
matchIfMissing = true)
@Bean
public AmazonS3 amazonS3(S3Properties properties) {
if (properties.getWebIdentity()) {
return AmazonS3ClientBuilder.standard()
.withCredentials(WebIdentityTokenCredentialsProvider.builder().build())
.build();
}
return AmazonS3ClientBuilder.standard().withRegion(properties.getRegion()).build();
// TODO: Add localstack support to test locally
// return AmazonS3ClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class S3Properties {
/** The s3 bucket name where the payloads will be stored */
private String bucketName = "conductor_payloads";

private Boolean webIdentity = false;

/** The time (in seconds) for which the signed url will be valid */
@DurationUnit(ChronoUnit.SECONDS)
private Duration signedUrlExpirationDuration = Duration.ofSeconds(5);
Expand Down Expand Up @@ -55,6 +57,9 @@ public void setRegion(String region) {
this.region = region;
}

public Boolean getWebIdentity() {
return webIdentity;
}
// TODO: Add localstack support to test locally
// private String endpoint = "http://s3.localhost.localstack.cloud:4566";
//
Expand Down