List of usage examples for com.amazonaws.auth STSAssumeRoleSessionCredentialsProvider STSAssumeRoleSessionCredentialsProvider
@Deprecated
public STSAssumeRoleSessionCredentialsProvider(AWSCredentialsProvider longLivedCredentialsProvider,
String roleArn, String roleSessionName, ClientConfiguration clientConfiguration)
From source file:lumbermill.internal.aws.KinesisClientFactory.java
License:Apache License
private AWSCredentialsProvider getAwsCredentialsProvider(MapWrap configuration, ClientConfiguration awsConfig) { AWSCredentialsProvider credentials = new DefaultAWSCredentialsProviderChain(); Optional<String> roleArn = configuration.exists("role_arn") ? Optional.of(configuration.asString("role_arn")) : Optional.empty();//w ww. j a v a 2 s. c o m if (roleArn.isPresent()) { credentials = new STSAssumeRoleSessionCredentialsProvider(credentials, roleArn.get(), "lumbermill", awsConfig); } return credentials; }
From source file:lumbermill.internal.aws.S3ClientImpl.java
License:Apache License
public void init() { ClientConfiguration awsConfig = new ClientConfiguration(); if (System.getenv("https_proxy") != null) { URI proxy = URI.create(System.getenv("https_proxy")); awsConfig.setProxyHost(proxy.getHost()); awsConfig.setProxyPort(proxy.getPort()); }//w ww .j a v a 2s.c o m //awsConfig.setConnectionTimeout(2000); //awsConfig.setRequestTimeout(2000); //awsConfig.setSocketTimeout(2000); //awsConfig.setClientExecutionTimeout(2000); AWSCredentialsProvider credentials = new DefaultAWSCredentialsProviderChain(); if (roleArn.isPresent()) { credentials = new STSAssumeRoleSessionCredentialsProvider(credentials, roleArn.get(), "lumbermills3", awsConfig); } s3Client = new AmazonS3Client(credentials, awsConfig); }