Megathrust earthquakes are strongly influenced by the elastic properties of rocks surrounding the fault. However, these properties are often overestimated in numerical simulations, particularly in the shallow megathrust. Here we explore the influence that realistic depth-varying upper-plate elastic properties along the megathrust have on earthquake rupture dynamics and tsunamigenesis using 3D dynamic rupture and tsunami simulations. We compare results from three subduction zone scenarios with homogeneous and heterogeneous elastic media, and bimaterial fault. Elastic properties in the heterogeneous model follow a realistic depth-distribution derived from controlled-source tomography models of subduction zones. We assume the same friction properties for all scenarios. Simulations in the heterogeneous and homogeneous models show that rigidity variation of the country rock determines the depth-varying behavior of slip, slip rate, frequency content, and rupture time. Fault friction may provide additional constraints, but to a lesser extent. The depth-varying behavior of slip, frequency content, and rupture duration quantitatively agree with previous predictions based on worldwide data compilations, explaining the main depth-dependent traits of tsunami earthquakes and large shallow megathrust earthquakes. Large slip, slow rupture and slip rate amplification in bimaterial simulations are largely controlled by the elastic rock properties of the most compliant side of the fault, which in subduction zones is the upper plate. Large shallow slip and trenchward increasing upper-plate compliance of the heterogeneous model lead to the largest co-seismic seafloor deformation and tsunami amplitude. This highlights the importance of considering realistic variations in upper-plate rigidity to properly assess the tsunamigenic potential of megathrust earthquakes.