I'd start with the Mighty Servant of Leuk-O. From the AD&D DMG p 169:
The Mighty Servant of the famous General Leuk-O is a towering automaton of crystal, unknown metals, and strange fibrous material. It is over 9' tall, 6' deep, and some 4½' wide, Inside is a compartment suitable for holding 2 man-sized creatures, and there is space for 4-5 others to sit outside. If the possessor knows the proper command phrases, he or she can use the Mighty Servant as a transportation mode, magical attack device, or fighting machine. It is armor class -1 and can withstand 60 hit points of damage. Note all weapons do only 50% of normal damage (round down). The Mighty Servant regenerates (self-repairs) 2 points of damage per round, Its magic resistance is 100%. Acid, cold, fire, heat, vacuum, and/or water have no effect on the device. Electrical/lightning attacks cause only 20% normal damage (round down), even if the Servant fails the magic resistance check.
The Mighty Servant moves at a maximum speed of 3". After each 12 hours of operation it must rest (recharge) itself for 1 hour. Any intelligent viewer within 12" must save versus magic (+2 on the die roll) or flee in panic. It can attack but 1 time per round, and it has a base 15% chance to hit an opponent regardless of its armor class. Opponents with intelligence and a dexterity of 15 or better reduce the base chance to hit by 2½% per 1 point of dexterity above 14. A hit from the Mighty Servant causes 10-100 hit points of damage.
Converting that to 5e:
AC 21 (ascending rather than descending)
hp 200 (this is the same as a cloud giant - in AD&D cloud giants average 58.5 hp, which is pretty close to 60)
Speed 10' (3" is one-quarter base human speed; this is a rough approximation to that)
Resistance to non-magic bludgeoning, piercing or slashing; lightning (corresponds roughly to the AD&D stats)
Immune to acid, cold, fire damage (same as AD&D)
Magic Resistance advantage on saving throws against spells and other magical effects (like an archmage; reflects AD&D MR)
Regeneration 5 hp per round (similar ratio of regen to total hp as the AD&D version)
I would drop the "cause fear" effect, which I think is meant to simulate the effect a mech will have on morale.
The immunity to water and vacuum I would fold into the description rather than the basic stats: ie the compartment is water proof, and those within it have an air supply even if there is no air outside.
That leaves the attack and damage component. The Might Servant hits on 18+ regardless of AC; but DEX provides half the normal bonus (+2½% per point above 14, rather than +5% as normal). This is not appropriate for 5e. Let's say that, against a well-armoured fighter the Might Servant hits on 18+; and against a leather-armoured and dextrous thief the Might Servant hits on 20 only. In 5e terms, that's an 18 to hit an AC 22 fighter (allowing for some magic), or +4 to hit; and 20 to hit an AC 18 thief (again, allowing for some magic), or a -2 to hit. Splitting the difference is +1 to hit.
That might seem fairly low - but it is pretty low in AD&D also. If you're going to keep the attack bonus low, I'd keep the damage high: 55 hp damage (or 10d10) has a certain oomph to it!
Anyway, with those stats the Mighty Servant is clearly far more robust than a cloud giant (more hp given its regen, much better AC, and resistances/immunities). Assuming attack bonuses of +10, it will be hit only on 11+ rather than 4+, which nearly doubles its staying power before factoring in immunities and regen.
But it's much less dangerous as an attacker: assuming AC 19 as a norm, the giant hits 7 in 10 twice for 21 damage each time, or DPR of around 30 per round; the Might Servant with +1 to hit will hit 3 in 20 for 55, or DPR of around 8. Maybe you'd want to give it two attacks per round, or boost its attack bonus (+4 will double its DPR vs AC 19, putting back on some sort of par with the cloud giant - halved DPR, but about twice as durable).