Decide per instance
| Path | When |
|---|---|
| Rebuild from a new AMI with IaC | Stateless or well-automated servers |
| In-place upgrade on a clone (SSM Automation) | Hard-to-rebuild servers, legacy installers |
| Replatform | Apps that fit Elastic Beanstalk, ECS (Windows containers) or RDS |
| Stay temporarily with extended support | Vendor blocks the upgrade; buy time with ESUs where available |
1. Inventory with Systems Manager
aws ssm get-inventory --filters Key=AWS:InstanceInformation.PlatformName,Values="Microsoft Windows Server 2012 R2 Datacenter",Type=Equal \
--query "Entities[].Id" --output text
Or a broader view:
aws ssm describe-instance-information --filters Key=PlatformTypes,Values=Windows \
--query "InstanceInformationList[].[InstanceId,PlatformName,PlatformVersion,ComputerName]" --output table
2. In-place upgrade on a clone
AWS provides the AWSEC2-CloneInstanceAndUpgradeWindows Automation document. It creates an AMI of your instance, launches a temporary copy in a subnet you choose, runs the Windows setup upgrade there and produces an AMI of the upgraded server. Your original instance keeps running.
aws ssm start-automation-execution --document-name "AWSEC2-CloneInstanceAndUpgradeWindows" \
--parameters "InstanceId=i-0win2012,IamInstanceProfile=SSMInstanceProfile,SubnetId=subnet-isolated,TargetWindowsVersion=2022,KeepPreUpgradeImageBackUp=true,RebootInstanceBeforeTakingImage=false"
aws ssm get-automation-execution --automation-execution-id <id> --query "AutomationExecution.{status:AutomationExecutionStatus, outputs:Outputs}"
Check the document's current parameters with aws ssm describe-document --name AWSEC2-CloneInstanceAndUpgradeWindows — supported source/target versions and parameter names change over time.
Warning
Don't run the upgraded clone in the production subnet while the original is live — duplicate hostnames and AD computer accounts cause confusion. Use an isolated subnet for validation.
3. Validate the upgraded AMI
Launch a test instance from the output AMI in an isolated subnet:
- Windows boots,
winvershows the target version, activation OK. - Services and scheduled tasks start; app smoke test passes.
- Drivers: current ENA, NVMe and EC2Launch v2 (
Get-Service AmazonSSMAgent, EC2Launch).
4. Swap
- Change window: stop the original instance.
- Launch production from the upgraded AMI with the same private IP (or reattach the ENI/EIP), security groups, instance profile and tags.
- Rejoin the domain if needed; update DNS.
- Keep the original stopped (and its AMI) for the rollback window.
Domain controllers, SQL Server clusters and Exchange are excluded from in-place upgrades — add new servers and migrate roles instead.
5. Rebuild path
Use a current Windows Server AMI (or EC2 Image Builder golden image), install the app via SSM Run Command / State Manager, migrate data and switch the load balancer target or DNS.
Checklist
- Old-version inventory per account and region
- Decision per instance; owners agreed
- Clone-and-upgrade AMI validated in isolation
- Swap done in change window with rollback (original stopped, not terminated)
- Monthly report on remaining old versions