Class AwsAutoConfiguration
- java.lang.Object
-
- com.netflix.genie.common.internal.configs.AwsAutoConfiguration
-
@Configuration @EnableConfigurationProperties @AutoConfigureAfter({io.awspring.cloud.autoconfigure.context.ContextCredentialsAutoConfiguration.class,io.awspring.cloud.autoconfigure.context.ContextInstanceDataAutoConfiguration.class,io.awspring.cloud.autoconfigure.context.ContextRegionProviderAutoConfiguration.class,io.awspring.cloud.autoconfigure.context.ContextResourceLoaderAutoConfiguration.class,io.awspring.cloud.autoconfigure.context.ContextStackAutoConfiguration.class}) @ConditionalOnBean(com.amazonaws.auth.AWSCredentialsProvider.class) public class AwsAutoConfiguration extends java.lang.Object
Spring Boot auto configuration for AWS related beans for the Genie Agent. Should be configured after all the Spring Cloud AWS context configurations are complete.- Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
S3_JOB_ARCHIVER_PRECEDENCE
Constant for the precedence of the S3 job archive implementation for others to reference if need be.
-
Constructor Summary
Constructors Constructor Description AwsAutoConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.regions.AwsRegionProvider
awsRegionProvider(io.awspring.cloud.autoconfigure.context.properties.AwsRegionProperties awsRegionProperties)
Get an AWS region provider instance.io.awspring.cloud.autoconfigure.context.properties.AwsS3ResourceLoaderProperties
awsS3ResourceLoaderProperties()
Provide a configuration properties bean for Spring Cloud resource loader properties if for whatever reason theContextResourceLoaderAutoConfiguration
isn't applied by the agent app.S3ClientFactory
s3ClientFactory(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.regions.AwsRegionProvider awsRegionProvider, org.springframework.core.env.Environment environment)
Provide a lazyS3ClientFactory
instance if one is needed by the system.S3JobArchiverImpl
s3JobArchiver(S3ClientFactory s3ClientFactory)
Provide an implementation ofJobArchiver
to handle archiving to S3.S3ProtocolResolver
s3ProtocolResolver(io.awspring.cloud.autoconfigure.context.properties.AwsS3ResourceLoaderProperties resourceLoaderProperties, S3ClientFactory s3ClientFactory)
Provide an protocol resolver which will allow resources with s3:// prefixes to be resolved by the applicationResourceLoader
provided this bean is eventually added to the context via theConfigurableApplicationContext.addProtocolResolver(ProtocolResolver)
method.S3ProtocolResolverRegistrar
s3ProtocolResolverRegistrar(S3ProtocolResolver s3ProtocolResolver)
Configurer bean which will add theS3ProtocolResolver
to the set ofProtocolResolver
in the application context.
-
-
-
Field Detail
-
S3_JOB_ARCHIVER_PRECEDENCE
public static final int S3_JOB_ARCHIVER_PRECEDENCE
Constant for the precedence of the S3 job archive implementation for others to reference if need be.- See Also:
Ordered
, Constant Field Values
-
-
Method Detail
-
awsRegionProvider
@Bean @ConditionalOnMissingBean(com.amazonaws.regions.AwsRegionProvider.class) public com.amazonaws.regions.AwsRegionProvider awsRegionProvider(io.awspring.cloud.autoconfigure.context.properties.AwsRegionProperties awsRegionProperties)
Get an AWS region provider instance. The rules for this basically follow what Spring Cloud AWS does but uses the interface from the AWS SDK instead and provides a sensible default.- Parameters:
awsRegionProperties
- The cloud.aws.region.* properties- Returns:
- A region provider based on whether static was set by user, else auto, else default of us-east-1
-
s3ClientFactory
@Bean @ConditionalOnMissingBean(S3ClientFactory.class) public S3ClientFactory s3ClientFactory(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.regions.AwsRegionProvider awsRegionProvider, org.springframework.core.env.Environment environment)
Provide a lazyS3ClientFactory
instance if one is needed by the system.- Parameters:
awsCredentialsProvider
- TheAWSCredentialsProvider
to useawsRegionProvider
- TheAwsRegionProvider
to useenvironment
- The Spring applicationEnvironment
to bind properties from- Returns:
- A
S3ClientFactory
instance
-
awsS3ResourceLoaderProperties
@Bean @ConditionalOnMissingBean(io.awspring.cloud.autoconfigure.context.properties.AwsS3ResourceLoaderProperties.class) @ConfigurationProperties("cloud.aws.loader") public io.awspring.cloud.autoconfigure.context.properties.AwsS3ResourceLoaderProperties awsS3ResourceLoaderProperties()
Provide a configuration properties bean for Spring Cloud resource loader properties if for whatever reason theContextResourceLoaderAutoConfiguration
isn't applied by the agent app.- Returns:
- A
AwsS3ResourceLoaderProperties
instance with the bindings from cloud.aws.loader values
-
s3ProtocolResolver
@Bean @ConditionalOnMissingBean(S3ProtocolResolver.class) public S3ProtocolResolver s3ProtocolResolver(io.awspring.cloud.autoconfigure.context.properties.AwsS3ResourceLoaderProperties resourceLoaderProperties, S3ClientFactory s3ClientFactory)
Provide an protocol resolver which will allow resources with s3:// prefixes to be resolved by the applicationResourceLoader
provided this bean is eventually added to the context via theConfigurableApplicationContext.addProtocolResolver(ProtocolResolver)
method.- Parameters:
resourceLoaderProperties
- TheAwsS3ResourceLoaderProperties
instance to uses3ClientFactory
- TheS3ClientFactory
instance to use- Returns:
- A
S3ProtocolResolver
instance
-
s3ProtocolResolverRegistrar
@Bean @ConditionalOnMissingBean(S3ProtocolResolverRegistrar.class) public S3ProtocolResolverRegistrar s3ProtocolResolverRegistrar(S3ProtocolResolver s3ProtocolResolver)
Configurer bean which will add theS3ProtocolResolver
to the set ofProtocolResolver
in the application context.- Parameters:
s3ProtocolResolver
- The implementation ofS3ProtocolResolver
to use- Returns:
- A
S3ProtocolResolverRegistrar
instance
-
s3JobArchiver
@Bean @Order(-2147483638) public S3JobArchiverImpl s3JobArchiver(S3ClientFactory s3ClientFactory)
Provide an implementation ofJobArchiver
to handle archiving to S3.- Parameters:
s3ClientFactory
- The factory for creating S3 clients- Returns:
- A
S3JobArchiverImpl
instance
-
-