The structural, electronic, and defect properties of cubic $CsPbX_3$ (X = Cl, Br, I) and orthorhombic $CsPbCl_3$, $CsPbBr_3$ are investigated based on first principles calculation to understand the perovskite systems which have recently shown big progress as the solar cell absorber. Regardless of the structure type, the main electronic properties of all the systems mainly come from the Pb - X bonding character while Cs play a role to balance the charge of the whole system by donating an electron to the Pb - X framework. The estimated bandgaps and effective masses show the decreasing tendency as X goes from Cl to I and increasing tendency as structure goes from cubic to orthorhombic. For the vacancy defects of Cs, Pb, and X, the most favorable doping type is p-type by $V_{Cs}$ under $PbX_2$ - rich condition for all the systems. For the vacancy defects of Cs and Pb, all the cubic systems exhibit no gap state within the bandgap, which leads the high performance photovoltaic operation of the peroveskite materials along with the long carrier diffusion length. The investigation of the effects depending on the phase and halogen anion X in $CsPbX_3$ suggests that higher performance next generation solar cells based on halide peroveskite can be achieved with the careful considerations for the crystal structure and components of the perovskite materials.