How do I kill a summoned ender dragon?

The correct entity type is ender_dragon and not EnderDragon. So, use /kill @e[type=ender_dragon]