Package io.hekate.spring.boot.cluster
Class HekateCloudSeedNodeProviderConfigurer
- java.lang.Object
-
- io.hekate.spring.boot.cluster.HekateCloudSeedNodeProviderConfigurer
-
@Configuration @ConditionalOnHekateEnabled @AutoConfigureBefore(HekateClusterServiceConfigurer.class) @ConditionalOnProperty(value="hekate.cluster.seed.cloud.enable", havingValue="true") public class HekateCloudSeedNodeProviderConfigurer extends Object
Auto-configuration forCloudSeedNodeProvider
.This auto-configuration is disabled by default and can be enabled by setting the
'hekate.cluster.seed.cloud.enable'
property totrue
in the application configuration.The following properties can be used to customize the auto-configured
CloudSeedNodeProvider
instance:'hekate.cluster.seed.cloud.provider'
'hekate.cluster.seed.cloud.endpoint'
'hekate.cluster.seed.cloud.identity'
'hekate.cluster.seed.cloud.credential'
'hekate.cluster.seed.cloud.regions'
'hekate.cluster.seed.cloud.zones'
'hekate.cluster.seed.cloud.tags'
CloudPropertiesBase.setConnectTimeout(Integer)
'hekate.cluster.seed.cloud.connect-timeout'}CloudPropertiesBase.setSoTimeout(Integer)
'hekate.cluster.seed.cloud.so-timeout'}'hekate.cluster.seed.cloud.properties'
- See Also:
HekateClusterServiceConfigurer
-
-
Constructor Summary
Constructors Constructor Description HekateCloudSeedNodeProviderConfigurer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CredentialsSupplier
cloudCredentialsSupplier(String provider)
Conditionally constructs a new credentials supplier based on the provider name.CloudSeedNodeProvider
cloudSeedNodeProvider(CloudSeedNodeProviderConfig cfg)
Constructs newCloudSeedNodeProvider
.CloudSeedNodeProviderConfig
cloudSeedNodeProviderConfig(CredentialsSupplier credentials)
Conditionally constructs a new configuration forCloudSeedNodeProvider
if application doesn't provide its ownBean
ofCloudSeedNodeProviderConfig
type.
-
-
-
Method Detail
-
cloudCredentialsSupplier
@Bean @ConditionalOnMissingBean(CredentialsSupplier.class) @ConfigurationProperties(prefix="hekate.cluster.seed.cloud") public CredentialsSupplier cloudCredentialsSupplier(@Value("${hekate.cluster.seed.cloud.provider}") String provider)
Conditionally constructs a new credentials supplier based on the provider name. If provider name contains 'aws' then constructsAwsCredentialsSupplier
; otherwise constructsBasicCredentialsSupplier
.- Parameters:
provider
- Provider name (seeCloudSeedNodeProviderConfig.setProvider(String)
).- Returns:
- Credentials supplier.
-
cloudSeedNodeProviderConfig
@Bean @ConditionalOnMissingBean(CloudSeedNodeProviderConfig.class) @ConfigurationProperties(prefix="hekate.cluster.seed.cloud") public CloudSeedNodeProviderConfig cloudSeedNodeProviderConfig(CredentialsSupplier credentials)
Conditionally constructs a new configuration forCloudSeedNodeProvider
if application doesn't provide its ownBean
ofCloudSeedNodeProviderConfig
type.- Parameters:
credentials
- Credentials supplier (seecloudCredentialsSupplier(String)
).- Returns:
- New configuration.
-
cloudSeedNodeProvider
@Bean public CloudSeedNodeProvider cloudSeedNodeProvider(CloudSeedNodeProviderConfig cfg)
Constructs newCloudSeedNodeProvider
.- Parameters:
cfg
- Configuration (seecloudSeedNodeProviderConfig(CredentialsSupplier)
).- Returns:
- New provider.
-
-