In using an InstanceProfile with DynamoDBMapper and an S3Link after a few hours I'm seeing:
! com.amazonaws.services.s3.model.AmazonS3Exception: The provided token has expired. (Service: Amazon S3; Status Code: 400; Error Code: ExpiredToken; Request ID: BE70A766F0ED13AE)
It appears that this is due to the S3ClientCache which upon initialization it calls s3CredentialsProvider.getCredentials() from the InstanceProfileCredentialsProvider, so after a few hours these credentials become expired. It seems that the S3ClientCache should be using the provider and calling getCredentials when it absolutely needs to so that the InstanceProfileCredentialsProvider will refresh the expired tokens.. Or perhaps I'm misunderstanding or doing something wrong?
See:
|
this.s3cc = new S3ClientCache(s3CredentialsProvider.getCredentials()); |
In using an InstanceProfile with DynamoDBMapper and an S3Link after a few hours I'm seeing:
! com.amazonaws.services.s3.model.AmazonS3Exception: The provided token has expired. (Service: Amazon S3; Status Code: 400; Error Code: ExpiredToken; Request ID: BE70A766F0ED13AE)
It appears that this is due to the S3ClientCache which upon initialization it calls s3CredentialsProvider.getCredentials() from the InstanceProfileCredentialsProvider, so after a few hours these credentials become expired. It seems that the S3ClientCache should be using the provider and calling getCredentials when it absolutely needs to so that the InstanceProfileCredentialsProvider will refresh the expired tokens.. Or perhaps I'm misunderstanding or doing something wrong?
See:
aws-sdk-java/aws-java-sdk/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
Line 335 in 8d1cf00