Closed edenhare closed 4 months ago
There is a bug in the String macro Lambda function when using StripFrom Right.
In this code block
elif operation == "MaxLength": length = int(event["params"]["Length"]) if len(input) <= length: response["fragment"] = input elif "StripFrom" in event["params"]: if event["params"]["StripFrom"] == "Left": response["fragment"] = input[len(input)-length:] elif event["params"]["StripFrom"] != "Right": response["status"] = "failure" else: response["fragment"] = input[:length]
the else is never executed when StripFrom is present to return the result. The transform lambda successfully executes, but since there is no response['fragment'] is the return to CloudFormation, a template processing error results.
else
If the code is changed to
the the macros return correctly when using StripFrom Right and the response['fragment'] is in the return back to CloudFormation.
See PR https://github.com/aws-cloudformation/aws-cloudformation-macros/pull/19
We are archiving this repository in favor of similar content located here: https://github.com/aws-cloudformation/aws-cloudformation-templates/tree/main/aws/services/CloudFormation/MacrosExamples
There is a bug in the String macro Lambda function when using StripFrom Right.
In this code block
the
else
is never executed when StripFrom is present to return the result. The transform lambda successfully executes, but since there is no response['fragment'] is the return to CloudFormation, a template processing error results.If the code is changed to
the the macros return correctly when using StripFrom Right and the response['fragment'] is in the return back to CloudFormation.