This is how AWS is doing it. They're dynamically writing the SSM Parameter Names into a .json file and then calling GetParameter in the function.
.json
GetParameter
https://github.com/aws-samples/cognito-at-edge-federated-ui-sample/blob/a49f0cc15a4c5bad973fe109abcf9d4d701cf160/infrastructure/lib/constructs/app-cdn.ts#L120
https://github.com/aws-samples/cognito-at-edge-federated-ui-sample/blob/a49f0cc15a4c5bad973fe109abcf9d4d701cf160/infrastructure/lib/constructs/app-cdn.auth-handler.ts#L5