use of io.awspring.cloud.secretsmanager.AwsSecretsManagerPropertySource in project spring-cloud-aws by awspring.
the class AwsSecretsManagerConfigDataLoader method load.
@Override
public ConfigData load(ConfigDataLoaderContext context, AwsSecretsManagerConfigDataResource resource) {
try {
AWSSecretsManager sm = context.getBootstrapContext().get(AWSSecretsManager.class);
AwsSecretsManagerPropertySource propertySource = resource.getPropertySources().createPropertySource(resource.getContext(), resource.isOptional(), sm);
if (propertySource != null) {
return new ConfigData(Collections.singletonList(propertySource));
} else {
return null;
}
} catch (Exception e) {
throw new ConfigDataResourceNotFoundException(resource, e);
}
}
Aggregations