Closed crosleyj closed 4 years ago
Hi crosleyj, I think using DefaultAWSCredentialsProviderChain works for the credentials. It's only the parameter SERVICE_REGION that needs to be provided as environment or system variable. Would that work for your use case? Best regards, Florian
@floschmedding can we add AWS_REGION as well instead of just looking for SERVICE_REGION, in Lambda AWS_REGION is pre-populated
SERVICE_REGION worked for me, but I am indeed using Lambda so AWS_REGION would be nice to have too
Thanks for the updates and the feedback! We track usage of AWS_REGION in https://github.com/aws/amazon-neptune-gremlin-java-sigv4/issues/23, so I'm closing this issue.
I want to use the DefaultAWSCredentialsProviderChain to call Neptune, but this appears to be impossible because during the construction the credentials provider the credentials are required in the environment or system variables.
The AwsSigV4ClientHandshaker uses the DefaultAWSCredentialsProviderChain here: https://github.com/aws/amazon-neptune-gremlin-java-sigv4/blob/953c407235c687cd6705834708f8022b527c1b64/src/main/java/com/amazon/neptune/gremlin/driver/sigv4/AwsSigV4ClientHandshaker.java#L89
However, during the construction of the AwsSigV4ClientHandshaker (here: https://github.com/aws/amazon-neptune-gremlin-java-sigv4/blob/953c407235c687cd6705834708f8022b527c1b64/src/main/java/org/apache/tinkerpop/gremlin/driver/SigV4WebSocketChannelizer.java#L204) the ChainedSigV4PropertiesProvider is constructed, and the constructor (here: https://github.com/aws/amazon-neptune-gremlin-java-sigv4/blob/master/src/main/java/com/amazon/neptune/gremlin/driver/sigv4/ChainedSigV4PropertiesProvider.java#L42) tries to fetch the credentials only from the system or environment variables, which means these would be required to be set.