By 1954, Elvis and Johnny were both signed to Sun Records.

In the time that followed, Elvis, Johnny, Carl Perkins, and Jerry Lee Lewis performed songs together during a famous jam session called the Million Dollar Quartet. As for how that group came to be, Johnny said in his book, “I was there — I was the first to arrive and the last to leave, contrary to what has been written—but I was just there to watch Carl record, which he did until mid-afternoon, when Elvis came in with his girlfriend.”

Source: https://www.distractify.com/p/were-johnny-cash-and-elvis-friends