The template conditionally does not create the ParameterGroup and OptionGroup based on whether the aforementioned variables are empty, but refers to them anyway and causes errors:
botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the CreateStack operation: Template format error: Unresolved resource dependencies [OptionGroup, ParameterGroup] in the Resources block of the template
The template conditionally does not create the ParameterGroup and OptionGroup based on whether the aforementioned variables are empty, but refers to them anyway and causes errors: