def METHOD_NAME(
    existing_database_stack_name,
    test_resources_dir,
    region,
):
    if existing_database_stack_name:
        logging.info("Using pre-existing database stack named %s", existing_database_stack_name)
        return existing_database_stack_name
    if not created_database_stacks.get(region, {}).get("default"):
        logging.info("Creating default database stack")
        database_stack = _create_database_stack(stack_factory, request, region, vpc_stack_for_database)
        created_database_stacks[region]["default"] = database_stack.name
    logging.info("Using database stack %s", created_database_stacks.get(region, {}).get("default"))
    return created_database_stacks.get(region, {}).get("default")