from typing import Union
from typing import List


def format_keywords(keywords: Union[str, List]) -> str:
    """
    Format keywords fromm YAML file into the comma string list expected by boto3.

    Possible inputs are:
      a) A comma string list, e.g. 'foo, bar, baz, qux'
      b) A list of strings, e.g. ['foo', 'bar', 'baz', 'qux']
    """
    if isinstance(keywords, str):
        return keywords
    elif isinstance(keywords, list):
        return ','.join(keywords)