So squid is a cache, and installing it on CentOS is not the right way, today, in 2020.
It's like telling the mechanic to take a $50,000 loan to re-engineer the Yugo.
Bite the bullet. Move content deliver to something better, and keep the compute junk on EC2.
Sorry to be blunt. A lot of bots and clowns here. Talking straight let's you know you got a serious programmer.