All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.infusers.core.secrets.SecretManagerConfig Maven / Gradle / Ivy

package com.infusers.core.secrets;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.infusers.core.logger.ILogger;
import com.infusers.core.secrets.aws.AWSSecretManager;
import com.infusers.core.secrets.aws.DevAWSSecretManager;
import com.infusers.core.secrets.aws.StageAWSSecretManager;
import com.infusers.core.secrets.az.AzSecretManager;
import com.infusers.core.secrets.gcp.GCPSecretManager;
import com.infusers.core.secrets.local.DefaultSecretManager;

@Configuration
public class SecretManagerConfig {
	private ILogger log = new ILogger(SecretManagerConfig.class);
	
    @Bean
    @Profile("prod && aws")
    public ISecretManager awsSecretManager() {
    	log.warnWithSeparator("SecretManagerConfig.awsSecretManager()--> Profile is Prod & AWS!");    	
    	return new AWSSecretManager();
    }

    @Bean
    @Profile("prod && gcp")
    public ISecretManager gcpSecretManager() {
		log.warnWithSeparator("SecretManagerConfig.gcpSecretManager()--> Profile is Prod & GCP!");
    	return new GCPSecretManager();
    }
    
    @Bean
    @Profile("prod && az")
    public ISecretManager azSecretManager() {
		log.warnWithSeparator("SecretManagerConfig.azSecretManager()--> Profile is Prod & Az!");
    	return new AzSecretManager();
    }    
    
    @Bean
    @Profile("dev && !aws")
    public ISecretManager defaultSecretManager() {
		log.warnWithSeparator("SecretManagerConfig.defaultSecretManager()--> Profile is Local/Laptop!");
    	return new DefaultSecretManager();
    }
    
    @Bean
    @Profile("dev && aws")
    public ISecretManager devAWSSecretManager() {
		log.warnWithSeparator("SecretManagerConfig.devAWSSecretManager()--> Profile is Local/Laptop & AWS!");
    	return new DevAWSSecretManager();
    } 
    
    @Bean
    @Profile("stage && aws")
    public ISecretManager stageAWSSecretManager() {
		log.warnWithSeparator("SecretManagerConfig.stageAWSSecretManager()--> Profile is Stage & AWS!");
    	return new StageAWSSecretManager();
    }    
}    




© 2015 - 2025 Weber Informatics LLC | Privacy Policy