For legged robots to maximize their mobility to maneuver through the given terrain quickly, the control policy needs to be capable of handling various environmental conditions while making the most of the ability to move between non-adjacent terrains. This paper presents an A*-based path-planning algorithm for legged robots. The heuristic functions in A* is constructed mainly based on preference term for long-distance travel and logarithmic barrier functions to penalize environmental constraints. By transforming the map into a finite set of grid topography, the proposed algorithm can handle various constraints, such as maximum jump height and distance, or avoid potentially interfering obstacles. Various simulation results validated that the proposed framework can generate feasible trajectories for a legged robot in challenging terrains.