mirror of https://github.com/apache/nifi.git
NIFI-3851 Support EL in AWS Endpoint Override URL
Add expression language support to AWS Endpoint Override URL property Signed-off-by: James Wing <jvwing@gmail.com> This closes #1769.
This commit is contained in:
parent
72de1cbdef
commit
361a58c531
|
@ -117,6 +117,7 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
|
|||
.description("Endpoint URL to use instead of the AWS default including scheme, host, port, and path. " +
|
||||
"The AWS libraries select an endpoint URL based on the AWS region, but this property overrides " +
|
||||
"the selected endpoint URL, allowing use with other S3-compatible endpoints.")
|
||||
.expressionLanguageSupported(true)
|
||||
.required(false)
|
||||
.addValidator(StandardValidators.URL_VALIDATOR)
|
||||
.build();
|
||||
|
@ -220,11 +221,12 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
|
|||
|
||||
// if the endpoint override has been configured, set the endpoint.
|
||||
// (per Amazon docs this should only be configured at client creation)
|
||||
final String urlstr = StringUtils.trimToEmpty(context.getProperty(ENDPOINT_OVERRIDE).getValue());
|
||||
if (!urlstr.isEmpty()) {
|
||||
this.client.setEndpoint(urlstr);
|
||||
if (getSupportedPropertyDescriptors().contains(ENDPOINT_OVERRIDE)) {
|
||||
final String urlstr = StringUtils.trimToEmpty(context.getProperty(ENDPOINT_OVERRIDE).evaluateAttributeExpressions().getValue());
|
||||
if (!urlstr.isEmpty()) {
|
||||
this.client.setEndpoint(urlstr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -143,7 +143,7 @@ public abstract class AbstractS3Processor extends AbstractAWSCredentialsProvider
|
|||
|
||||
private void initalizeEndpointOverride(final ProcessContext context, final AmazonS3Client s3) {
|
||||
// if ENDPOINT_OVERRIDE is set, use PathStyleAccess
|
||||
if(StringUtils.trimToEmpty(context.getProperty(ENDPOINT_OVERRIDE).getValue()).isEmpty() == false){
|
||||
if(StringUtils.trimToEmpty(context.getProperty(ENDPOINT_OVERRIDE).evaluateAttributeExpressions().getValue()).isEmpty() == false){
|
||||
final S3ClientOptions s3Options = new S3ClientOptions();
|
||||
s3Options.setPathStyleAccess(true);
|
||||
s3.setS3ClientOptions(s3Options);
|
||||
|
|
Loading…
Reference in New Issue