Package io.awspring.cloud.secretsmanager
Class SecretsManagerPropertySource
java.lang.Object
org.springframework.core.env.PropertySource<T>
org.springframework.core.env.EnumerablePropertySource<T>
io.awspring.cloud.core.config.AwsPropertySource<SecretsManagerPropertySource,software.amazon.awssdk.services.secretsmanager.SecretsManagerClient>
io.awspring.cloud.secretsmanager.SecretsManagerPropertySource
public class SecretsManagerPropertySource
extends AwsPropertySource<SecretsManagerPropertySource,software.amazon.awssdk.services.secretsmanager.SecretsManagerClient>
Retrieves secret value under the given context / path from the AWS Secrets Manager using the provided Secrets Manager
client.
- Since:
- 2.0.0
- Author:
- Fabio Maia, Maciej Walkowiak, Arun Patra, Matej Nedic
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
PropertySource.StubPropertySource -
Field Summary
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source -
Constructor Summary
ConstructorsConstructorDescriptionSecretsManagerPropertySource(String context, software.amazon.awssdk.services.secretsmanager.SecretsManagerClient smClient) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a non-initialized copy of the property source.getProperty(String name) String[]voidinit()Loads properties from the Secrets Manager secret.Methods inherited from class org.springframework.core.env.EnumerablePropertySource
containsProperty
-
Constructor Details
-
SecretsManagerPropertySource
public SecretsManagerPropertySource(String context, software.amazon.awssdk.services.secretsmanager.SecretsManagerClient smClient)
-
-
Method Details
-
init
public void init()Loads properties from the Secrets Manager secret.- Specified by:
initin classAwsPropertySource<SecretsManagerPropertySource,software.amazon.awssdk.services.secretsmanager.SecretsManagerClient> - Throws:
software.amazon.awssdk.services.secretsmanager.model.ResourceNotFoundException- if specified secret does not exist in the AWS Secret Manager service.
-
getPropertyNames
- Specified by:
getPropertyNamesin classEnumerablePropertySource<software.amazon.awssdk.services.secretsmanager.SecretsManagerClient>
-
getProperty
- Specified by:
getPropertyin classPropertySource<software.amazon.awssdk.services.secretsmanager.SecretsManagerClient>
-
copy
Description copied from class:AwsPropertySourceCreates a non-initialized copy of the property source.- Specified by:
copyin classAwsPropertySource<SecretsManagerPropertySource,software.amazon.awssdk.services.secretsmanager.SecretsManagerClient> - Returns:
- a property source
-