@Override public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) { String profileName = properties.get(CredentialPropertyDescriptors.PROFILE_NAME); return new ProfileCredentialsProvider(profileName); }
@Bean public ProfileCredentialsProvider profileCredentialsProvider() { return new ProfileCredentialsProvider(CREDENTIALS_PROFILE_NAME); }
private static LinkedList<AWSCredentialsProvider> chain() { LinkedList<AWSCredentialsProvider> chain = new LinkedList<>(); chain.add(new EnvironmentVariableCredentialsProvider()); chain.add(new SystemPropertiesCredentialsProvider()); chain.add(new ProfileCredentialsProvider()); chain.add(new EC2ContainerCredentialsProviderWrapper()); return chain; }
public DefaultAWSCredentialsProviderChain() { super(new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ProfileCredentialsProvider(), new EC2ContainerCredentialsProviderWrapper()); }
public CredentialsProviderChain () { super(new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ClasspathPropertiesFileCredentialsProvider(), new InstanceProfileCredentialsProvider(), new ProfileCredentialsProvider()); } }
public PointSetDatastore(Integer maxCacheSize, String s3CredentialsFilename, Boolean workOffline, String pointsetBucket){ super(); // allow the data store to work offline with cached data and skip S3 connection this.workOffline = workOffline; this.pointsetBucket = pointsetBucket; if(!this.workOffline) { if (s3CredentialsFilename != null) { AWSCredentials creds = new ProfileCredentialsProvider(s3CredentialsFilename, "default").getCredentials(); s3 = new AmazonS3Client(creds); } else { // default credentials providers, e.g. IAM role s3 = new AmazonS3Client(); } } // set up the cache this.pointSets = CacheBuilder.newBuilder() .maximumSize(maxCacheSize) .build(new S3PointSetLoader(workOffline, s3, pointsetBucket)); }
public ClusterGraphService(String s3CredentialsFilename, Boolean workOffline, String bucket) { if(!workOffline) { if (s3CredentialsFilename != null) { AWSCredentials creds = new ProfileCredentialsProvider(s3CredentialsFilename, "default").getCredentials(); s3 = new AmazonS3Client(creds); } else { // This will first check for credentials in environment variables or ~/.aws/credentials // then fall back on S3 credentials propagated to EC2 instances via IAM roles. s3 = new AmazonS3Client(); } this.graphBucket = bucket; } this.workOffline = workOffline; }
public static AWSCredentialsProviderChain defaultAWSCredentialsProviderChain(final AWSCredentialsConfig config) { return new AWSCredentialsProviderChain( new ConfigDrivenAwsCredentialsConfigProvider(config), new LazyFileSessionCredentialsProvider(config), new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ProfileCredentialsProvider(), new InstanceProfileCredentialsProvider()); } }
DefaultAWSCredentialsProviderChain(Config config) { super(new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ConfigurationCredentialsProvider(config), new ProfileCredentialsProvider(), new InstanceProfileCredentialsProvider()); } }
/** * Constructor. * @param clientConfiguration clientConfiguration * @param environment environment */ public AWSLambdaConfiguration(AWSClientConfiguration clientConfiguration, Environment environment) { this.clientConfiguration = clientConfiguration; this.builder.setCredentials(new AWSCredentialsProviderChain( new EnvironmentAWSCredentialsProvider(environment), new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ProfileCredentialsProvider(), new EC2ContainerCredentialsProviderWrapper() )); }
new ProfileCredentialsProvider(); try { credentialsProvider.getCredentials();
.withCredentials(new ProfileCredentialsProvider()) .withRegion(region) .build();
public DefaultAWSCredentialsProviderChain() { super(new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new ProfileCredentialsProvider(), new EC2ContainerCredentialsProviderWrapper()); }
amazonS3ClientBuilder.withCredentials(new ProfileCredentialsProvider(profileName));
AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider()); S3Object object = s3Client.getObject(new GetObjectRequest(bucketName, key)); InputStream objectData = object.getObjectContent(); // Process the objectData stream. objectData.close();
AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider()); S3Object object = s3Client.getObject( new GetObjectRequest(bucketName, key)); InputStream objectData = object.getObjectContent(); // Process the objectData stream. objectData.close();
private static LinkedList<AWSCredentialsProvider> chain() { LinkedList<AWSCredentialsProvider> chain = new LinkedList<>(); chain.add(new EnvironmentVariableCredentialsProvider()); chain.add(new SystemPropertiesCredentialsProvider()); chain.add(new ProfileCredentialsProvider()); chain.add(new EC2ContainerCredentialsProviderWrapper()); return chain; }
public static DynamoDB getDynamoDBConnection() throws ApplicationSpecificException { try { return new DynamoDB(new AmazonDynamoDBClient( new ProfileCredentialsProvider())); } catch(AmazonServiceException ase) { slf4jLogger.error(ase.getMessage()); slf4jLogger.error(ase.getStackTrace()); slf4jLogger.error(ase); throw new ApplicationSpecificException("some good message", ase); } }
private static AWSCredentialsProvider handleProfile(EnvVars vars) { String profile = vars.get(AWS_PROFILE, vars.get(AWS_DEFAULT_PROFILE)); if (profile != null) { return new ProfileCredentialsProvider(profile); } return null; }
AuthenticationInfoAWSCredentialsProviderChain(AuthenticationInfo authenticationInfo) { super( new InstanceProfileCredentialsProvider(), new ProfileCredentialsProvider(), new EnvironmentVariableCredentialsProvider(), new SystemPropertiesCredentialsProvider(), new InstanceProfileCredentialsProvider()); } }