Consider for instance SSMProvider - if a TransformationManager is not supplied, a default will not be provided. You can contrast this with CacheManager.
|
public SSMProvider build() { |
|
if (cacheManager == null) { |
|
cacheManager = new CacheManager(); |
|
} |
|
SSMProvider provider; |
|
if (client == null) { |
|
client = createClient(); |
|
} |
|
|
|
provider = new SSMProvider(cacheManager, transformationManager, client); |
|
|
|
return provider; |
|
} |
This causes issues in our parameters example, which will throw due to a lack of TransformationManager:
|
MyObject jsonObj = ssmProvider.withTransformation(json).get("/powertools-java/sample/keyjson", MyObject.class); |
|
Map<String, String> secretJson = |
|
secretsProvider.withTransformation(json).get("/powertools-java/userpwd", Map.class); |
What were you trying to accomplish?
Expected Behavior
V2 parameters example should work.
Possible Solution
A default TransformationManager should be provided.
Consider for instance
SSMProvider- if aTransformationManageris not supplied, a default will not be provided. You can contrast this withCacheManager.powertools-lambda-java/powertools-parameters/powertools-parameters-ssm/src/main/java/software/amazon/lambda/powertools/parameters/ssm/SSMProviderBuilder.java
Lines 51 to 63 in fb14bcf
This causes issues in our parameters example, which will throw due to a lack of
TransformationManager:powertools-lambda-java/examples/powertools-examples-parameters/src/main/java/org/demo/parameters/ParametersFunction.java
Line 59 in fb14bcf
powertools-lambda-java/examples/powertools-examples-parameters/src/main/java/org/demo/parameters/ParametersFunction.java
Lines 63 to 64 in fb14bcf
What were you trying to accomplish?
Expected Behavior
V2 parameters example should work.
Possible Solution
A default TransformationManager should be provided.