mirror of https://github.com/apache/nifi.git
NIFI-12766 Fixed Region handling for AWS Assume Role Credentials
This closes #8382 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
6243d00158
commit
9ba68edb5f
|
@ -178,12 +178,13 @@ public class AssumeRoleCredentialsStrategy extends AbstractCredentialsStrategy {
|
||||||
|
|
||||||
AWSSecurityTokenServiceClientBuilder securityTokenServiceBuilder = AWSSecurityTokenServiceClient.builder()
|
AWSSecurityTokenServiceClientBuilder securityTokenServiceBuilder = AWSSecurityTokenServiceClient.builder()
|
||||||
.withCredentials(primaryCredentialsProvider)
|
.withCredentials(primaryCredentialsProvider)
|
||||||
.withRegion(assumeRoleSTSRegion)
|
|
||||||
.withClientConfiguration(config);
|
.withClientConfiguration(config);
|
||||||
|
|
||||||
if (assumeRoleSTSEndpoint != null && !assumeRoleSTSEndpoint.isEmpty()) {
|
if (assumeRoleSTSEndpoint != null && !assumeRoleSTSEndpoint.isEmpty()) {
|
||||||
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(assumeRoleSTSEndpoint, assumeRoleSTSRegion);
|
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(assumeRoleSTSEndpoint, assumeRoleSTSRegion);
|
||||||
securityTokenServiceBuilder.withEndpointConfiguration(endpointConfiguration);
|
securityTokenServiceBuilder.withEndpointConfiguration(endpointConfiguration);
|
||||||
|
} else {
|
||||||
|
securityTokenServiceBuilder.withRegion(assumeRoleSTSRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
STSAssumeRoleSessionCredentialsProvider.Builder builder = new STSAssumeRoleSessionCredentialsProvider.Builder(assumeRoleArn, assumeRoleName)
|
STSAssumeRoleSessionCredentialsProvider.Builder builder = new STSAssumeRoleSessionCredentialsProvider.Builder(assumeRoleArn, assumeRoleName)
|
||||||
|
|
Loading…
Reference in New Issue