• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

authoring-mwaa-workflow

プラグイン
aws-data-analytics
ソース
GitHub で見る ↗
説明

# MWAA ワークフロー アーティファクト作成・デプロイ Amazon Managed Workflows for Apache Airflow(MWAA)のワークフロー成果物を作成・デプロイします。プロビジョニング環境向けの Python Airflow DAG(有向非環状グラフ)またはサーバーレス環境向けの YAML ワークフローファイルに対応しています。 ## 対応範囲 オペレーター(処理実行モジュール)の選択、タイムアウト設計、リトライ戦略、スケジューリング設定、失敗通知、べき等性(同じ操作を何度実行しても結果が変わらない性質)、MWAA サーバーレス スキーマへの適合性をカバーします。 アーティファクトのデプロイ(S3 への DAG アップロードまたはサーバーレスの CreateWorkflow/UpdateWorkflow API)、承認後のインライン環境作成、修正の再デプロイに対応し、オプションでテスト用プラグイン(testing-mwaa-workflow)へ引き継ぎます。 ## 次のような場合に使用 DAG を作成する、パイプラインを書く、ワークフローを構築する、タスクをオーケストレーション(統合管理)する、Airflow DAG を使う、データパイプラインを構築する、ジョブをスケジュール設定する、DAG をデプロイする、ワークフローをデプロイする、YAML ワークフローを使う ## 非対応 既存 DAG のプロビジョニング環境とサーバーレス環境間の変換・移行、デプロイ済みワークフローの実行・動作確認テスト(testing-mwaa-workflow で対応)、失敗実行の診断(debugging-mwaa-workflow で対応)

原文を表示

Authors and deploys MWAA workflow artifacts: Python Airflow DAGs for provisioned environments or YAML workflow files for Serverless. Covers operator selection, timeout design, retry strategy, scheduling, failure notifications, idempotency, and MWAA Serverless schema compliance. Deploys the artifact (S3 DAG upload or Serverless CreateWorkflow/UpdateWorkflow), creates an environment inline when approved, and redeploys fixes, then optionally hands off to testing-mwaa-workflow. Triggers on: create a DAG, write a pipeline, build a workflow, orchestrate tasks, Airflow DAG, data pipeline, schedule a job, deploy a DAG, deploy a workflow, YAML workflow. Not applicable to converting or migrating existing DAGs between provisioned and serverless (conversion is out of scope), running or smoke-testing a deployed workflow (handled by testing-mwaa-workflow) or diagnosing a failed run (handled by debugging-mwaa-workflow).

ユースケース
  • Airflow DAGを作成する
  • データパイプラインを構築する
  • ワークフローをMWAAにデプロイする
  • タスクをオーケストレーションする
  • ジョブをスケジュール設定する
本文(日本語訳)

Amazon MWAAのワークフロー作成

AWS MCP サーバー(オプション、ただし推奨): このスキルのAWS CLIコマンドをAWS MCPサーバーで実行すると、隔離された実行環境と監査ログが得られます。ここに記載されたすべてのコマンドは、通常のAWS CLIでも動作するため、このスキルはMCPサーバーやMCP専用ツールを必須とはしていません。

Amazon MWAAの本番環境対応ワークフロー成果物を作成します。2つのいずれかのパスへ振り分けます:Python DAG(専有環境版)またはYAMLワークフロー(サーバーレス版)。

実行上の注意 — 段階的に状態確認: AWSの操作が終了状態や準備完了状態に到達するのを待つときは、呼び出しごとに1回だけ状態確認を行い、独自のループで再確認するかどうかを決定してください。操作時間がどれだけかかっても、単一のコマンドやスクリプトを待機状態でブロックしないでください(while+sleepのように完了まで待たない)。

ガイドライン — このスキル自身のファイルの位置(MCP vs ローカルインストール)

このスキルは2つの方法で読み込むことができ、スキル内蔵ファイルの参照元が異なります。参照を読む前にスキルの読み込み方法を確認してください:

  • AWS MCP のretrieve_skillツールで読み込まれた場合: スキルはローカルファイルシステムにインストールされていません。retrieve_skillをfileパラメータで呼び出し(例:file="references/authoring-provisioned-dag.md")、返されたコンテンツを読む必要があります。これらのパスをfile_readでローカル読みしないでください — ディスク上に存在しません。
  • ローカルにインストールされている場合(例:.kiro/skills/authoring-mwaa-workflow/または~/.claude/skills/authoring-mwaa-workflow/):相対パスを使ってローカルスキルディレクトリからファイルを読んでください。

この区別はスキル内蔵ファイルにのみ適用されます。ユーザーデータとセッション成果物は常にユーザーの作業ディレクトリとの間で読み書きされます。retrieve_skillを使ってカスタマーデータを取得・書き込みしないでください。

ステップ0:パスの振り分け

この順序で評価してください:

  1. 解決可能な対象が指定されている? 対象参照は、他のキーワードに関わらず確定的な振り分け信号です:

    • 専有環境(arn:aws:airflow:<region>:<account>:environment/<name>のようなARN、またはaws mwaa get-environmentで解決可能な名前)→ パスAへ。
    • サーバーレスワークフロー ARN(arn:aws:airflow-serverless:<region>:<account>:workflow/<name>)→ パスBへ。
  2. 両方のパスのキーワードが含まれている? リクエストに両方のパスのキーワードが含まれており、解決可能な対象がない場合は、意図で曖昧性を解消してください:

    • PythonOperatorはサーバーレスでもサポートされているため、演算子レベルのpythonヒント(PythonOperator、python_callable、「Python関数/タスク」)がパスB信号(yaml、serverless、ワークフローARN)と並行してある場合、曖昧ではありません → パスBへ。
    • 変換コンテキスト(「Python DAGをサーバーレスに変換してほしい」)→ このスキルは適用外です。変換はスコープ外です。
    • 本物の専有環境ヒント(Python DAG、provisioned)とサーバーレスヒントが対象なしで並行している → 確認質問をしてください。
  3. ちょうど1つのパスキーワード? デプロイ対象項のみをパスA信号と見なしてください:provisioned、Python DAG、または「環境向けの.py」→ パスAへ。yamlまたはserverless→ パスBへ。演算子レベルのPythonについては、パスA信号ではありません。

  4. 振り分け信号がない? 「DAG」または「Workflow」のみでは曖昧です — パスを示しません。確認してください:対象は MWAA専有環境(Python DAG) ですか、それとも MWAAサーバーレス(YAML) ですか?


パス

振り分けたパスの参照に従ってください(他方のパスの参照は不要です):

  • パスA — Python DAG(MWAA専有環境): references/authoring-provisioned-dag.md
  • パスB — YAMLワークフロー(MWAAサーバーレス): references/authoring-serverless-workflow.md

振り分けたパスの作成ステップの後、下記のデプロイとテストに進んでください。

デプロイとテスト(オプション、作成後)

作成スキルはすべてのデプロイと再デプロイを担当します。詳細はreferences/deploying-mwaa.mdを参照してください。

ステップ

  1. 提示 — 成果物がスケジュールを持つかどうかに基づいてオプションを提示します。パスに適した表現で質問を組み立ててください:

    • 専有環境: 「このDAGを環境にデプロイする」(DAGは環境のS3バケットにアップロードされます)。
    • サーバーレス: 「このワークフローをデプロイする」(ワークフローはスタンドアロンリソースです — 「環境にデプロイ」とは言わないでください)。

    DAG/ワークフローがスケジュールを持つ場合:

    • デプロイしてテストする — デプロイ、一時停止解除、今すぐ実行トリガー
    • デプロイして一時停止を解除する — デプロイ、一時停止を解除、スケジュール通りに実行させる(今すぐのトリガーなし)
    • デプロイのみ — S3にアップロード、一時停止状態のまま

    DAG/ワークフローがスケジュールを持たない場合(手動トリガーのみ):

    • デプロイしてテストする — デプロイ、今すぐ実行トリガー
    • デプロイのみ — S3にアップロード、一時停止状態のまま(「一時停止解除」オプションなし — スケジュールするものがありません)

    ユーザーはすべてのオプションを辞退することもできます。

  2. デプロイ:

    • 専有環境: DAGを環境のSourceBucketArn/DagS3Pathにアップロードします。デプロイ後の確認を実行(deploying-mwaa.mdを参照)して、スケジューラーが新しいファイルをインポートエラーやdag_id競合なく解析したことを確認します。環境が存在せずユーザーが承認した場合、インラインで環境を作成(計画-検証-実行 + 明示的確認)し、CREATING → AVAILABLEをポーリングします(約20~40分)。ユーザーは既存環境を提供することもできます。
    • サーバーレス: CreateWorkflow(新規)またはUpdateWorkflow(再デプロイ)。YAMLはここで同期的に検証されます。ワークフローがPythonOperator/BashOperatorを使う場合は、最初にコードパッケージをS3にビルド・アップロードし、--code経由で渡してください(references/serverless-code-packaging.mdとreferences/deploying-mwaa.mdを参照)。ユーザーは既存ARNを提供することもできます。
    • 再デプロイ(修正ループ): 同じアップロード/UpdateWorkflowパスを、testing-mwaa-workflowが成果物または環境の修正を委譲するときに再利用します。
  3. 「デプロイして一時停止を解除」が選択された場合 — ステップ2に従ってデプロイし、一時停止を解除します。実行トリガーやtesting-mwaa-workflowの呼び出しはしないでください。

  4. 「デプロイしてテストする」が選択された場合 — ステップ2に従ってデプロイ、必要に応じて一時停止を解除し、解決された対象(環境名 + dag_id、またはワークフローARN)を使ってtesting-mwaa-workflowを呼び出します。その委譲はtestingの委譲呼び出しモードです。

ハード制限: テストが要求された場合 — 最初から(「デプロイしてテスト」)か会話の後で(「テストして」「実行して」「試して」)かに関わらず、testing-mwaa-workflowを必ず呼び出す必要があります。DAG実行を手動でトリガー、監視、確認しないでください。「デプロイして一時停止を解除」はテスト要求ではなく、デプロイのみのアクションです。

  • 本番安全性: create-environment、update-environment、create-workflow、update-workflowは状態を変更するため、各々の影響を明示して確認してください。本番名の対象について警告してください。

トラブルシューティング

エラー 原因 修正
dagrun_timeout が DAG を早期に終了 呼び出されたサービス内のタイムアウト設定が短すぎる dagrun_timeout を上げるか、サービスタイムアウトを下げる
YAML検証がワークフローを拒否 型またはパラメータが誤り timedelta形式を使用、許可リストを確認
サーバーレスでオペレータが見つからない 許可リストに登録されていない サポートされたオペレータ、PythonOperator/BashOperator、またはLambdaを使用
サーバーレス実行:コード抽出不可 / 環境破損 不正なコードパッケージ zipルートにファイル、__pycache__なし、≤250 MB、再パッケージ化
サーバーレス Python タスク ImportError 依存関係なし、またはプラットフォームが合わないwhl manylinux2014_x86_64 / Py3.12 whlとしてバンドル、事前インストール済みパッケージをバンドルしない
テンプレート変数未定義 バージョン不一致 変数がAirflowバージョンと一致するか確認

参照

  • references/dag-patterns.md — Python DAGテンプレート
  • references/yaml-schema.md — MWAAサーバーレス形式
  • references/deploying-mwaa.md — デプロイ、インライン環境作成、再デプロイ
  • references/serverless-code-packaging.md — Python/Bashコードパッケージング、事前インストール済みパッケージ、制限
  • references/authoring-provisioned-dag.md — パスA:専有Python-DAG作成ステップ(A1~A7)
  • references/authoring-serverless-workflow.md — パスB:サーバーレスYAML作成ステップ(B1~B5)

セキュリティに関する考慮事項

  • 状態変更操作(create/update-environment、create/update-workflow、S3 DAGアップロード)は、影響を明示した明示的確認が必要です。本番名の対象について警告してください(デプロイのハード制限を参照)。
  • 最小権限IAM: A5チェックは成果物が必要とする正確なAction/Resourceペアのみを追加します — *FullAccessやservice:*は使用しません。
  • ハードコード化されたシークレット/エンドポイントなし: Airflow変数/接続をSecretsManagerまたはSSMパラメータストアで利用してください。DAGコードやCLI例では認証情報を出力しないでください。
  • サーバーレスコードパッケージ: ユーザー自身のモジュールとピン留めされたプラットフォーム対応whl のみを使用します — レビューされていないサードパーティバイナリは含めません。
  • データ保護: 機密データをSNS/CloudWatch通知ペイロードとログから遠ざけてください。それ
原文(English)を表示

Authoring MWAA Workflows

AWS MCP server (optional but recommended): running the AWS CLI commands in this skill through the AWS MCP server gives sandboxed execution and audit logging. Every command here also works with the plain AWS CLI, so the skill does not require the MCP server or any MCP-only tools.

Author production-grade workflow artifacts for Amazon MWAA. Routes to one of two paths: Python DAG (provisioned) or YAML workflow (Serverless).

Execution note — poll in discrete steps: whenever you wait for an AWS operation to reach a terminal or ready state, issue one status check per call and decide in your own loop whether to check again. Never block a single command or script on the wait (no while+sleep until 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/authoring-provisioned-dag.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/authoring-mwaa-workflow/ or ~/.claude/skills/authoring-mwaa-workflow/): 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.

Step 0: Route to Path

Evaluate in this order:

  1. Resolvable target provided? A target reference is a definitive routing signal regardless of other keywords:
    • A provisioned environment (ARN like arn:aws:airflow:<region>:<account>:environment/<name>, or a name resolvable via aws mwaa get-environment) → go to Path A.
    • A Serverless workflow ARN (arn:aws:airflow-serverless:<region>:<account>:workflow/<name>) → go to Path B.
  2. Both-path keywords present? If the request contains keywords from both paths and no resolvable target, disambiguate by intent:
    • PythonOperator is supported on Serverless, so an operator-level python cue (PythonOperator, python_callable, "Python function/task") alongside a Path B signal (yaml, serverless, workflow ARN) is NOT ambiguous → go to Path B.
    • Conversion context ("convert my Python DAG to serverless") → this skill does not apply; conversion is out of scope.
    • A genuine provisioned cue (Python DAG, provisioned) alongside a Serverless cue with no target → ask the clarifying question.
  3. Exactly one path keyword? Treat only deployment-target terms as Path A signals: provisioned, Python DAG, or "a .py for my environment" → go to Path A. yaml or serverless → go to Path B. Operator-level Python mentions are not Path A signals.
  4. No routing signal? "DAG" or "Workflow" alone is ambiguous — it does NOT indicate a path. Ask: is the target MWAA provisioned (Python DAG) or MWAA Serverless (YAML)?

Paths

Follow the reference for the path you routed to (you do not need the other path's reference):

  • Path A — Python DAG (MWAA Provisioned): references/authoring-provisioned-dag.md
  • Path B — YAML Workflow (MWAA Serverless): references/authoring-serverless-workflow.md

After the routed path's Write step, continue with Deploy & Test below.

Deploy & Test (optional, after Write)

Authoring owns all deployment and redeployment. Detail in references/deploying-mwaa.md.

Steps

  1. Ask — present options based on whether the artifact has a schedule. Frame the question using path-appropriate language:

    • Provisioned: "deploy this DAG to an environment" (DAGs are uploaded to an environment's S3 bucket).
    • Serverless: "deploy this workflow" (workflows are standalone resources — never say "deploy to an environment").

    If the DAG/workflow has a schedule:

    • Deploy and test — deploy, unpause, trigger a run now
    • Deploy and unpause — deploy, unpause, let it run on schedule (no immediate trigger)
    • Deploy only — upload to S3, leave paused

    If the DAG/workflow has no schedule (manual-trigger only):

    • Deploy and test — deploy, trigger a run now
    • Deploy only — upload to S3, leave paused (no "unpause" option — nothing to schedule)

    The user may also decline all options.

  2. Deploy:

    • Provisioned: upload the DAG to the environment's SourceBucketArn/ DagS3Path. Run post-deploy verification (see deploying-mwaa.md) to confirm the scheduler parsed the new file without import errors or dag_id conflicts. If no environment exists and the user approves, create one inline (plan-validate-execute + explicit confirmation), then poll CREATING -> AVAILABLE (~20-40 min). The user may instead supply an existing environment.
    • Serverless: CreateWorkflow (new) or UpdateWorkflow (redeploy); the YAML is validated synchronously here. If the workflow uses PythonOperator/BashOperator, first build and upload the code package to S3 and pass it via --code (see references/serverless-code-packaging.md and references/deploying-mwaa.md). The user may instead supply an existing ARN.
    • Redeploy (fix loop): the same upload / UpdateWorkflow path, reused when testing-mwaa-workflow delegates an ARTIFACT or ENVIRONMENT fix.
  3. If "Deploy and unpause" selected — deploy per step 2, then unpause. Do not trigger a run or invoke testing-mwaa-workflow.

  4. If "Deploy and test" selected — deploy per step 2, unpause if applicable, then invoke testing-mwaa-workflow with the resolved target (env name + dag_id, or workflow ARN). That hand-off is testing's delegated invocation mode.

HARD GATE: If testing is requested — whether upfront ("deploy and test") or later in the conversation ("test it", "run it", "try it") — you MUST invoke testing-mwaa-workflow. Do NOT trigger, monitor, or verify DAG runs manually. "Deploy and unpause" is NOT a test request — it is a deploy-only action.

  • Production safety: create-environment, update-environment, create-workflow, and update-workflow mutate state — confirm each with its impact stated. Warn on prod-named targets.

Troubleshooting

Error Cause Fix
dagrun_timeout kills DAG early < timeout set in service called Raise dagrun_timeout or lower service timeout
YAML validation rejects workflow Wrong type or param Use timedelta format; check allowlist
Operator not found in Serverless Not allowlisted Use a supported operator, PythonOperator/BashOperator, or Lambda
Serverless run: cannot extract code / corrupt env Bad code package Files at zip root, no __pycache__, ≤250 MB; repackage
Serverless Python task ImportError Missing dep or wrong-platform wheel Bundle as manylinux2014_x86_64 / Py3.12 wheel; don't bundle pre-installed packages
Template variable undefined Version mismatch Check vars for exact Airflow version

References

  • references/dag-patterns.md — Python DAG templates
  • references/yaml-schema.md — MWAA Serverless format
  • references/deploying-mwaa.md — deploy, inline env creation, and redeploy
  • references/serverless-code-packaging.md — Python/Bash code packaging, pre-installed packages, limits
  • references/authoring-provisioned-dag.md — Path A: provisioned Python-DAG authoring steps (A1–A7)
  • references/authoring-serverless-workflow.md — Path B: Serverless YAML authoring steps (B1–B5)

Security Considerations

  • State-mutating operations (create/update-environment, create/update-workflow, S3 DAG upload) require explicit confirmation with impact stated; warn on prod-named targets (see the Deploy HARD-GATE).
  • Least-privilege IAM: the A5 check adds only the exact Action/Resource pairs the artifact needs — never *FullAccess or service:*.
  • No hardcoded secrets/endpoints: use Airflow Variables/Connections backed by Secrets Manager or SSM Parameter Store; never emit credentials in DAG code or CLI examples.
  • Serverless code packages ship only the user's own modules plus pinned, platform-matched wheels — no unreviewed third-party binaries.
  • Data protection: keep sensitive data out of SNS/CloudWatch notification payloads and logs; rely on their encryption.
  • Secure defaults for inline-created resources: encrypt and lock down any S3/MWAA/SNS/CloudWatch resource this skill creates — see deploying-mwaa.md "Secure defaults".
  • AWS security best practices: verify the security posture against the MWAA User Guide's Security best practices page (and the MWAA Serverless equivalent) at runtime — AWS updates them over time; see deploying-mwaa.md "Secure defaults".

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。