Nothing contained in this article shall be construed to bar, prior to the expiration of a written express warranty, contract, or indemnity, causes of action or rights of action in contract against architects, engineers, and builders as defined in this article arising out of breach of contract for written express warranties, contracts, or indemnities which by the written terms thereof shall extend beyond the period of seven years after the substantial completion of construction of an improvement on or to the real property. Any written express warranty, contract, or indemnity for the purposes of an action in contract based upon the written express warranty, contract, or indemnity shall be enforceable for the period of time specified in writing, and all civil actions in contract arising out of the written express warranty, contract, or indemnity against any architect, engineer, or builder who gave the written express warranty, contract, or indemnity must be commenced within two years next after the cause of action accrues or arises, and not thereafter; and no relief can be granted and shall be barred on any cause of action which accrues after the expiration of the term or period of said written express warranty, contract, or indemnity.
Ala. Code § 6-5-227 (1975)