
480 So.2d 1171 (1985)
TERRY COVE NORTH, INC., a corporation
v.
BALDWIN COUNTY SEWER AUTHORITY, INC.
84-196.
Supreme Court of Alabama.
August 30, 1985.
*1172 James L. Shores, Jr. of Shores & Booker, Fairhope, for appellant.
James B. Newman and Richard E. Davis of Coale, Helmsing, Lyons & Sims, Mobile, for appellee.
FAULKNER, Justice.
This is an appeal from an order granting a Rule 54(b), A.R.Civ.P., partial summary judgment in favor of plaintiff, Baldwin County Sewer Authority, Inc. (Sewer Authority).
This action arose out of the following facts: Terry Cove North, Inc., planned to develop some residential property in Baldwin County. In order to meet its sewage disposal needs, Terry Cove North and five other developers entered into an agreement with the Sewer Authority, a private corporation, for the construction and operation of a sewage treatment facility. This agreement, dated November 14, 1980, provides that the Sewer Authority "shall acquire a site and construct and operate a sewage treatment plant thereon." The developers, Terry Cove North, Inc., East Beach, Inc., Ono Development Co., Ono East Inc., Sunshine Joint Venture, and Frank J. Caron, each agreed to initially contribute a certain amount of money, totaling $800,000.00, to cover the cost of construction of the first phase of the system. In return, each developer was entitled to the service of the facility up to and including a certain designated number of the initial 1200 sewer hook up units. The units were apportioned among the developers on the basis of their respective investments. The agreement also provided that the developers would have certain designated preemptive rights, based upon their respective percentages, to additional units to be added through future expansion. There was attached to the agreement an "Exhibit B," which sets forth the number of initial units and the number of future units to which each developer was entitled, the total being an anticipated capacity of 3600 units (see appendix).
Upon completion of the three phases each developer received its proportional share or its preemptive right to its share of the 3600 units. Apparently the capacity of the sewage treatment facility was in excess of the 3600 units, and thereafter the Sewer Authority began contracting with other developers, who were not originally involved in the agreement, to make available certificates for use of the treatment plant.
On October 21, 1983, and again on November 18, 1983, Terry Cove North, Inc., wrote to the Sewer Authority, claiming that the developers were entitled to benefits from any expansion and requesting its pro-rata share of any additional sewer units.
Thereafter, on December 6, the Sewer Authority brought a declaratory judgment action in the Mobile Circuit Court, seeking, inter alia, a determination by the court that any capacity of the treatment plant in excess of 3600 sewer hook-up units is the sole and exclusive property of the Sewer Authority, and that the developers are entitled to no more than their designated hook-ups as set forth in the agreement.
Terry Cove North, Inc., thereafter made a motion for change of venue to the Baldwin County Circuit Court. After a denial of that motion, Terry Cove North, Inc., instituted a declaratory judgment action in Baldwin County against the Sewer Authority, the developers, and several other developers who had contracted for sewer hook-up units from the Sewer Authority. This cause was eventually transferred and consolidated with the Mobile County action.
Subsequently, the Sewer Authority moved for partial summary judgment declaring that "the total number of Baldwin County Sewer Authority's sewer units to which defendants are entitled is the number set forth on attached `Exhibit B.'" On November 14, 1984, the trial court granted the Sewer Authority's motion for partial summary judgment. In its order dated November 16, 1984, the court found no just reason for delay, and entered its judgment pursuant to Rule 54(b).
Defendant, Terry Cove North, Inc., appeals, raising several issues. The primary *1173 issue for our consideration is whether the trial court properly granted the Sewer Authority's partial summary judgment.
The crux of the issue before the Court is whether, based upon the materials on file before the trial court, a genuine issue of material fact existed as to the terms of the subject agreement. Rule 56, A.R.Civ.P.
The position of Terry Cove North, Inc., on appeal is that the contract is ambiguous and, therefore, extrinsic evidence is necessary to ascertain the intent of the parties. Terry Cove North, Inc., apparently contends that the parties intended that any expansion of the sewage treatment facility would be limited to those developers who were parties to the agreement. We disagree and affirm.
The construction of a written instrument is a function of the court. Federal Land Bank of New Orleans v. Terra Resources, Inc., 373 So.2d 314 (Ala.1979). Whether an agreement is ambiguous is a question of law for the trial court. When its terms are clear and certain, the court, and not the jury, has the duty to determine the meaning of the agreement. Haddox v. First Alabama Bank of Montgomery, N.A., 449 So.2d 1226 (Ala.1984). In order to ascertain the intention of the parties, the clear and plain meaning of the terms of the agreement are to be given effect, and the parties are presumed to have intended what the terms clearly state. Id. Extrinsic evidence may be admitted to interpret a contract only if the court finds that the contract is ambiguous. Coosa Valley Youth Services Corp. v. Etowah County, 460 So.2d 1232 (Ala.1984).
Upon review of the agreement, we find that the trial judge correctly concluded as a matter of law that the agreement was unambiguous. We also cannot accept the contention of Terry Cove North that the developers are entitled to a pro rata share of the expansion of the facility. This interpretation is inconsistent with the clear and plain meaning of the terms of the contract.
Terry Cove North, Inc., admits that the parties anticipated an expansion of the sewer facility beyond the 3600 unit capacity.
The agreement specifically states that "[e]ach Developer shall have the right to expand the facility to provide for the number of future units as set forth on Exhibit `B'." Clearly, this provision indicates that the expansion of the facility as it relates to the developers was limited to the specific number of units as provided for in the contract. It is apparent that the developers contracted for, and in fact received, a designated number of sewer hook-up units.
Moreover, the agreement specifically allows for use of the facility by others:
"USE OF FACILITY BY OTHERS:
20. The Authority covenants and agrees that it shall not permit the use of its Facilities by others, than parties to this agreement, or their assignees, if such use would reduce the capacity of the Facilities or any of its trunk lines, collection lines, or outfall lines below the capacity needed to handle the number of units (present and future) designated for each Developer on Exhibit `B'."
Accordingly, this provision clearly shows that the Authority was permitted, pursuant to the agreement, to allow other developers to use the facility, so long as the capacity of the facility was not reduced below what was needed to handle the units designated to the developers. In this case, none of the developers, including Terry Cove North, showed any evidence that the use by other developers would in any way reduce the capacity needed to handle the units designated for the developers. The parties in this case got what they bargained for and cannot now be allowed to present extrinsic evidence to alter the plaint meaning of their agreement.
When an instrument is unambiguous, its construction and effect are questions of law which may be decided under appropriate circumstances by summary judgment. Warrior Drilling and Engineering Co. v. King, 446 So.2d 31, 33 (Ala. 1984). Here, the court properly determined *1174 from the four corners of the agreement that the developers were entitled only to the 3600 units as set forth in "Exhibit B," and thus properly granted the Sewer Authority's partial summary judgment.
We are not persuaded that the affidavit of Ralph L. Wheat, Jr., presents evidence of fraud so as to preclude summary judgment. The only issues for the court's consideration are those framed in the pleadings. In this case, none of the pleadings raises the issue of fraud either as a cause of action in a counterclaim or as an affirmative defense. Fraud must be affirmatively pleaded and cannot be raised for the first time on appeal.
Moreover, the affidavit, submitted in opposition to the motion for partial summary judgment, fails to set forth sufficient facts showing that there is a genuine issue for trial. Alabama Rules of Civil Procedure, Rule 56(e). The affidavit fails to set forth the requisite element of intent to deceive at the time of the making of the contract, Robinson v. Allstate Insurance Co., 399 So.2d 288 (Ala.1981), and fails to allege any injury to Terry Cove North as a result of the alleged misrepresentation.
The mere allegation that Terry Cove North relied upon a representation made by the Sewer Authority and that information regarding the capacity of the facility was collected from the developers, is insufficient to create a genuine issue of material fact of fraud.
Terry Cove North also contends that venue is improper in Mobile County. This issue, however, is not properly before us on appeal. Disposition of a motion for change of venue may not be reviewed by appeal. The proper device for invoking review is a petition for writ of mandamus. Davis v. Marshall, 404 So.2d 642 (Ala. 1981).
We have also carefully reviewed the numerous other issues raised by Terry Cove North; however, we find them to be without merit. We therefore affirm the trial court's granting of partial summary judgment.
AFFIRMED.
TORBERT, C.J., and MADDOX, EMBRY and ADAMS, JJ., concur.


*1175
                                                     APPENDIX
                                                    EXHIBIT B
                                INITIAL NUMBER OF        AMOUNT PAID FOR     FUTURE UNITS TO WHICH
NAME OF DEVELOPERS               UNITS PAID FOR           INITIAL UNITS      DEVELOPER IS ENTITLED    TOTAL UNITS
TERRY COVE NORTH, INC.                  200                 $133,333               250                   450
EAST BEACH, INC.                        200                 $133,333               250                   450
SUNSHINE JOINT VENTURE,                 150                 $100,000                50                   200
a partnership composed of
Robert J. Williams, Calvin
James, Forrest H. James, Jr.,
and David James
ONO DEVELOPMENT COMPANY, INC.
and ONO EAST, INC.                      317                 $211,334             1,057                 1,374
FRANK J. CARON                          333                 $222,000               793                  1,126

