You can use flexible gas tubes or water pipes for a gas water heater in most states. In states with earthquakes, they can even be mandatory. If your existing gas pipe has CSST (corroded stainless steel tubes) or has not been glued, the connection should be replaced right away.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.