Upgrading Medplum on AWS with CDK

A Medplum upgrade on AWS CDK moves one minor version at a time, with server image changes applied through the CLI and infrastructure changes through cdk diff and cdk deploy. This page covers the path, the order of changes, the checks and the rollback points.

On this page

How to plan a Medplum upgrade on AWS CDK one minor at a time

A self-hosted Medplum stack deployed with the AWS CDK must be moved through each minor version in sequence, because skipping a minor version causes startup failures. The upgrading guide's example of jumping from v3.1.2 straight to v4.3.4 is the failure mode to plan around. The rest of this page follows that supported path, so every step you plan should be a stop on the way to your target release, not a jump past one.

The reason to plan now is the security and support clock. Medplum targets security patches within 7 days for critical vulnerabilities (CVSS 9.0 or higher) and within 14 days for high ones (CVSS 7.0 to 8.9), and each major version receives 1 year of Active support and 1 year of Maintenance, with an Enterprise extension of 12 more months of security patches for 36 months in total. Before you start, confirm which line your deployment is on and when its support window ends in the Medplum versions and release policy. The latest release at research time was 5.2.5, published on October 15, 2026, so treat that as the reference point for where your path ends, and check the Medplum releases page on the day you plan, since patch releases ship weekly.

Write the path down before anyone touches the stack. List your current version, every minor between it and the target, and the latest patch of each minor, because the server image in your CDK config is what you will change at each stop. Confirm each stop's post-deploy migration behavior in the upgrading guide before you schedule it, since large datasets can keep migrations running for hours or days and the next minor should not begin until the previous one has finished. Ask your Medplum contact or check the release notes to confirm whether any stop includes infrastructure changes that need a cdk diff review, so you know which stops need a CDK deploy and which need only an image update.

Finally, decide who signs off each stop and what evidence they need. For each minor, record the version, the time the deploy completed, the migration status, and the result of your smoke tests in staging before production. This record is also what your compliance and change-management teams will ask for later, and it gives you a clear point to pause if a stop misbehaves. The exact effort per stop depends on your dataset size, test coverage and change windows, so ask any partner for a written estimate built on your own path rather than a generic duration.

What a Medplum upgrade changes in the CDK stack

This table compares each kind of Medplum release and config value against what it changes in a CDK-deployed stack and what you need to do. Read it before planning any upgrade, since the release type determines how much of the stack you touch. The main takeaway is that every new server image should be checked against its changelog before the CDK config changes.

ChangeImpact on the CDK stackAction needed
Weekly patch versionsFrequent server image updates with fixes, usually within the same minor lineReview each patch release notes, then update serverImage and run cdk diff before deploying
Minor versions, two to three times a yearNew server image and possible post-deploy data migrations, which must run in sequenceStep through each minor in order, check the changelog for breaking changes, and do not skip versions
Major versions, annually in Q4Largest change, with likely application changes and a new support windowPlan a separate project, update application code first, and test in staging before changing production config
serverImage value in the CDK configSets the Medplum server container image the stack runsChange it only to a version you have reviewed, and keep it in version control
desiredServerCount, rdsInstances and maxAzsCan change with capacity or resilience needs and alter running resources when deployedConfirm each value with cdk diff, and ask your team which resources will be replaced or resized
Critical security patches (CVSS 9.0 or higher)Medplum targets a patch within 7 days, which can arrive outside the normal release rhythmSet an internal process for out-of-cycle deploys and test a critical patch path ahead of time
High security patches (CVSS 7.0 to 8.9)Medplum targets a patch within 14 daysPlan a maintenance window that can absorb a patch release on short notice

Image changes and infrastructure changes take different paths through the CLI and CDK

The operator edits the CDK config file, then chooses a path: an image-only change goes through medplum aws update-server, while any change to infrastructure settings such as rdsInstances or maxAzs is reviewed with npx cdk diff and applied with npx cdk deploy. Both paths land on the same stack, which runs the Medplum server, PostgreSQL, Redis and reads its settings from Parameter Store. Check the diff output before deploying, and confirm the server image and infrastructure changes are applied in the order your runbook sets.

Image-only changes and infrastructure changes reach the same stack by different commands.

Which path applies: image only, infrastructure only, or both

When a release changes only the server image and your CDK config already matches what the new version needs, the standard update process is the right path. For AWS deployments this is typically medplum aws update-server, which the rollback guide describes as the standard way to deploy a new minor version.

  • Confirm the sequence: Check that the target is the next minor version after the one you run now. Self-hosted Medplum must move through each minor in order.
  • Read the release notes: Review the release notes and the upgrading guide for post-deploy migrations and configuration changes.
  • Check the image reference: Confirm the image tag the command deploys matches the version you tested in staging.
  • Decide on deferred migrations: Confirm whether post-deploy migrations will run now or later, since that determines whether the previous version stays safe to return to.
  • Review the diff: The change should touch the server container image only. Any other resource change is a reason to stop and check the config.

Before you finish, confirm the service reports the target version and passes health checks.

What to prepare before the first Medplum upgrade step

Each card names something you should hold in hand before touching the stack. Together they make the upgrade reversible, reviewable and repeatable, and they mean the CDK config, the running environment and the rollback plan all describe the same system.

Verified database backup and snapshot

Confirm that a recent RDS snapshot or backup of the Medplum PostgreSQL database exists, that you can see it in the AWS console, and that someone on your team has checked the retention window covers the full upgrade path. Post-deploy data migrations can run for hours or days on large datasets, so the snapshot must predate the first step, not just the last one. Ask your team to note the snapshot identifier in the change record.

Upgrade guide

Inventory of CDK config values

Export the current CDK config file and record the values that the upgrade touches, including serverImage, desiredServerCount, rdsInstances and maxAzs. Note any local stack customizations, such as extra security group rules, tags or resources you added beside the Medplum constructs. These are the first things a diff will surprise you with, so you need to know which changes are yours and which come from Medplum.

CDK settings reference

CDK config under version control

Keep the CDK config file, the stack code and the deployment scripts in a Git repository with a tagged commit for the current running state. The upgrade will change the server image and possibly infrastructure, so you need a diffable history and a known-good revision to return to. Confirm that the person running the deploy can check out that revision and that the repository is not the only place the config exists.

Staging stack that mirrors production

Confirm you have a staging stack built from the same CDK code and a similar config, with its own database and cache. Run the full sequence there first, including the post-deploy migration wait and the health checks. Differences in instance sizes, desired server count or region are acceptable only when you have written them down, because they change timing and failure behavior in ways a staging run will not show.

Parameter Store settings and owners

List every Parameter Store value the stack reads, the parameter names, and the person or team responsible for each. Check that secrets, database credentials and any values that differ between environments are set in the account and region you will deploy to. Owners should confirm they can change values during the window, because a stale parameter is a common reason a new server fails to start after a deploy succeeds.

Rollback path confirmed before the window

Write down the exact commands and config changes needed to return to the prior server image, and confirm who has authority to trigger them. Check whether the target minor version supports the rollback approach you plan, because a rollback is only safe when post-deploy migrations have not changed data in ways the old version cannot read. Agree the go or no-go conditions before the window opens, not during it.

Rollback guide

Medplum upgrade steps on AWS CDK, in order

This sequence moves a self-hosted Medplum stack on AWS from one minor version to the next, separating image-only changes from infrastructure changes so each deploy has a known state and a rollback checkpoint. Following it in order keeps the team able to tell which change caused a problem.

  1. Confirm current version and next minor

    The platform engineer records the running Medplum server version and reads the upgrading guide to find the next minor version in the sequence. Medplum requires self-hosted servers to pass through each minor version in order, so skipping a minor (for example, jumping from v3.1.2 straight to v4.3.4) causes startup failures. Done when the target version for this hop is written in the change ticket and the latest patch for that minor is identified on the releases page.

  2. Rehearse the change in staging first

    The team applies the same version and CDK configuration to a staging stack that mirrors production's database size, instance types and settings as closely as practical. They confirm that the server starts, that the stack deploys cleanly and that sign-in and key API calls work. Done when staging shows a healthy server on the target version and the team has recorded any manual steps needed in production. Staging does not prove production timing, because post-deploy migrations depend on dataset size.

  3. Record the rollback checkpoint before changing anything

    Before production changes, the engineer captures the current serverImage value, the CDK configuration file and a recent database snapshot, and notes the Git commit that produced the running stack. Medplum's rollback guide describes rolling back by redeploying a previous version with the standard process, so the team needs the prior image reference ready. Done when the previous state can be reproduced from version control and the snapshot is confirmed complete.

  4. Update the server image for image-only releases

    When the minor release changes only the server image, the engineer runs medplum aws update-server with the target version, which is the standard process Medplum's rollback guide describes for AWS deployments. The command updates the server image without a separate CDK change. Done when the command completes and the deployment reports the new image as active. Check the CLI help or the upgrading guide for the exact arguments in your CLI version.

  5. Review CDK diff for infrastructure changes

    When the release requires infrastructure changes, such as new settings in the CDK config file (for example serverImage, desiredServerCount, rdsInstances or maxAzs), the engineer updates the config and runs npx cdk diff. The reviewer checks every resource replacement, deletion and IAM change, and confirms that Parameter Store values referenced by the stack are present and correct. Done when the diff is approved in writing by someone other than the author and any replacement of the database or load balancer has a documented plan.

  6. Deploy and verify server health and logs

    The engineer runs npx cdk deploy against the approved diff and watches the rollout until the new tasks report healthy. They then check the server health endpoint, read the startup logs for migration or schema errors and confirm that the server connects to PostgreSQL and Redis. Done when the stack reports a successful deployment, the server responds on the target version and the logs show no startup errors. Keep the rollback checkpoint open until the next step is complete.

  7. Wait for post-deploy migrations before the next minor

    Medplum may run post-deploy data migrations after startup, and these can run for hours or days on large datasets. The operator tracks their progress through the async job tooling and does not start the next minor until the migrations for this version have completed. Done when migration jobs report completion and the team confirms that application behavior is normal. Only then should the next hop in the upgrade path begin, and each hop repeats this sequence with its own rollback checkpoint.

Ordering application and infrastructure changes safely

The order in which you apply a new server image and CDK infrastructure changes matters because the two can depend on each other, and the right order depends on what each Medplum release actually changes. Before you run anything, read the release notes for the target version and check whether they call out infrastructure requirements, new or changed CDK settings, or database-related work. If a release only changes the server image, the image update is the whole change. If it changes both, you need to decide which side goes first, and that decision should follow from the release notes rather than from habit. Also confirm where your minor-by-minor sequence places this release, since each stop on the path can carry its own combination of application and infrastructure changes.

When one release needs both kinds of change, keep them separate in your plan and your change records. Treat the server image update (run through the Medplum CLI, for example medplum aws update-server) and the infrastructure update (a npx cdk diff review followed by npx cdk deploy) as distinct steps with their own checkpoints. Review the CDK diff carefully before deploying, and confirm that it shows only the changes you expect. Parameter Store values are the link between the two. The stack reads settings from Parameter Store, so values that the new version depends on must already match the target version before the change that uses them is applied. Check the serverImage value and any other settings in your CDK configuration against the version you are moving to, and confirm with the Medplum AWS CDK settings reference which keys your target release expects. Record the exact values in your change ticket so a rollback does not depend on memory.

What drives the effort of a Medplum upgrade

This table compares the drivers that change how much work a Medplum upgrade on AWS with CDK takes, the effect each one has on effort, and what to check before the window opens. Read it as a planning checklist: the drivers that multiply effort most are minor version distance, dataset size and the number of environments kept in step.

DriverEffect on effortWhat to check
Minor versions between running and targetEach minor is a separate stop with its own deploy and checks, so effort grows with every step in the pathConfirm the full sequence of minors in the upgrading guide and do not skip any, since skipping causes startup failures
Dataset size and post-deploy migration timeLarge datasets can keep post-deploy migrations running for hours or days, which sets the length of the windowMeasure current data volume in staging and confirm with Medplum how long migrations ran on comparable data
Custom CDK code and stack changesHand-edited constructs or extra resources mean the cdk diff needs manual review and can block a clean deployRun npx cdk diff on the current code before upgrading and list every change that is not generated by the standard template
Number of environments kept in stepEach environment repeats the stop sequence, and drift between them adds reconciliation workAgree on one version and config file per environment and record which minor each one is running
Parameter Store and secrets handlingSettings such as the server image reference and database values must match across stacks, and mistakes surface only at deploy timeReview the parameters the stack reads, confirm who can change them, and check that secret values are not copied into config files
Staging test scopeBroader tests on the new version add time per stop but reduce the chance of a failed production windowDefine the flows that must pass at each minor, such as sign-in, key API calls and Bot execution, before approving the next stop
Availability needs during the windowTight uptime requirements push teams toward a longer, more deliberate sequence with a deferred migration planConfirm acceptable downtime with clinical and operations owners and decide whether post-deploy migrations run during or after the window

Common questions before a Medplum upgrade on AWS CDK

What drives the cost of a Medplum upgrade on AWS CDK?

The biggest drivers are how many minor versions sit between your running release and the target, how large the database is, and how much of your own code or integrations must change. Each minor version is a separate deploy, verification and sign-off step, so a multi-minor path costs more than a single hop. Ask any partner for a quote that lists the number of stops, the staging rehearsals, the infrastructure changes (for example, a CDK diff that touches the database or networking), the post-deploy migration monitoring, the rollback plan and the handover documentation. Separate one-time project work from any retainer for ongoing upgrades and patch cycles, since Medplum ships patch versions weekly and minors a few times a year.

How long does a Medplum upgrade take, and why does data size matter?

Duration depends mainly on the number of minor versions to cross and on how long each post-deploy data migration runs. Medplum's upgrading guide notes that these migrations can run for hours or days on large datasets, and you cannot safely move to the next minor until the current migration completes. A small test dataset will finish quickly in staging and hide this cost, so ask for a rehearsal against a copy that resembles production volume. Also ask how the plan handles waiting time between stops, since that waiting is often the longest part of the schedule.

What does the upgrade need from our team?

You need AWS access with rights to run the CDK deploy and read CloudFormation and RDS state, access to the Parameter Store values and the CDK config file, and a staging environment that mirrors production. Change approval is required for each deploy, and the infrastructure diff should be reviewed before anyone applies it. Plan a maintenance window for the cutover and for any stop where a migration blocks normal traffic. Your engineers also need to own application code changes at major boundaries and confirm that integrations still behave after each step.

Can our internal team run a Medplum CDK upgrade alone?

Yes, if your engineers have working AWS CDK experience, can read a CDK diff, and have time to follow each minor version in sequence with staging tests. The Medplum upgrade commands are short, but the work around them is not: reviewing release notes, checking config changes, watching async migrations and deciding when a stop is safe. Teams with no prior CDK or Medplum operations experience usually need either training or outside help for the first upgrade. DeployOpen can plan, implement and document the upgrade inside your AWS account under a fixed-scope agreement, and can offer a retainer for later cycles.

How does a rollback work, and when is it unsafe?

Medplum's rollback guide describes deploying a new minor version with the standard process, typically medplum aws update-server for AWS deployments, and rolling back means redeploying the previous server image. A rollback is only simple while the database schema and data remain compatible with the older server. Once a post-deploy migration has changed data in a way the older version cannot read, reverting the image is not enough and you need a restore from backup. Keep a rollback window open by deferring post-deploy migrations until the new version is validated, and confirm your RDS snapshot and recovery steps before the deploy starts.

What happens if we skipped a minor version?

Skipping minor versions is not supported for self-hosted Medplum. Medplum's upgrading guide gives the example of moving from v3.1.2 straight to v4.3.4, which causes startup failures, so the fix is to go back and apply each minor in sequence. Start by identifying the running version and the target, then list every minor between them and the latest patch for each. Do not attempt a single large jump in production to save time. Ask your partner to produce a stop-by-stop plan before any change is made, and to test each stop in staging first.

Which config values change during an upgrade and what should we check?

The CDK config file holds values such as serverImage, desiredServerCount, rdsInstances and maxAzs, and changing them alters what CloudFormation will create or replace. Before each deploy, run npx cdk diff and read every line that touches the database, load balancer or networking, because replacement of a stateful resource is the most serious risk. Settings stored in AWS Parameter Store must be checked against the target version's documentation so that no required value is missing. Record each config change in version control so the rollback path is clear.

Do we need a rollback plan if the upgrade touches only the server image?

Yes. A server image change still runs post-deploy migrations against your database, so the rollback question remains even when the infrastructure diff is small. Confirm that a recent database snapshot exists, that the previous image tag is recorded, and that someone can run the rollback steps without the original engineer. Medplum's compliance documentation describes compliance as a shared responsibility between Medplum and its customers, so your change records and backup evidence also matter to your auditors.

How DeployOpen scopes, delivers and supports a Medplum upgrade

DeployOpen treats an upgrade of a Medplum stack deployed with the AWS CDK as a written, fixed-scope change to your infrastructure and application settings. The work is planned against your current version, your CDK config and your rollback requirements, then built and verified in a staging environment that matches production before anything changes in production.

How we scope

  • We record your current Medplum version, CDK project state, and the serverImage and infrastructure settings in use.
  • The written scope names the target version, the environments covered, and who approves each production change.
  • We confirm the rollback window and whether post-deploy migrations will run before the new version is accepted.
  • Engagements are fixed-scope, so deliverables and timelines are agreed in writing before work starts.

How we build

  • We run the CLI server image update and the CDK diff in staging first, and review every infrastructure change line by line.
  • We check that Parameter Store values and CDK config keys match the target version before deploying.
  • We sequence application and infrastructure changes and test each stop against your health and smoke checks.
  • We keep a record of each diff, deploy output and verification result for your change review.

How we hand over

  • You receive a runbook covering the exact commands, config changes, diff review steps and the order of operations.
  • The handover documents the rollback procedure, including the conditions under which rolling back is safe for your data.
  • We walk your platform and security team through the post-deploy checks and the monitoring signals to watch.
  • Documentation is written for your engineers to repeat the upgrade on the next minor version without us.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for teams that want a standing partner.
  • A retainer can cover tracking new Medplum patch, minor and major releases against your deployment.
  • Retested changes, updated runbooks and a fresh diff review follow each upgrade cycle under the agreed scope.
  • Ask for the retainer terms, response expectations and change-control process in writing before you commit.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.