Skip to content

S3 integration using IAM key and secret works with AWS .NET libraries but fails with AWS Java 2 libraries. What am I missing here? #3127

Answered by ymeric
ymeric asked this question in Q&A
Discussion options

You must be logged in to vote

Turns out my debugging setup was incomplete. Here is how I resolved the issue:

  1. Provided the AWS IAM key and secret as VM arguments in the debug configuration of the Eclipse UI:

-Dspring.profiles.active=local -Daws.region={myRegion} -Daws.accessKeyId={IAMKey} -Daws.secretAccessKey={IAMSecret}

  1. Set the role ARN as an application.properties setting.
  2. Updated my factory as follows. The refreshToken() method is for refreshing the token before it expires, if needed.

import java.util.UUID;

import javax.annotation.PostConstruct;

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.somepackage.IAWSFac…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ymeric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant