Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Add ability to configure your own AWSCredentialsProvider #102

Closed
@peterox

Description

@peterox

The Spring boot auto configuration will always register an AWSCredentialsProvider making it impossible to register your own.

Adding a conditional to ContextCredentialsAutoConfiguration

@ConditionalOnMissingBean(AWSCredentialsProvider.class)
@Configuration
@Import({ContextDefaultConfigurationRegistrar.class, ContextCredentialsAutoConfiguration.Registrar.class})
public class ContextCredentialsAutoConfiguration {

would allow for something like

    @Bean(name = {CredentialsProviderFactoryBean.CREDENTIALS_PROVIDER_BEAN_NAME, AmazonWebserviceClientConfigurationUtils.CREDENTIALS_PROVIDER_BEAN_NAME} )
    public static AWSCredentialsProviderChain credentialsProvider(Environment environment) {
        return new AWSCredentialsProviderChain(
                new EnvironmentVariableCredentialsProvider(),
                new SystemPropertiesCredentialsProvider(),
                new ProfileCredentialsProvider(),
                new InstanceProfileCredentialsProvider(),
                new StaticCredentialsProvider(new BasicAWSCredentials(environment.getProperty("cloud.aws.credentials.accessKey",""),
                        environment.getProperty("cloud.aws.credentials.secretKey",""))));
    }

Metadata

Metadata

Labels

component: coreAn issue related to core functionality - credentials, region resolutiontype: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions