org.springframework.cloud.aws.core.region.RegionProvider Java Examples

The following examples show how to use org.springframework.cloud.aws.core.region.RegionProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KinesisBinderConfiguration.java    From spring-cloud-stream-binder-aws-kinesis with Apache License 2.0 5 votes vote down vote up
public KinesisBinderConfiguration(KinesisBinderConfigurationProperties configurationProperties,
		AWSCredentialsProvider awsCredentialsProvider,
		RegionProvider regionProvider,
		List<Bindable> bindables) {

	this.configurationProperties = configurationProperties;
	this.awsCredentialsProvider = awsCredentialsProvider;
	this.region = regionProvider.getRegion().getName();
	this.hasInputs =
			bindables.stream()
					.map(Bindable::getInputs)
					.flatMap(Set::stream)
					.findFirst()
					.isPresent();
}
 
Example #2
Source File: CloudWatchExportAutoConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingAmazonClient(AmazonCloudWatchAsync.class)
public AmazonWebserviceClientFactoryBean<AmazonCloudWatchAsyncClient> amazonCloudWatchAsync(
		AWSCredentialsProvider credentialsProvider,
		ObjectProvider<RegionProvider> regionProvider) {
	return new AmazonWebserviceClientFactoryBean<>(AmazonCloudWatchAsyncClient.class,
			credentialsProvider, regionProvider.getIfAvailable());
}
 
Example #3
Source File: ContextRegionProviderAutoConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@ConditionalOnMissingBean(name = REGION_PROVIDER_BEAN_NAME)
@Bean(name = REGION_PROVIDER_BEAN_NAME)
RegionProvider regionProvider(AwsRegionProperties properties) {
	if (StringUtils.hasText(properties.getStatic())) {
		return new StaticRegionProvider(properties.getStatic());
	}
	else {
		return new DefaultAwsRegionProviderChainDelegate();
	}
}
 
Example #4
Source File: ContextStackAutoConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingAmazonClient(AmazonCloudFormation.class)
public AmazonWebserviceClientFactoryBean<AmazonCloudFormationClient> amazonCloudFormation(
		ObjectProvider<RegionProvider> regionProvider,
		ObjectProvider<AWSCredentialsProvider> credentialsProvider) {
	return new AmazonWebserviceClientFactoryBean<>(AmazonCloudFormationClient.class,
			credentialsProvider.getIfAvailable(), regionProvider.getIfAvailable());
}
 
Example #5
Source File: ElastiCacheAutoConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(AmazonElastiCache.class)
public AmazonWebserviceClientFactoryBean<AmazonElastiCacheClient> amazonElastiCache(
		ObjectProvider<RegionProvider> regionProvider,
		ObjectProvider<AWSCredentialsProvider> credentialsProvider) {
	return new AmazonWebserviceClientFactoryBean<>(AmazonElastiCacheClient.class,
			credentialsProvider.getIfAvailable(), regionProvider.getIfAvailable());
}
 
Example #6
Source File: ContextStackConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
public ContextStackConfiguration(ObjectProvider<RegionProvider> regionProvider,
		ObjectProvider<AWSCredentialsProvider> credentialsProvider,
		ObjectProvider<AmazonEC2> amazonEc2) {
	this.regionProvider = regionProvider.getIfAvailable();
	this.credentialsProvider = credentialsProvider.getIfAvailable();
	this.amazonEc2 = amazonEc2.getIfAvailable();
}
 
Example #7
Source File: ElastiCacheCachingConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
public ElastiCacheCachingConfiguration(ObjectProvider<RegionProvider> regionProvider,
		ObjectProvider<AWSCredentialsProvider> credentialsProvider,
		ObjectProvider<ListableStackResourceFactory> stackResourceFactory) {
	this.regionProvider = regionProvider.getIfAvailable();
	this.credentialsProvider = credentialsProvider.getIfAvailable();
	this.stackResourceFactory = stackResourceFactory.getIfAvailable();
}
 
Example #8
Source File: AmazonS3Configuration.java    From spring-cloud-stream-app-starters with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public AmazonS3 amazonS3(AWSCredentialsProvider awsCredentialsProvider, RegionProvider regionProvider) {
	return new AmazonS3Client(awsCredentialsProvider)
			.withRegion(regionProvider.getRegion());
}
 
Example #9
Source File: AmazonWebserviceClientFactoryBean.java    From spring-cloud-aws with Apache License 2.0 4 votes vote down vote up
public AmazonWebserviceClientFactoryBean(Class<T> clientClass,
		AWSCredentialsProvider credentialsProvider, RegionProvider regionProvider) {
	this(clientClass, credentialsProvider);
	setRegionProvider(regionProvider);
}
 
Example #10
Source File: AmazonWebserviceClientFactoryBean.java    From spring-cloud-aws with Apache License 2.0 4 votes vote down vote up
public void setRegionProvider(RegionProvider regionProvider) {
	this.regionProvider = regionProvider;
}
 
Example #11
Source File: MailSenderAutoConfiguration.java    From spring-cloud-aws with Apache License 2.0 4 votes vote down vote up
public MailSenderAutoConfiguration(ObjectProvider<RegionProvider> regionProvider) {
	this.regionProvider = regionProvider.getIfAvailable();
}
 
Example #12
Source File: SnsConfiguration.java    From spring-cloud-aws with Apache License 2.0 4 votes vote down vote up
public SnsConfiguration(ObjectProvider<AWSCredentialsProvider> awsCredentialsProvider,
		ObjectProvider<RegionProvider> regionProvider) {
	this.awsCredentialsProvider = awsCredentialsProvider.getIfAvailable();
	this.regionProvider = regionProvider.getIfAvailable();
}
 
Example #13
Source File: SqsClientConfiguration.java    From spring-cloud-aws with Apache License 2.0 4 votes vote down vote up
public SqsClientConfiguration(
		ObjectProvider<AWSCredentialsProvider> awsCredentialsProvider,
		ObjectProvider<RegionProvider> regionProvider) {
	this.awsCredentialsProvider = awsCredentialsProvider.getIfAvailable();
	this.regionProvider = regionProvider.getIfAvailable();
}