/** * Used for testing purposes only. */ S3CryptoModuleAE(AWSKMS kms, S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(kms, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
/** * Used for testing purposes only. */ S3CryptoModuleAE(S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(null, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); } /**
/** * Used for testing purposes only. */ S3CryptoModuleEO(AWSKMS kms, S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(kms, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
/** * Used for testing purposes only. */ S3CryptoModuleEO(S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(null, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
public DefaultS3CredentialsProviderImpl() { this(new DefaultAWSCredentialsProviderChain()); }
@Override public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) { return new DefaultAWSCredentialsProviderChain(); }
@Override public AWSCredentialsProvider getCredentialsProvider(Map<PropertyDescriptor, String> properties) { return new DefaultAWSCredentialsProviderChain(); }
/** * Constructs a new <code>TransferManager</code> and Amazon S3 client using * the credentials from <code>DefaultAWSCredentialsProviderChain</code> * <p> * <code>TransferManager</code> and client objects may pool connections and * threads. Reuse <code>TransferManager</code> and client objects and share * them throughout applications. * <p> * TransferManager and all AWS client objects are thread safe. * @deprecated use {@link TransferManagerBuilder#defaultTransferManager()} */ @Deprecated public TransferManager(){ this(new AmazonS3Client(new DefaultAWSCredentialsProviderChain())); }
/** * Get the AWSCredentials. If an AWSCredentialProvider was specified, use that, otherwise, * create a new AWSCredentialsProvider. If the username and password are provided, then * use those directly as AWSCredentials. Otherwise us the {@link DefaultAWSCredentialsProviderChain} * as is standard with AWS applications. * @return the AWS credentials. */ private AWSCredentials retrieveAwsCredentials() { if (awsCredentialProvider == null) { if (username != null && password != null) { logger.debug("Creating a static AWSCredentialsProvider"); awsCredentialProvider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(username, password)); } else { logger.debug("Creating a default AWSCredentialsProvider"); awsCredentialProvider = new DefaultAWSCredentialsProviderChain(); } } return awsCredentialProvider.getCredentials(); }
/** * @param conf the configuration for this UFS * * @return the created {@link AWSCredentialsProvider} instance */ public static AWSCredentialsProvider createAwsCredentialsProvider( UnderFileSystemConfiguration conf) { // Set the aws credential system properties based on Alluxio properties, if they are set; // otherwise, use the default credential provider. if (conf.isSet(PropertyKey.S3A_ACCESS_KEY) && conf.isSet(PropertyKey.S3A_SECRET_KEY)) { return new AWSStaticCredentialsProvider(new BasicAWSCredentials( conf.get(PropertyKey.S3A_ACCESS_KEY), conf.get(PropertyKey.S3A_SECRET_KEY))); } // Checks, in order, env variables, system properties, profile file, and instance profile. return new DefaultAWSCredentialsProviderChain(); }
/** * @param accessKey * @param secretKey * @return */ public static AmazonEC2Client getEC2Client( String accessKey, String secretKey ) { AWSCredentialsProvider provider; if ( accessKey != null && secretKey != null ) { AWSCredentials credentials = new BasicAWSCredentials( accessKey, secretKey ); provider = new StaticCredentialsProvider( credentials ); } else { provider = new DefaultAWSCredentialsProviderChain(); } AmazonEC2Client client = new AmazonEC2Client( provider ); ClientConfiguration configuration = new ClientConfiguration(); configuration.setProtocol( Protocol.HTTPS ); client.setConfiguration( configuration ); return client; }
static String getAutoScaleGroup() { try { String credFileProperty = System.getProperty( AwsPropertyKeys.AWS_CREDENTIALS_FILE.getBundle()); AWSCredentials credentials; if (credFileProperty != null) { credentials = new PropertiesCredentials(new File(credFileProperty)); } else { credentials = new DefaultAWSCredentialsProviderChain().getCredentials(); } AmazonAutoScaling autoScalingClient = AwsServiceClients.autoScaling(credentials); List<AutoScalingInstanceDetails> autoScalingInstances = autoScalingClient.describeAutoScalingInstances( new DescribeAutoScalingInstancesRequest().withInstanceIds(getInstanceId())).getAutoScalingInstances(); return autoScalingInstances.isEmpty() ? UNDEFINED : autoScalingInstances.get(0).getAutoScalingGroupName(); } catch (Exception e) { getLogger().error("Unable to get ASG name.", e); return UNDEFINED; } }
/** * Used for testing purposes only. */ S3CryptoModuleEO(S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(null, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
/** * Used for testing purposes only. */ S3CryptoModuleAE(S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(null, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); } /**
/** * Used for testing purposes only. */ S3CryptoModuleAE(AWSKMSClient kms, S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(kms, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
/** * Used for testing purposes only. */ S3CryptoModuleEO(AWSKMSClient kms, S3Direct s3, EncryptionMaterialsProvider encryptionMaterialsProvider, CryptoConfiguration cryptoConfig) { this(kms, s3, new DefaultAWSCredentialsProviderChain(), encryptionMaterialsProvider, cryptoConfig); }
public BloxTestStack(String bloxEndpoint) { Validate.notEmpty(bloxEndpoint, "Blox endpoint cannot be empty."); this.bloxEndpoint = bloxEndpoint; this.cloudFormationClient = CloudFormationClient.create(); this.ecsClient = ECSClient.create(); this.stacks = new CloudFormationStacks(cloudFormationClient); this.ecs = new ECSClusterWrapper(ecsClient, stacks); this.blox = Blox.builder() .iamCredentials(new DefaultAWSCredentialsProviderChain()) .endpoint(this.bloxEndpoint) .build(); }
provider = new DefaultAWSCredentialsProviderChain(); } else { provider = new AWSCredentialsProvider() {
/** * Constructs a new <code>TransferManager</code> and Amazon S3 client using * the credentials from <code>DefaultAWSCredentialsProviderChain</code> * <p> * <code>TransferManager</code> and client objects may pool connections and * threads. Reuse <code>TransferManager</code> and client objects and share * them throughout applications. * <p> * TransferManager and all AWS client objects are thread safe. */ public TransferManager() { this(new AmazonS3Client(new DefaultAWSCredentialsProviderChain())); }
public AWSCredentialsProvider getCredentials() { // TODO: add an extra option the allow these values to be NULL. if (accessKey == null || secretAccessKey == null) { return new DefaultAWSCredentialsProviderChain(); } return new StaticCredentialsProvider(new BasicAWSCredentials(getAccessKey(), getSecretAccessKey())); }