

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon MWAA 常見問答集
FAQs

此頁面說明使用 Amazon Managed Workflows for Apache Airflow 時可能遇到的常見問題。

**Contents**
+ [

## 支援的版本
](#q-supported-versions)
  + [

### Amazon MWAA 支援哪些 Apache Airflow v2？
](#airflow-support)
  + [

### 我可以使用哪個 Python 版本？
](#python-version)
+ [

## 使用案例
](#t-common-questions)
  + [

### 我可以將 Amazon MWAA 與 Amazon SageMaker Unified Studio 搭配使用嗎？
](#t-use-sagemaker-unified-studio)
  + [

### 何時可以使用 AWS Step Functions 與 Amazon MWAA？
](#t-step-functions)
+ [

## 環境規格
](#q-supported-features)
  + [

### 每個環境可以使用多少任務儲存體？
](#worker-storage)
  + [

### 用於 Amazon MWAA 環境的預設作業系統是什麼？
](#default-os)
  + [

### 我可以為 Amazon MWAA 環境使用自訂映像嗎？
](#custom-image)
  + [

### Amazon MWAA HIPAA 是否合規？
](#hipaa-compliance)
  + [

### Amazon MWAA 是否支援 Spot 執行個體？
](#spot-instances)
  + [

### Amazon MWAA 是否支援自訂網域？
](#custom-dns)
  + [

### 我可以在我的環境中使用 SSH 嗎？
](#ssh-dag)
  + [

### 為什麼 VPC 安全群組需要自我參考規則？
](#sg-rule)
  + [

### 我可以從 IAM 中的不同群組隱藏環境嗎？
](#hide-environments)
  + [

### 我可以在 Apache Airflow 工作者上存放臨時資料嗎？
](#store-data)
  + [

### 我可以指定超過 25 個 Apache Airflow 工作者嗎？
](#scaling-quota)
  + [

### Amazon MWAA 是否支援共用 VPCs 或共用子網路？
](#shared-vpc)
  + [

### 我可以建立或整合自訂 Amazon SQS 佇列，以管理 Apache Airflow 中的任務執行和工作流程協同運作嗎？
](#create-sqs)
+ [

## 指標
](#q-metrics)
  + [

### 使用哪些指標來判斷是否擴展工作者？
](#metrics-workers)
  + [

### 我可以在 CloudWatch 中建立自訂指標嗎？
](#metrics-custom)
+ [

## DAGs、運算子、連線和其他問題
](#q-dags)
  + [

### 我可以使用 `PythonVirtualenvOperator`嗎？
](#virtual-env-dags)
  + [

### Amazon MWAA 需要多長時間才能辨識新的 DAG 檔案？
](#recog-dag)
  + [

### Apache Airflow 為什麼不收取我的 DAG 檔案？
](#dag-file-error)
  + [

### 我可以`requirements.txt`從環境移除 `plugins.zip`或 嗎？
](#remove-plugins-reqs)
  + [

### 為什麼我的外掛程式不會顯示在 Apache Airflow v2.0.2 管理外掛程式選單中？
](#view-plugins-ui)
  + [

### 我可以使用 AWS 資料庫遷移服務 (DMS) 運算子嗎？
](#ops-dms)
  + [

### 當我使用 AWS 登入資料存取 Airflow REST API 時，是否可以將限流限制提高到每秒超過 10 筆交易 (TPS)？
](#increase-throttling-limit)
  + [

### Airflow 任務執行 API 伺服器在 Amazon MWAA 中的何處執行？
](#task-execution-server)

## 支援的版本


### Amazon MWAA 支援哪些 Apache Airflow v2？
Apache Airflow 支援

若要了解 Amazon MWAA 支援的內容，請參閱 [Amazon Managed Workflows for Apache Airflow 的 Apache Airflow 版本](airflow-versions.md)。

### 我可以使用哪個 Python 版本？
Python 版本

Amazon Managed Workflows for Apache Airflow 支援下列 Apache Airflow 版本。

**注意**  
自 2025 年 12 月 30 日起，Amazon MWAA 將終止對 Apache Airflow 2.4.3 版、2.5.1 版和 2.6.3 版的支援。如需詳細資訊，請參閱 [Apache Airflow 版本支援和常見問答集](airflow-versions.md#airflow-versions-support)。
從 Apache Airflow v2.2.2 開始，Amazon MWAA 支援直接在 Apache Airflow Web 伺服器上安裝 Python 需求、供應商套件和自訂外掛程式。
 從 Apache Airflow 2.7.2 版開始，您的需求檔案必須包含 `--constraint`陳述式。如果您未提供限制，Amazon MWAA 會為您指定一個，以確保您的需求中列出的套件與您正在使用的 Apache Airflow 版本相容。  
如需在需求檔案中設定限制的詳細資訊，請參閱[安裝 Python 相依性](working-dags-dependencies.md#working-dags-dependencies-syntax-create)。


| Apache Airflow 版本 | Apache Airflow 發行日期 | Amazon MWAA 可用性日期 | Apache Airflow 限制條件 | Python 版本 | 
| --- | --- | --- | --- | --- | 
|  [2.11.0 版](https://airflow.apache.org/docs/apache-airflow/2.11.0)  |  [2025 年 5 月 20 日](https://airflow.apache.org/docs/apache-airflow/2.11.0/release_notes.html#airflow-2-11-0-2022-05-20)  |  2026 年 1 月 7 日  |  [v2.11.0 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.11.0/constraints-3.12.txt)  |  [Python 3.12](https://peps.python.org/pep-0693/)  | 
|  [3.0.6 版](https://airflow.apache.org/docs/apache-airflow/3.0.6)  |  [2025 年 8 月 29 日](https://airflow.apache.org/docs/apache-airflow/3.0.6/release_notes.html#airflow-3-0-6-2025-08-29)  |  2025 年 10 月 1 日  |  [v3.0.6 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-3.0.6/constraints-3.12.txt)  |  [Python 3.12](https://peps.python.org/pep-0693/)  | 
|  [2.10.3 版](https://airflow.apache.org/docs/apache-airflow/2.10.3)  |  [2024 年 11 月 4 日](https://airflow.apache.org/docs/apache-airflow/2.10.3/release_notes.html#airflow-2-10-3-2024-11-04)  |  2024 年 12 月 18 日  |  [v2.10.3 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.10.3/constraints-3.11.txt)  |  [Python 3.11](https://peps.python.org/pep-0664/)  | 
|  [v2.10.1](https://airflow.apache.org/docs/apache-airflow/2.10.1)  |  [2024 年 9 月 5 日](https://airflow.apache.org/docs/apache-airflow/2.10.1/release_notes.html#airflow-2-10-1-2024-09-05)  |  2024 年 9 月 26 日  |  [v2.10.1 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.10.1/constraints-3.11.txt)  |  [Python 3.11](https://peps.python.org/pep-0664/)  | 
|  [2.9.2 版](https://airflow.apache.org/docs/apache-airflow/2.9.2)  |  [2024 年 6 月 10 日](https://airflow.apache.org/docs/apache-airflow/2.10.1/release_notes.html#airflow-2-9-2-2024-06-10)  |  2024 年 7 月 9 日  |  [v2.9.2 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.9.2/constraints-3.11.txt)  |  [Python 3.11](https://peps.python.org/pep-0664/)  | 
|  [2.8.1 版](https://airflow.apache.org/docs/apache-airflow/2.8.1)  |  [2024 年 1 月 19 日](https://airflow.apache.org/docs/apache-airflow/2.10.1/release_notes.html#airflow-2-8-1-2024-01-19)  |  2024 年 2 月 23 日  |  [v2.8.1 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.11.txt)  |  [Python 3.11](https://peps.python.org/pep-0664/)  | 
|  [2.7.2 版](https://airflow.apache.org/docs/apache-airflow/2.7.2)  |  [2023 年 10 月 12 日](https://airflow.apache.org/docs/apache-airflow/2.10.1/release_notes.html#airflow-2-7-2-2023-10-12)  |  2023 年 11 月 6 日  |  [v2.7.2 限制條件檔案](https://raw.githubusercontent.com/apache/airflow/constraints-2.7.2/constraints-3.11.txt)  |  [Python 3.11](https://peps.python.org/pep-0664/)  | 

如需遷移自我管理 Apache Airflow 部署或遷移現有 Amazon MWAA 環境的詳細資訊，包括備份中繼資料資料庫的說明，請參閱 [Amazon MWAA 遷移指南](https://docs.aws.amazon.com/mwaa/latest/migrationguide/index.html)。

## 使用案例


### 我可以將 Amazon MWAA 與 Amazon SageMaker Unified Studio 搭配使用嗎？


是。使用 Amazon SageMaker Unified Studio 工作流程，您可以在 Amazon SageMaker Unified Studio 中設定和執行一系列任務。Amazon SageMaker Unified Studio 工作流程使用 Apache Airflow 來建立資料處理程序的模型，並協調您的 Amazon SageMaker Unified Studio 程式碼成品。如需詳細資訊，請參閱[工作流程](https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/workflow-orchestration.html)一節。若要進一步了解 Amazon SageMaker，請參閱[什麼是 Amazon SageMaker？](https://docs.aws.amazon.com/next-generation-sagemaker/latest/userguide/what-is-sagemaker.html)

### 何時可以使用 AWS Step Functions 與 Amazon MWAA？


1. 您可以使用 Step Functions 來處理個別客戶訂單，因為 Step Functions 可以擴展以滿足一個訂單或一百萬個訂單的需求。

1. 如果您正在執行處理前一天訂單的隔夜工作流程，您可以使用 Step Functions 或 Amazon MWAA。Amazon MWAA 為您提供開放原始碼選項，以從您正在使用 AWS 的資源中抽象化工作流程。

## 環境規格


### 每個環境可以使用多少任務儲存體？


任務儲存體限制為 20 GB，並由 [Amazon ECS Fargate 1.4 指定。](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html#fargate-task-storage-linux-pv)RAM 的數量取決於您指定的環境類別。如需環境類別的詳細資訊，請參閱 [設定 Amazon MWAA 環境類別](environment-class.md)。

### 用於 Amazon MWAA 環境的預設作業系統是什麼？
預設作業系統

Amazon MWAA 環境是在執行 Amazon Linux 2 的 2.6 版及更舊版本的執行個體上建立，以及在執行 Amazon Linux 2023 的 2.7 版及更新版本的執行個體上建立。

### 我可以為 Amazon MWAA 環境使用自訂映像嗎？
自訂映像

不支援自訂映像。Amazon MWAA 使用建置在 Amazon Linux AMI 上的映像。Amazon MWAA `pip3 -r install`會針對您新增至環境 Amazon S3 儲存貯體的 requirements.txt 檔案中指定的需求執行 ，以安裝其他需求。

### Amazon MWAA HIPAA 是否合規？
HIPAA 合規

Amazon MWAA 符合[健康保險流通與責任法案 (HIPAA)](https://aws.amazon.com/compliance/hipaa-compliance/) 的資格。如果您有 HIPAA 商業夥伴增補合約 (BAA) AWS，您可以使用 Amazon MWAA 在 2022 年 11 月 14 日當天或之後建立的環境中處理受保護醫療資訊 (PHI)。

### Amazon MWAA 是否支援 Spot 執行個體？


Amazon MWAA 目前不支援 Apache Airflow 的隨需 Amazon EC2 Spot 執行個體類型。不過，Amazon MWAA 環境可以在 Amazon EMR 和 Amazon EC2 上觸發 Spot 執行個體。

### Amazon MWAA 是否支援自訂網域？
自訂網域

若要為您的 Amazon MWAA 主機名稱使用自訂網域，請執行下列其中一項操作：
+ 對於具有公有 Web 伺服器存取權的 Amazon MWAA 部署，您可以使用 Amazon CloudFront 搭配 Lambda@Edge 將流量導向您的環境，並將自訂網域名稱映射至 CloudFront。如需為公有環境設定自訂網域的詳細資訊和範例，請參閱 [Amazon MWAA 範例 GitHub 儲存庫中公有 Web 伺服器範例的 Amazon MWAA 自訂網域](https://github.com/aws-samples/amazon-mwaa-examples/tree/main/usecases/mwaa-public-webserver-custom-domain)。 GitHub 
+ 如需具有私有 Web 伺服器存取權的 Amazon MWAA 部署，請參閱 [設定 Apache Airflow Web 伺服器的自訂網域](configuring-custom-domain.md)。

### 我可以在我的環境中使用 SSH 嗎？
SSH 存取

雖然 Amazon MWAA 環境不支援 SSH，但可以使用 DAG 來執行使用 的 bash 命令`BashOperator`。例如：

```
from airflow import DAG
				from airflow.operators.bash_operator import BashOperator
				from airflow.utils.dates import days_ago
				with DAG(dag_id="any_bash_command_dag", schedule_interval=None, catchup=False, start_date=days_ago(1)) as dag:
				cli_command = BashOperator(
				task_id="bash_command",
				bash_command="{{ dag_run.conf['command'] }}"
				)
```

若要在 Apache Airflow UI 中觸發 DAG，請使用：

```
{ "command" : "your bash command"}
```

### 為什麼 VPC 安全群組需要自我參考規則？
自我參考規則

透過建立自我參考規則，您將來源限制為 VPC 中的相同安全群組，而且並非開放給所有網路。若要進一步了解，請參閱 [Amazon MWAA 上 VPC 的安全性](vpc-security.md)。

### 我可以從 IAM 中的不同群組隱藏環境嗎？
自訂指標

您可以在 中指定環境名稱來限制存取 AWS Identity and Access Management，但是，如果使用者可以存取一個環境，則無法在 AWS 主控台中使用存取篩選，他們可以存取所有環境。

### 我可以在 Apache Airflow 工作者上存放臨時資料嗎？
存放資料

您的 Apache Airflow Operators 可以將臨時資料存放在工作者上。Apache Airflow 工作者可以在您環境的 Fargate 容器`/tmp`上存取 中的暫存檔案。

**注意**  
根據 [Amazon ECS Fargate 1.4](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html#fargate-task-storage-linux-pv)，總任務儲存體限制為 20 GB。無法保證後續任務會在相同的 Fargate 容器執行個體上執行，這可以使用不同的`/tmp`資料夾。

### 我可以指定超過 25 個 Apache Airflow 工作者嗎？
工作者配額

是。雖然您可以在 Amazon MWAA 主控台上指定最多 25 個 Apache Airflow 工作者，但您可以透過請求增加配額，在 環境中設定最多 50 個工作者。如需詳細資訊，請參閱[請求提高配額](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)。

### Amazon MWAA 是否支援共用 VPCs 或共用子網路？
共享 Amazon VPC

Amazon MWAA 不支援共用 VPCs 或共用子網路。您在建立環境時選取的 Amazon VPC 必須由嘗試建立環境的帳戶擁有。不過，您可以將流量從 Amazon MWAA 帳戶中的 Amazon VPC 路由到共用 VPC。如需將流量路由至共用 Amazon VPC 的詳細資訊和範例，請參閱《*Amazon VPC Transit Gateways 指南*》中的[集中式傳出路由至網際網路](https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-nat-igw.html)。

### 我可以建立或整合自訂 Amazon SQS 佇列，以管理 Apache Airflow 中的任務執行和工作流程協同運作嗎？
共享 Amazon VPC

否，您無法在 Amazon MWAA 中建立、修改或使用自訂 Amazon SQS 佇列。這是因為 Amazon MWAA 會自動為每個 Amazon MWAA 環境佈建和管理自己的 Amazon SQS 佇列。

## 指標


### 使用哪些指標來判斷是否擴展工作者？
工作者指標

Amazon MWAA 會監控 CloudWatch 中的 **QueuedTasks** 和 **RunningTasks**，以決定是否在您的環境中擴展 Apache Airflow 工作者。若要進一步了解，請參閱 [Amazon Managed Workflows for Apache Airflow 的監控和指標](cw-metrics.md)。

### 我可以在 CloudWatch 中建立自訂指標嗎？
自訂指標

不在 CloudWatch 主控台上。不過，您可以建立在 CloudWatch 中寫入自訂指標的 DAG。如需詳細資訊，請參閱 [使用 DAG 在 CloudWatch 中寫入自訂指標](samples-custom-metrics.md)。

## DAGs、運算子、連線和其他問題


### 我可以使用 `PythonVirtualenvOperator`嗎？
PythonVirtualenvOperator

Amazon MWAA `PythonVirtualenvOperator`上未明確支援 ，但您可以建立使用 的自訂外掛程式`PythonVirtualenvOperator`。如需範例程式碼，請參閱 [為 Apache Airflow PythonVirtualenvOperator 建立自訂外掛程式](samples-virtualenv.md)。

### Amazon MWAA 需要多長時間才能辨識新的 DAG 檔案？


DAGs 會定期從 Amazon S3 儲存貯體同步至您的環境。如果您新增新的 DAG 檔案，Amazon MWAA 大約需要 300 秒才能開始使用**新的檔案。如果您更新現有的 DAG，Amazon MWAA 大約需要 30 秒才能辨識您的更新。

這些值、新 DAGs 的 300 秒，以及現有 DAGs 的更新 30 秒，[https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#min-file-process-interval](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#min-file-process-interval)分別對應至 Apache Airflow 組態選項 [https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dag-dir-list-interval](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dag-dir-list-interval)和 。

### Apache Airflow 為什麼不收取我的 DAG 檔案？


以下是此問題的可能解決方案：

1. 檢查您的執行角色是否具有足夠的 Amazon S3 儲存貯體許可。若要進一步了解，請參閱 [Amazon MWAA 執行角色](mwaa-create-role.md)。

1. 檢查 Amazon S3 儲存貯體是否已設定*封鎖公開存取*，並啟用*版本控制*。若要進一步了解，請參閱 [為 Amazon MWAA 建立 Amazon S3 儲存貯體](mwaa-s3-bucket.md)。

1. 驗證 DAG 檔案本身。例如，請確定每個 DAG 都有唯一的 DAG ID。

### 我可以`requirements.txt`從環境移除 `plugins.zip`或 嗎？
移除 plugins.zip 或 requirements.txt

目前，您無法在新增 plugins.zip 或 requirements.txt 後從環境中移除它們，但我們正在處理此問題。在此期間，解決方法是分別指向空白文字或 zip 檔案。若要進一步了解，請參閱 [刪除 Amazon S3 上的檔案](working-dags-delete.md)。

### 為什麼我的外掛程式不會顯示在 Apache Airflow v2.0.2 管理外掛程式選單中？
移除 plugins.zip 或 requirements.txt

基於安全考量，Amazon MWAA 上的 Apache Airflow Webserver 的網路輸出有限，且不會直接在 2.0.2 版環境的 Apache Airflow Webserver 上安裝外掛程式和 Python 相依性。列出的外掛程式可讓 Amazon MWAA 在 AWS Identity and Access Management (IAM) 中驗證您的 Apache Airflow 使用者。

若要能夠直接在 Web 伺服器上安裝外掛程式和 Python 相依性，建議您使用 Apache Airflow v2.2 和更新版本建立新的環境。Amazon MWAA 會直接在適用於 Apache Airflow v2.2 和更新版本的 Web 伺服器上安裝 Python 相依性和自訂外掛程式。

### 我可以使用 AWS 資料庫遷移服務 (DMS) 運算子嗎？


Amazon MWAA 支援 [DMS Operators](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/operators/dms.html)。不過，此運算子無法用於對與 Amazon MWAA 環境相關聯的 Amazon Aurora PostgreSQL 中繼資料資料庫執行動作。

### 當我使用 AWS 登入資料存取 Airflow REST API 時，是否可以將限流限制提高到每秒超過 10 筆交易 (TPS)？


是，您可以。若要提高限流限制，請聯絡 [AWS 客戶支援](https://aws.amazon.com/contact-us/)。

### Airflow 任務執行 API 伺服器在 Amazon MWAA 中的何處執行？


Amazon MWAA 會在 Webserver 元件中執行 Airflow 任務執行 API 伺服器。任務執行 APIs僅適用於 Apache Airflow v3 和更新版本。如需 Amazon MWAA 架構的詳細資訊，請參閱 [Architecture](what-is-mwaa.md#architecture-mwaa)。