
907 N.E.2d 1086 (2009)
James HOLSCLAW, Appellant-Defendant,
v.
STATE of Indiana, Appellee-Plaintiff.
No. 79A02-0901-CR-4.
Court of Appeals of Indiana.
June 19, 2009.
Michael B. Troemel, Lafayette, IN, Attorney for Appellant.
Gregory F. Zoeller, Attorney General of Indiana, Ann L. Goodwin, Deputy Attorney General, Indianapolis, IN, Attorneys for Appellee.

OPINION
BARNES, Judge.

Case Summary
James Holsclaw appeals his conviction and sentence for Class B felony possession of cocaine. We affirm.

Issues
Holsclaw raises two issues, which we restate as:

*1087 I. whether he may appeal the denial of his motion to dismiss; and
II. whether he may appeal the appropriateness of his sentence.

Facts
On August 15, 2007, Holsclaw was arrested after a police officer found cocaine and a pipe in his pockets. On August 17, 2007, the State charged Holsclaw with Class A felony possession of cocaine and Class A misdemeanor possession of paraphernalia. That same day, counsel was appointed to represent Holsclaw. On August 21, 2007, the State alleged that Holsclaw was an habitual substance offender. On September 4, 2007, Kurtis Fouts entered an appearance on behalf of Holsclaw.
On September 29, 2007, Holsclaw wrote a letter to the trial court acknowledging that he was represented by counsel and requesting a speedy trial. On January 31, 2008, Holsclaw filed a pro se motion to dismiss on the basis that he was denied a speedy trial. On April 11, 2008, Fouts represented Holsclaw at a hearing on the motion to dismiss, which the trial court denied.
On September 12, 2008, Holsclaw pled guilty to Class B felony possession of cocaine and admitted to being an habitual substance offender. The plea agreement provided that the other charge would be dismissed and that the trial court could impose "whatever sentences it deems appropriate except that the executed portion of the sentence shall not exceed twelve (12) years." App. p. 38. The plea agreement also stated, "The Defendant waives his right to appeal his sentence so long as the Court sentences the Defendant within the terms of the plea agreement." Id.
The trial court accepted Holsclaw's guilty plea and sentenced him to ten years for the Class B felony possession conviction and enhanced Holsclaw's sentence by five years for being an habitual substance offender. The trial court specified that ten years would be served in the Department of Correction, two years would be served in community corrections, and the remaining three years would be served on probation. Thus, Holsclaw was sentenced to twelve years executed.[1] Holsclaw now appeals.

Analysis

I. Right to Appeal Conviction
Holsclaw argues that the trial court should have granted his motion to dismiss regardless of whether he was represented by counsel when he filed his speedy trial request. As the State points out, however, Holsclaw gave up his right to appeal his conviction when he pled guilty. At the guilty plea hearing, Holsclaw was informed of his right to appeal his conviction and acknowledged that he was giving up that right by pleading guilty. See Tr. p. 20. "A person who pleads guilty is not permitted to challenge the propriety of that conviction on direct appeal." Collins v. State, 817 N.E.2d 230, 231 (Ind.2004); see also Branham v. State, 813 N.E.2d 809, 812 (Ind.Ct.App.2004) (holding that the defendant may not challenge the trial court's order denying his pretrial motion for discharge under Indiana Criminal Rule 4 after pleading guilty). Because Holsclaw gave up the right to challenge his conviction on direct appeal, he may not challenge *1088 the denial of his pre-trial motion to dismiss.

II. Right to Appeal Sentence
Holsclaw also argues that his sentence is inappropriate. Although a person who pleads guilty is not permitted to challenge the propriety of a conviction on direct appeal, he or she is generally entitled to contest the merits of the trial court's sentencing decision when the trial court exercises its discretion. Collins, 817 N.E.2d at 231. Our supreme court has held, however, that a defendant may waive the right to appellate review of his or her sentence as part of a written plea agreement. Creech v. State, 887 N.E.2d 73, 75 (Ind.2008).
Here, pursuant to the written plea agreement, Holsclaw expressly waived his right to appeal his sentence so long as the trial court sentenced him within the terms of the plea agreement. See App. p. 38. Holsclaw does not argue that he was sentenced contrary to the terms of the plea agreement. Further, there is no indication that his fifteen-year-sentence, with twelve years executed, is inconsistent with the terms of the plea agreement, which capped the executed portion of his sentence at twelve years. Accordingly, Holsclaw may not challenge his sentence on direct appeal.

Conclusion
By pleading guilty, Holsclaw gave up his right to challenge his conviction direct appeal. Pursuant to the terms of his written plea agreement, Holsclaw gave up right to challenge his sentence on direct appeal. We affirm.
Affirmed.
BAKER, C.J., and MAY, J., concur.
NOTES
[1]  We assume the portion of Holsclaw's sentence that is to be served in a community corrections program is part of his executed sentence. See Hildebrandt v. State, 770 N.E.2d 355, 360 (Ind.Ct.App.2002) ("An `executed sentence' is one that is actually served in a correctional facility, or other alternative correctional program, such as work release or home detention as opposed to a suspended sentence or sentence of probation."), trans. denied.
