List of usage examples for com.amazonaws.auth STSAssumeRoleSessionCredentialsProvider STSAssumeRoleSessionCredentialsProvider
@Deprecated
public STSAssumeRoleSessionCredentialsProvider(String roleArn, String roleSessionName)
From source file:com.netflix.genie.web.configs.aws.AwsS3Config.java
License:Apache License
/** * Assume role credentials provider which will be used to fetch session credentials. * * @param roleArn Arn of the IAM role//from ww w .j a v a 2 s .c om * @return Credentials provider to ask the credentials from */ @Bean @ConditionalOnProperty(value = "genie.aws.credentials.role") public STSAssumeRoleSessionCredentialsProvider awsCredentialsProvider( @Value("${genie.aws.credentials.role}") final String roleArn) { log.info("Creating STS Assume Role Session Credentials provider bean"); return new STSAssumeRoleSessionCredentialsProvider(roleArn, "Genie"); }
From source file:org.zalando.stups.fullstop.aws.CachingClientProvider.java
License:Apache License
@PostConstruct public void init() { // TODO//from ww w .j a v a 2s . c o m // this parameters have to be configurable cache = CacheBuilder.newBuilder().maximumSize(500).expireAfterWrite(50, TimeUnit.MINUTES) .build(new CacheLoader<Key<?>, Object>() { private final Logger logger = LoggerFactory.getLogger(CacheLoader.class); @Override public Object load(final Key<?> key) throws Exception { logger.debug("CacheLoader active for Key : {}", key); Object client = key.region.createClient(key.type, new STSAssumeRoleSessionCredentialsProvider(buildRoleArn(key.accountId), ROLE_SESSION_NAME), null); return client; } }); }