Github user ktseytlin commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1112#discussion_r82450516
  
    --- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/credentials/provider/factory/strategies/AssumeRoleCredentialsStrategy.java
 ---
    @@ -113,16 +134,34 @@ public AWSCredentialsProvider 
getDerivedCredentialsProvider(Map<PropertyDescript
             rawMaxSessionTime = (rawMaxSessionTime != null) ? 
rawMaxSessionTime : MAX_SESSION_TIME.getDefaultValue();
             final Integer maxSessionTime = 
Integer.parseInt(rawMaxSessionTime.trim());
             final String assumeRoleExternalId = 
properties.get(ASSUME_ROLE_EXTERNAL_ID);
    +        STSAssumeRoleSessionCredentialsProvider.Builder builder;
    +
    +        // If proxy variables are set, then create Client Configuration 
with those values
    +        if (proxyVariablesValidForAssumeRole(properties)) {
    +            final String assumeRoleProxyHost = 
properties.get(ASSUME_ROLE_PROXY_HOST);
    +            final Integer assumeRoleProxyPort = 
Integer.parseInt(properties.get(ASSUME_ROLE_PROXY_PORT));
    +            ClientConfiguration config = new ClientConfiguration();
    +            config.withProxyHost(assumeRoleProxyHost);
    +            config.withProxyPort(assumeRoleProxyPort);
    +            AWSSecurityTokenService securityTokenService = new 
AWSSecurityTokenServiceClient(config);
    --- End diff --
    
    The only change I made to a new build was to add 
`.withLongLivedCredentialsProvider(primaryCredentialsProvider);`. I just built 
it again, and now I get this error:
    
    ```
    14:56:49 EDTERRORa07a8653-0157-1000-cc2a-541216293b68
    AWSCredentialsProviderService[id=a07a8653-0157-1000-cc2a-541216293b68] 
Failed to invoke @OnEnabled method due to java.lang.IllegalArgumentException: 
**If a custom STS client is set you must not set any other client related 
fields (ClientConfiguration, AWSCredentials, Endpoint, etc**
    14:57:00 EDTERRORa0772af8-0157-1000-f3dd-9c8fb7f22bd7
    FetchS3Object[id=a0772af8-0157-1000-f3dd-9c8fb7f22bd7] 
FetchS3Object[id=a0772af8-0157-1000-f3dd-9c8fb7f22bd7] failed to invoke 
@OnScheduled method due to java.lang.RuntimeException: Failed while executing 
one of processor's OnScheduled task.; processor will not be scheduled to run 
for 30 seconds: java.lang.RuntimeException: Failed while executing one of 
processor's OnScheduled task.
    ```
    
    See the part I surround in **, this here makes me believe that I cannot use 
the LongLivedCredentialsProvider.


---
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.
---

Reply via email to