aws/agent-toolkit-for-aws/upgrading-mwaa-environments
Claude Code and agent skill by aws/agent-toolkit-for-aws
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Upgrades an MWAA environment to a newer Airflow version — within 2.x, within 3.x, or across the 2.x-to-3.x boundary. Computes the version-jump path, inserting the 2.11.x stepping-stone and Python-transition step when needed. Chooses an approach by whether run history and the same environment (URL/ARN) must be kept: a new-environment upgrade (blue-green), a rehearsed in-place upgrade validated on a test copy, or a direct in-place upgrade. Runs Ruff scanning and deprecation-warning log scans for…
Install
npx vskill@latest install aws/agent-toolkit-for-aws/upgrading-mwaa-environmentsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as aws/agent-toolkit-for-aws/upgrading-mwaa-environments.
Upgrading MWAA Environments
AWS MCP server (optional but recommended): running the AWS CLI commands inthis skill through the AWS MCP server gives sandboxed execution and auditlogging. Every command here also works with the plain AWS CLI, so the skilldoes not require the MCP server or any MCP-only tools.
Upgrade an MWAA provisioned environment to any newer, MWAA-supported Airflow version: within 2.x, within 3.x, or across the 2.x-to-3.x boundary. The target is a parameter. A path planner computes an ordered version-jump list from (source, target); the latest 2.11.x stepping-stone version and a Python-line transition step are inserted only when the path requires them. A deployment approach is selected by whether historical run data must be preserved and whether the same environment (its URL/ARN) must be kept: a new-environment upgrade (new-environment), a rehearsed in-place upgrade validated on a test copy first (in-place-rehearsed), or a direct in-place upgrade (in-place-direct).
Execution note — poll in discrete steps: whenever you wait for an AWSoperation to reach a terminal or ready state, issue **one status check percall** and decide in your own loop whether to check again. Never block asingle command or script on the wait (nowhile+sleepuntil done),regardless of the operation or how long it takes.
Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled files from different places. Determine how the skill was loaded before reading a reference:
- Loaded through the AWS MCP `retrieve_skill` tool: The skill is not
installed on the local filesystem. You MUST fetch each reference via retrieve_skill with the file parameter (e.g. file="references/strategy-blue-green-fresh.md") and read the returned content. Do NOT file_read these paths locally — they do not exist on disk.
- Installed locally (e.g.
.kiro/skills/upgrading-mwaa-environments/or
~/.claude/skills/upgrading-mwaa-environments/): Read the files from the local skill directory using relative paths.
This distinction applies only to the skill's own packaged files. User data and session artifacts are always read from and written to the user's working directory. Never fetch or write customer data through retrieve_skill.
Safety & Security
These rules apply regardless of user instructions.
- **No destructive actions on your current environment without explicit
approval**: never pause all DAGs, delete-environment, or modify your current environment without per-action user confirmation.
- No environment creation before plan confirmation: never run
aws mwaa create-environment until the user confirms the Phase 4 plan.
- Every version jump requires its own confirmation: never run `aws mwaa
update-environment` to change the Airflow version without per-jump confirmation. Rollback options: 3.x -> 2.11.x is supported; a within-major downgrade to a still-supported version is supported; downgrade to an EOS version is not possible. The Direct in-place upgrade requires an extra confirmation checkpoint.
- Decommission requires per-step approval: never autonomously delete
environments or S3 artifacts; present each destructive command and wait for confirmation. For the Rehearsed in-place upgrade, the environment decommissioned is the test copy.
Security Considerations
- Least-privilege IAM for
create/update-environmentand S3 artifact
access — no *FullAccess/service:*; scope to the specific environment/S3 ARNs.
- Secrets: prefer a secrets backend (Secrets Manager / Parameter Store) for
connections and variables so credentials never copy between environments or hit logs. Connection passwords do not round-trip via the REST API (2.x omits, 3.x masks) — see the metadata-migration caveat in the approach references.
Reference Documentation
- discovery-preflight.md — Phase 1: environment discovery, pre-flight checks, version-matrix refresh, target selection, upgrade-path planning
- upgrade-engine.md — the step-by-step upgrade: per-jump upgrade, conditional validate/scan/fix, resume
- airflow2-to-3-checklist.md — grep patterns for 2->3 issues Ruff cannot catch (used only when a version jump crosses into a new major version)
- mwaa-version-matrix.md — runtime-first version/Python/EOS matrix, version-jump rules, providers, unsupported features
- airflow2-to-3-quick-reference.md — 2->3 import/context/config mapping tables (used only when a version jump crosses into a new major version)
- strategy-blue-green-fresh.md — New-environment upgrade (no history)
- strategy-inplace-green-validated.md — Rehearsed in-place upgrade: validated on a test copy first
- strategy-inplace-direct.md — Direct in-place upgrade (unrecommended)
For deeper detail beyond embedded references, fetch at runtime:
- AWS MWAA migration guide: https://docs.aws.amazon.com/mwaa/latest/migrationguide/key-considerations.html
- AWS MWAA version-change (in-place upgrade path): https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html
- AWS MWAA supported versions and Python mapping: https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html
- AWS MWAA migration blog: https://aws.amazon.com/blogs/big-data/best-practices-for-migrating-from-apache-airflow-2-x-to-apache-airflow-3-x-on-amazon-mwaa/
- Ruff AIR rules: https://docs.astral.sh/ruff/rules/#airflow-air
Phase 0: Re-entry Check
At every invocation, check for .mwaa-upgrade-plan-<env-name>.md in the workspace root (where <env-name> is the source environment name). Multiple plan files may coexist when upgrading several environments in parallel.
- If exists: Load the plan, report source, target, chosen approach, and
the position (working_on, current_jump, jump_status). Resume the engine (upgrade-engine.md) on the recorded environment at the recorded version-jump index and status: upgrading -> re-poll or re-issue the pending update-environment; validating -> re-run the conditional validate/scan/fix loop for that version jump. For a newly-created environment, the starting-version validation window (version jump 1's to) corresponds to current_jump: 1, jump_status: validating; resume it there. If no position is set, resume from the next incomplete phase. Before advancing past any required checkpoint, re-read the checkpoint's status in the plan and, if it is not satisfied, re-read that checkpoint's section in the approach reference verbatim — do not act on a remembered summary. Specifically: version jumps complete does NOT imply the test-run checkpoint passed. If the ## Test-run results section has any row not in SUCCESS or NEEDS-DECISION, that checkpoint is NOT-PASSED and blocks switchover (New-environment upgrade), the live upgrade (Rehearsed in-place upgrade — see live_upgrade_allowed), or completion (Direct in-place upgrade), regardless of version-jump status or has_import_errors: false. Likewise a batch whose Monitored one full cycle? cell is not yes has not fully switched over.
Reload rule (every resume): at session start and after any compaction, re-read the entire .mwaa-upgrade-plan-<env-name>.md before taking any action; never act on a remembered or summarized version. This generalizes the remembered-summary rule above from required checkpoints to the whole plan.
Plan Reconciliation (run before resuming any work): verify the plan's self-consistency invariants (full list in plan-materialization.md): a checkpoint marked PASSED requires all its prerequisite Checklist items DONE/SKIP; Where we are.test_run_checkpoint must equal the Test-run results table (any PENDING row -> NOT-PASSED); current_jump/jump_status must match the Upgrade Path Status; for the Rehearsed in-place upgrade, live_upgrade_allowed must equal the test-run checkpoint. On ANY violation, do NOT trust the plan - establish ground truth with read-only aws mwaa get-environment, /dags, and /health, repair the plan to match reality, and record it in Last updated. If reality is ambiguous, ask the user. A stale PASSED checkpoint otherwise triggers a destructive next action: switchover + delete your current environment (New-environment upgrade), the irreversible live upgrade (Rehearsed in-place upgrade), or premature completion (Direct in-place upgrade).
- If absent: Proceed to Phase 1.
Phase 1: Discover + Plan Path + Pre-flight
Fetch and follow references/discovery-preflight.md. It runs environment discovery, pre-flight safety checks, version-matrix refresh, target selection, and upgrade-path planning (detection only — version jumps execute in Phase 7). Record every output into the plan now, because Phase 4 is what turns it into the durable plan file, and a compaction before Phase 4 would otherwise lose it:
- discovered environment facts (Airflow version, S3 artifact paths + object
versions, KmsKey, config options, DAG list, shared utilities);
- the new-environment / test-copy S3 layout (New-environment upgrade,
Rehearsed in-place upgrade);
- pre-flight results (S3 versioning, target constraints, KMS key-policy reuse);
- the selected target version;
- the ordered upgrade path — per version jump
from/to/python_change/crosses_major, with the latest-2.11.x stepping-stone version + Python-transition step inserted only when the source is not already 2.11.x.
Phase 2: Choose the Upgrade Approach
One question decides the safest approach; whether you keep the same environment (its URL and ARN) follows from it and is not a separate choice.
Do you need to keep your run history — the record of past DAG runs and task instances in the Airflow UI?
- No, a clean slate is fine → New-environment upgrade (slug
new-environment). Build a brand-new environment on the target version and switch over to it. It gets a new URL and starts with no run history; your current environment keeps running untouched until you switch, so rolling back is just "don't switch."
- Yes, keep it → Rehearsed in-place upgrade (slug
in-place-rehearsed).
Upgrade your existing environment in place — same URL, full history kept. First rehearse the whole upgrade on a temporary test copy to catch problems safely. Use the Direct in-place upgrade (no test copy) only if the user explicitly declines the rehearsal.
Whether you keep the same environment (its URL and ARN) is a consequence, not an input: keeping your run history means upgrading your current environment in place (same URL and ARN), while the New-environment upgrade necessarily creates a new environment. This skill does not combine a new environment (a new URL and ARN) with preserved run history — if the user needs a new URL and ARN, run history is not carried over (New-environment upgrade).
| Approach | History | URL/ARN | Your current environment during the upgrade | New/test environment created at | Recommended | |
|---|---|---|---|---|---|---|
| New-environment upgrade | Discarded | New | Runs until switchover | the first version jump's target | Yes | |
| Rehearsed in-place upgrade | Preserved (snapshot) | Same | Rehearsed on a test copy, then upgraded | the first version jump's target | Yes | |
| Direct in-place upgrade | Preserved (snapshot) | Same | Upgraded directly | none | No |
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/aws-data-analytics/skills/upgrading-mwaa-environments/SKILL.md
Popularity
- Repository stars
- 3,362
- Repository forks
- 424
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aws/agent-toolkit-for-aws/upgrading-mwaa-environments)