Example usage for com.amazonaws.auth EC2ContainerCredentialsProviderWrapper EC2ContainerCredentialsProviderWrapper

List of usage examples for com.amazonaws.auth EC2ContainerCredentialsProviderWrapper EC2ContainerCredentialsProviderWrapper

Introduction

In this page you can find the example usage for com.amazonaws.auth EC2ContainerCredentialsProviderWrapper EC2ContainerCredentialsProviderWrapper.

Prototype

public EC2ContainerCredentialsProviderWrapper() 

Source Link

Usage

From source file:jp.classmethod.aws.gradle.AwsPluginExtension.java

License:Apache License

public AWSCredentialsProvider newCredentialsProvider(String profileName) {
    if (credentialsProvider != null) {
        return credentialsProvider;
    }//w  w w .  ja  v  a 2  s.c om
    String profileNameToUse = profileName != null ? profileName : this.profileName;
    if (Strings.isNullOrEmpty(profileNameToUse) == false) {
        List<AWSCredentialsProvider> providers = new ArrayList<AWSCredentialsProvider>();
        providers.add(new EnvironmentVariableCredentialsProvider());
        providers.add(new SystemPropertiesCredentialsProvider());
        providers.add(new ProfileCredentialsProvider(profileNameToUse));
        providers.add(new EC2ContainerCredentialsProviderWrapper());
        return new AWSCredentialsProviderChain(providers);
    }
    return DefaultAWSCredentialsProviderChain.getInstance();
}

From source file:org.jooby.internal.aws.CredentialsFactory.java

License:Apache License

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;
}