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