

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

# ARC 中區域切換的 Identity and Access Management
<a name="security-iam-region-switch"></a>

AWS Identity and Access Management (IAM) 是 AWS 服務 ，可協助管理員安全地控制對 AWS 資源的存取。IAM 管理員可控制誰可以*進行身分驗證* （登入） 和*授權* （具有許可） 來使用 ARC 資源。IAM 是您可以免費使用 AWS 服務 的 。

**Topics**
+ [區域切換如何與 IAM 搭配使用](security_iam_service-with-iam-region-switch.md)
+ [身分型政策範例](security_iam_id-based-policy-examples-region-switch.md)

# ARC 中的區域切換如何與 IAM 搭配使用
<a name="security_iam_service-with-iam-region-switch"></a>

在您使用 IAM 管理對 ARC 的存取之前，請先了解哪些 IAM 功能可與 ARC 搭配使用。

在您使用 IAM 在 Amazon Application Recovery Controller (ARC) 中管理區域切換的存取權之前，請先了解哪些 IAM 功能可與區域切換搭配使用。


**您可以在 Amazon Application Recovery Controller (ARC) 中搭配區域切換使用的 IAM 功能**  

| IAM 功能 | 區域切換支援 | 
| --- | --- | 
|  [身分型政策](#security_iam_service-with-iam-region-switch-id-based-policies)  |   是  | 
|  [資源型政策](#security_iam_service-with-iam-region-switch-resource-based-policies)  |   是  | 
|  [政策動作](#security_iam_service-with-iam-region-switch-id-based-policies-actions)  |   是  | 
|  [政策資源](#security_iam_service-with-iam-region-switch-id-based-policies-resources)  |   是  | 
|  [政策條件索引鍵](#security_iam_service-with-iam-region-switch-id-based-policies-conditionkeys)  |   是  | 
|  [ACL](#security_iam_service-with-iam-region-switch-acls)  |   是  | 
|  [ABAC (政策中的標籤)](#security_iam_service-with-iam-region-switch-tags)  |   是  | 
|  [臨時憑證](#security_iam_service-with-iam-region-switch-roles-tempcreds)  |   是  | 
|  [主體許可](#security_iam_service-with-iam-region-switch-principal-permissions)  |   是  | 
|  [服務角色](#security_iam_service-with-iam-region-switch-roles-service)  |   否   | 
|  [服務連結角色](#security_iam_service-with-iam-region-switch-roles-service-linked)  |   否   | 

若要取得 AWS 服務如何與大多數 IAM 功能搭配使用的高階整體檢視，請參閱《*IAM 使用者指南*》中的與 [AWS IAM 搭配使用的 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。

## 區域切換的身分型政策
<a name="security_iam_service-with-iam-region-switch-id-based-policies"></a>

**支援身分型政策：**是

身分型政策是可以附加到身分 (例如 IAM 使用者、使用者群組或角色) 的 JSON 許可政策文件。這些政策可控制身分在何種條件下能對哪些資源執行哪些動作。如需了解如何建立身分型政策，請參閱《*IAM 使用者指南*》中的[透過客戶管理政策定義自訂 IAM 許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)。

使用 IAM 身分型政策，您可以指定允許或拒絕的動作和資源，以及在何種條件下允許或拒絕動作。如要了解您在 JSON 政策中使用的所有元素，請參閱《*IAM 使用者指南*》中的 [IAM JSON 政策元素參考](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html)。

若要檢視 ARC 身分型政策的範例，請參閱 [Amazon Application Recovery Controller (ARC) 中的身分型政策範例](security_iam_id-based-policy-examples.md)。

## 區域切換內的資源型政策
<a name="security_iam_service-with-iam-region-switch-resource-based-policies"></a>

**支援資源型政策：**是

資源型政策是附加到資源的 JSON 政策文件。資源型政策的最常見範例是 IAM 角色信任政策和 Amazon S3 儲存貯體政策。在支援資源型政策的服務中，服務管理員可以使用它們來控制對特定資源的存取權限。

## 區域切換的政策動作
<a name="security_iam_service-with-iam-region-switch-id-based-policies-actions"></a>

**支援政策動作：**是

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

JSON 政策的 `Action` 元素描述您可以用來允許或拒絕政策中存取的動作。政策會使用動作來授予執行相關聯動作的許可。

適用於區域切換的 ARC 中的政策動作在動作之前使用下列字首：

```
arc-region-switch
```

若要在單一陳述式中指定多個動作，請用逗號分隔。例如，下列項目：

```
"Action": [
      "arc-region-switch:action1",
      "arc-region-switch:action2"
         ]
```

您也可以使用萬用字元 (\$1) 來指定多個動作。例如，若要指定開頭是 `Describe` 文字的所有動作，請包含以下動作：

```
"Action": "arc-region-switch:Describe*"
```

若要檢視區域切換的 ARC 身分型政策範例，請參閱 [ARC 中區域切換的身分型政策範例](security_iam_id-based-policy-examples-region-switch.md)。

## 區域切換的政策資源
<a name="security_iam_service-with-iam-region-switch-id-based-policies-resources"></a>

**支援政策資源：**是

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

`Resource` JSON 政策元素可指定要套用動作的物件。最佳實務是使用其 [Amazon Resource Name (ARN)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) 來指定資源。若動作不支援資源層級許可，使用萬用字元 (\$1) 表示該陳述式適用於所有資源。

```
"Resource": "*"
```

若要檢視區域切換的 ARC 身分型政策範例，請參閱 [ARC 中區域切換的身分型政策範例](security_iam_id-based-policy-examples-region-switch.md)。

## 區域切換的政策條件索引鍵
<a name="security_iam_service-with-iam-region-switch-id-based-policies-conditionkeys"></a>

**支援服務特定政策條件金鑰：**是

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

`Condition` 元素會根據定義的條件，指定陳述式的執行時機。您可以建立使用[條件運算子](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html)的條件運算式 (例如等於或小於)，來比對政策中的條件和請求中的值。若要查看所有 AWS 全域條件索引鍵，請參閱《*IAM 使用者指南*》中的[AWS 全域條件內容索引鍵](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)。

若要檢視區域切換的 ARC 身分型政策範例，請參閱 [ARC 中區域切換的身分型政策範例](security_iam_id-based-policy-examples-region-switch.md)。

## 區域切換中的存取控制清單 ACLs)
<a name="security_iam_service-with-iam-region-switch-acls"></a>

**支援 ACL：**是

存取控制清單 (ACL) 可控制哪些主體 (帳戶成員、使用者或角色) 擁有存取某資源的許可。ACL 類似於資源型政策，但它們不使用 JSON 政策文件格式。

## 具有區域切換的屬性型存取控制 (ABAC)
<a name="security_iam_service-with-iam-region-switch-tags"></a>

**支援 ABAC (政策中的標籤)：**是

屬性型存取控制 (ABAC) 是一種授權策略，依據稱為標籤的屬性來定義許可。您可以將標籤連接至 IAM 實體 AWS 和資源，然後設計 ABAC 政策，以便在委託人的標籤符合資源上的標籤時允許操作。

如需根據標籤控制存取，請使用 `aws:ResourceTag/key-name`、`aws:RequestTag/key-name` 或 `aws:TagKeys` 條件索引鍵，在政策的[條件元素](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html)中，提供標籤資訊。

如果服務支援每個資源類型的全部三個條件金鑰，則對該服務而言，值為 **Yes**。如果服務僅支援某些資源類型的全部三個條件金鑰，則值為 **Partial**。

如需 ABAC 的詳細資訊，請參閱《*IAM 使用者指南*》中的[使用 ABAC 授權定義許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html)。如要查看含有設定 ABAC 步驟的教學課程，請參閱《*IAM 使用者指南*》中的[使用屬性型存取控制 (ABAC)](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)。

## 搭配區域切換使用臨時登入資料
<a name="security_iam_service-with-iam-region-switch-roles-tempcreds"></a>

**支援臨時憑證：**是

臨時登入資料提供 AWS 資源的短期存取權，當您使用聯合或切換角色時會自動建立。 AWS 建議您動態產生臨時登入資料，而不是使用長期存取金鑰。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的臨時安全憑證](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)與[可與 IAM 搭配運作的AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。

## 區域切換的跨服務主體許可
<a name="security_iam_service-with-iam-region-switch-principal-permissions"></a>

**支援轉寄存取工作階段 (FAS)：**是

當您使用 IAM 實體 （使用者或角色） 在 中執行動作時 AWS，您會被視為委託人。政策能將許可授予主體。當您使用某些服務時，您可能會執行一個動作，然後在不同的服務中觸發另一個動作。在此情況下，您必須具有執行這兩個動作的許可。

## 區域切換的服務角色
<a name="security_iam_service-with-iam-region-switch-roles-service"></a>

**支援服務角色：**否 

 服務角色是服務擔任的 [IAM 角色](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)，可代您執行動作。IAM 管理員可以從 IAM 內建立、修改和刪除服務角色。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[建立角色以委派許可給 AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html)。

## 區域切換的服務連結角色
<a name="security_iam_service-with-iam-region-switch-roles-service-linked"></a>

**支援服務連結角色：**否 

 服務連結角色是連結至 的一種服務角色 AWS 服務。服務可以擔任代表您執行動作的角色。服務連結角色會出現在您的 中 AWS 帳戶 ，並由服務擁有。IAM 管理員可以檢視，但不能編輯服務連結角色的許可。

如需建立或管理服務連結角色的詳細資訊，請參閱[可搭配 IAM 運作的AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。在資料表中尋找服務，其中包含**服務連結角色**欄中的 `Yes`。選擇**是**連結，以檢視該服務的服務連結角色文件。

# ARC 中區域切換的身分型政策範例
<a name="security_iam_id-based-policy-examples-region-switch"></a>

根據預設，使用者和角色沒有建立或修改 ARC 資源的許可。若要授予使用者對其所需資源執行動作的許可，IAM 管理員可以建立 IAM 政策。

如需了解如何使用這些範例 JSON 政策文件建立 IAM 身分型政策，請參閱《*IAM 使用者指南*》中的[建立 IAM 政策 (主控台)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html)。

如需 ARC 定義的動作和資源類型的詳細資訊，包括每種資源類型的 ARNs 格式，請參閱*《服務授權參考*》中的 [Amazon Application Recovery Controller (ARC) 的動作、資源和條件索引鍵](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonroute53recoverycontrols.html)。

**Topics**
+ [政策最佳實務](#security_iam_service-with-iam-policy-best-practices-zonal)
+ [規劃執行角色信任政策](security_iam_region_switch_trust_policy.md)
+ [完整存取許可](security_iam_region_switch_full_access.md)
+ [唯讀許可](security_iam_region_switch_read_only.md)
+ [執行區塊許可](security_iam_region_switch_execution_blocks.md)
+ [應用程式運作狀態許可的 CloudWatch 警示](security_iam_region_switch_cloudwatch.md)
+ [自動計劃執行報告許可](security_iam_region_switch_reports.md)
+ [跨帳戶資源許可](security_iam_region_switch_cross_account.md)
+ [完成計劃執行角色許可](security_iam_region_switch_complete_policy.md)

## 政策最佳實務
<a name="security_iam_service-with-iam-policy-best-practices-zonal"></a>

身分型政策會判斷您帳戶中的某個人員是否可以建立、存取或刪除 ARC 資源。這些動作可能會讓您的 AWS 帳戶產生費用。當您建立或編輯身分型政策時，請遵循下列準則及建議事項：
+ **開始使用 AWS 受管政策並邁向最低權限許可** – 若要開始將許可授予您的使用者和工作負載，請使用將許可授予許多常見使用案例的 *AWS 受管政策*。它們可在您的 中使用 AWS 帳戶。我們建議您定義特定於使用案例 AWS 的客戶受管政策，以進一步減少許可。如需更多資訊，請參閱《*IAM 使用者指南*》中的 [AWS 受管政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies)或[任務職能的AWS 受管政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html)。
+ **套用最低權限許可** – 設定 IAM 政策的許可時，請僅授予執行任務所需的許可。為實現此目的，您可以定義在特定條件下可以對特定資源採取的動作，這也稱為*最低權限許可*。如需使用 IAM 套用許可的更多相關資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的政策和許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)。
+ **使用 IAM 政策中的條件進一步限制存取權** – 您可以將條件新增至政策，以限制動作和資源的存取。例如，您可以撰寫政策條件，指定必須使用 SSL 傳送所有請求。如果透過特定 例如 使用服務動作 AWS 服務，您也可以使用條件來授予其存取權 CloudFormation。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM JSON 政策元素：條件](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html)。
+ **使用 IAM Access Analyzer 驗證 IAM 政策，確保許可安全且可正常運作** – IAM Access Analyzer 驗證新政策和現有政策，確保這些政策遵從 IAM 政策語言 (JSON) 和 IAM 最佳實務。IAM Access Analyzer 提供 100 多項政策檢查及切實可行的建議，可協助您撰寫安全且實用的政策。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[使用 IAM Access Analyzer 驗證政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html)。
+ **需要多重要素驗證 (MFA)** – 如果您的案例需要 IAM 使用者或 中的根使用者 AWS 帳戶，請開啟 MFA 以提高安全性。如需在呼叫 API 操作時請求 MFA，請將 MFA 條件新增至您的政策。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[透過 MFA 的安全 API 存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html)。

如需 IAM 中最佳實務的相關資訊，請參閱《*IAM 使用者指南*》中的 [IAM 安全最佳實務](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)。

# 規劃執行角色信任政策
<a name="security_iam_region_switch_trust_policy"></a>

 這是計劃執行角色所需的信任政策，因此 ARC 可以執行區域切換計劃。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "arc-region-switch.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

------

# 完整存取許可
<a name="security_iam_region_switch_full_access"></a>

下列 IAM 政策會授予所有區域交換器 APIs的完整存取權：

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "arc-region-switch.amazonaws.com"
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": [
        "arc-region-switch:CreatePlan",
        "arc-region-switch:UpdatePlan",
        "arc-region-switch:GetPlan",
        "arc-region-switch:ListPlans",
        "arc-region-switch:DeletePlan",
        "arc-region-switch:GetPlanInRegion",
        "arc-region-switch:ListPlansInRegion",
        "arc-region-switch:ApprovePlanExecutionStep",
        "arc-region-switch:GetPlanEvaluationStatus",
        "arc-region-switch:GetPlanExecution",
        "arc-region-switch:StartPlanExecution",
        "arc-region-switch:CancelPlanExecution",
        "arc-region-switch:ListRoute53HealthChecks",
        "arc-region-switch:ListRoute53HealthChecksInRegion",
        "arc-region-switch:ListPlanExecutions",
        "arc-region-switch:ListPlanExecutionEvents",
        "arc-region-switch:ListTagsForResource", 
        "arc-region-switch:TagResource",
        "arc-region-switch:UntagResource",
        "arc-region-switch:UpdatePlanExecution",
        "arc-region-switch:UpdatePlanExecutionStep"
      ],
      "Resource": "*"
    }
  ]
}
```

------

# 唯讀許可
<a name="security_iam_region_switch_read_only"></a>

 下列 IAM 政策會授予區域切換的唯讀存取許可：

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "arc-region-switch:GetPlan",
        "arc-region-switch:ListPlans",
        "arc-region-switch:GetPlanInRegion",
        "arc-region-switch:ListPlansInRegion",
        "arc-region-switch:GetPlanEvaluationStatus",
        "arc-region-switch:GetPlanExecution",
        "arc-region-switch:ListRoute53HealthChecks",
        "arc-region-switch:ListRoute53HealthChecksInRegion",
        "arc-region-switch:ListPlanExecutions",
        "arc-region-switch:ListPlanExecutionEvents",
        "arc-region-switch:ListTagsForResource"
      ],
      "Resource": "*"
    }
  ]
}
```

------

# 執行區塊許可
<a name="security_iam_region_switch_execution_blocks"></a>

 下列各節提供範例 IAM 政策，為您新增至區域切換計畫的特定執行區塊提供所需的許可。

**Topics**
+ [EC2 Auto Scaling 執行區塊範例政策](security_iam_region_switch_ec2_autoscaling.md)
+ [Amazon EKS 資源擴展執行區塊範例政策](security_iam_region_switch_eks.md)
+ [Amazon ECS 服務擴展執行區塊範例政策](security_iam_region_switch_ecs.md)
+ [ARC 路由控制執行區塊範例政策](security_iam_region_switch_arc_routing.md)
+ [Aurora Global Database 執行區塊範例政策](security_iam_region_switch_aurora.md)
+ [Amazon DocumentDB 全域叢集執行區塊範例政策](security_iam_region_switch_documentdb.md)
+ [Amazon RDS 執行區塊範例政策](security_iam_region_switch_rds.md)
+ [手動核准執行區塊範例政策](security_iam_region_switch_manual_approval.md)
+ [自訂動作 Lambda 執行區塊範例政策](security_iam_region_switch_lambda.md)
+ [Route 53 運作狀態檢查執行區塊範例政策](security_iam_region_switch_route53.md)
+ [區域切換計畫執行區塊範例政策](security_iam_region_switch_plan_execution.md)

# EC2 Auto Scaling 執行區塊範例政策
<a name="security_iam_region_switch_ec2_autoscaling"></a>

 如果您將執行區塊新增至 EC2 Auto Scaling 群組的區域切換計劃，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "autoscaling:DescribeAutoScalingGroups"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "autoscaling:UpdateAutoScalingGroup"
      ],
      "Resource": [
        "arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:123d456e-123e-1111-abcd-EXAMPLE22222:autoScalingGroupName/app-asg-primary",
        "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:1234a321-123e-1234-aabb-EXAMPLE33333:autoScalingGroupName/app-asg-secondary" 
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricStatistics"
      ],
      "Resource": "*"
    }
  ]
}
```

------

# Amazon EKS 資源擴展執行區塊範例政策
<a name="security_iam_region_switch_eks"></a>

 如果您將執行區塊新增至 Amazon EKS 資源擴展的區域切換計劃，可連接以下範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "eks:DescribeCluster"
      ],
      "Resource": [
        "arn:aws:eks:us-east-1:123456789012:cluster/app-eks-primary",
        "arn:aws:eks:us-west-2:123456789012:cluster/app-eks-secondary"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "eks:ListAssociatedAccessPolicies"
      ],
      "Resource": [
        "arn:aws:eks:us-east-1:123456789012:access-entry/app-eks-primary/*",
        "arn:aws:eks:us-west-2:123456789012:access-entry/app-eks-secondary/*"
      ]
    }
  ]
}
```

------

 注意：除了此 IAM 政策之外，還需要使用 存取政策將計劃執行角色新增至 Amazon EKS 叢集的`AmazonArcRegionSwitchScalingPolicy`存取項目。如需詳細資訊，請參閱[設定 EKS 存取項目許可](eks-resource-scaling-block.md#eks-resource-scaling-block-permissions)。

# Amazon ECS 服務擴展執行區塊範例政策
<a name="security_iam_region_switch_ecs"></a>

 如果您將執行區塊新增至 Amazon ECS 服務擴展的區域切換計劃，可連接以下範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecs:DescribeServices",
        "ecs:UpdateService"
      ],
      "Resource": [
        "arn:aws:ecs:us-east-1:123456789012:service/app-cluster-primary/app-service",
        "arn:aws:ecs:us-west-2:123456789012:service/app-cluster-secondary/app-service"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "ecs:DescribeClusters"
      ],
      "Resource": [
        "arn:aws:ecs:us-east-1:123456789012:cluster/app-cluster-primary",
        "arn:aws:ecs:us-west-2:123456789012:cluster/app-cluster-secondary"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "ecs:ListServices"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "application-autoscaling:DescribeScalableTargets",
        "application-autoscaling:RegisterScalableTarget"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:GetMetricStatistics"
      ],
      "Resource": "*"
    }
  ]
}
```

------

# ARC 路由控制執行區塊範例政策
<a name="security_iam_region_switch_arc_routing"></a>

 注意：Amazon ARC 路由控制執行區塊要求套用至計劃執行角色的任何服務控制政策 (SCPs) 都允許存取這些服務的下列區域：
+ `route53-recovery-control-config: us-west-2`
+ `route53-recovery-cluster: us-west-2, us-east-1, eu-west-1, ap-southeast-2, ap-northeast-1`

如果您將執行區塊新增至 ARC 路由控制的區域切換計劃，則要附加下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "route53-recovery-control-config:DescribeControlPanel",
        "route53-recovery-control-config:DescribeCluster"
      ],
      "Resource": [
        "arn:aws:route53-recovery-control::123456789012:controlpanel/abcd1234abcd1234abcd1234abcd1234",
        "arn:aws:route53-recovery-control::123456789012:cluster/4b325d3b-0e28-4dcf-ba4a-EXAMPLE11111"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "route53-recovery-cluster:GetRoutingControlState",
        "route53-recovery-cluster:UpdateRoutingControlStates"
      ],
      "Resource": [
        "arn:aws:route53-recovery-control::123456789012:controlpanel/1234567890abcdef1234567890abcdef/routingcontrol/abcdef1234567890", 
        "arn:aws:route53-recovery-control::123456789012:controlpanel/1234567890abcdef1234567890abcdef/routingcontrol/1234567890abcdef" 
      ]
    }
  ]
}
```

------

您可以使用 CLI 擷取路由控制面板 ID 和叢集 ID。如需詳細資訊，請參閱[設定路由控制元件](getting-started-cli-routing-config.md)。

# Aurora Global Database 執行區塊範例政策
<a name="security_iam_region_switch_aurora"></a>

 如果您將執行區塊新增至 Aurora 資料庫的區域切換計畫，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "rds:DescribeGlobalClusters",
        "rds:DescribeDBClusters"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "rds:FailoverGlobalCluster",
        "rds:SwitchoverGlobalCluster"
      ],
      "Resource": [
        "arn:aws:rds::123456789012:global-cluster:app-global-db",
	      "arn:aws:rds:us-east-1:123456789012:cluster:app-db-primary", 
        "arn:aws:rds:us-west-2:123456789012:cluster:app-db-secondary"  
      ]
    }
  ]
}
```

------

# Amazon DocumentDB 全域叢集執行區塊範例政策
<a name="security_iam_region_switch_documentdb"></a>

 如果您將執行區塊新增至 Amazon DocumentDB 全域叢集的區域切換計劃，可連接下列範例政策。

```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "rds:DescribeGlobalClusters",
        "rds:DescribeDBClusters",
        "rds:FailoverGlobalCluster",
        "rds:SwitchoverGlobalCluster"
      ],
      "Resource": "*"
    }
  ]
}
```

# Amazon RDS 執行區塊範例政策
<a name="security_iam_region_switch_rds"></a>

 如果您將執行區塊新增至 Amazon RDS 僅供讀取複本提升或跨區域複本建立的區域切換計劃，要連接下列範例政策。

```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "rds:DescribeDBInstances",
        "rds:PromoteReadReplica",
        "rds:CreateDBInstanceReadReplica",
        "rds:ModifyDBInstance"
      ],
      "Resource": "*"
    }
  ]
}
```

# 手動核准執行區塊範例政策
<a name="security_iam_region_switch_manual_approval"></a>

如果您將執行區塊新增至區域切換計畫以進行手動核准，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "arc-region-switch:ApprovePlanExecutionStep"
      ],
      "Resource": "arn:aws:arc-region-switch::123456789012:plan/sample-plan:0123abc"
    }
  ]
}
```

------

# 自訂動作 Lambda 執行區塊範例政策
<a name="security_iam_region_switch_lambda"></a>

 如果您將執行區塊新增至 Lambda 函數的區域切換計劃，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "lambda:GetFunction",
        "lambda:InvokeFunction"
      ],
      "Resource": [
        "arn:aws:lambda:us-east-1:123456789012:function:app-recovery-primary",
        "arn:aws:lambda:us-west-2:123456789012:function:app-recovery-secondary"
      ]
    }
  ]
}
```

------

# Route 53 運作狀態檢查執行區塊範例政策
<a name="security_iam_region_switch_route53"></a>

 如果您將執行區塊新增至 Route 53 運作狀態檢查的區域切換計劃，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "route53:ListResourceRecordSets"
      ],
      "Resource": [
        "arn:aws:route53:::hostedzone/Z1234567890ABCDEFGHIJ"
      ]
    }
  ]
}
```

------

# 區域切換計畫執行區塊範例政策
<a name="security_iam_region_switch_plan_execution"></a>

 如果您將執行區塊新增至區域切換計劃以執行子計劃，可連接下列範例政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "arc-region-switch:StartPlanExecution",
        "arc-region-switch:GetPlanExecution",
        "arc-region-switch:CancelPlanExecution",
        "arc-region-switch:UpdatePlanExecution",
        "arc-region-switch:ListPlanExecutions"
      ],
      "Resource": [
        "arn:aws:arc-region-switch::123456789012:plan/child-plan-1/abcde1",
        "arn:aws:arc-region-switch::123456789012:plan/child-plan-2/fghij2"
      ]
    }
  ]
}
```

------

# 應用程式運作狀態許可的 CloudWatch 警示
<a name="security_iam_region_switch_cloudwatch"></a>

 以下是連接 以存取應用程式運作狀態 CloudWatch 警示的範例政策，用於協助判斷實際的復原時間。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:DescribeAlarmHistory",
        "cloudwatch:DescribeAlarms"
      ],
      "Resource": [
        "arn:aws:cloudwatch:us-east-1:123456789012:alarm:app-health-primary",
        "arn:aws:cloudwatch:us-west-2:123456789012:alarm:app-health-secondary"
      ]
    }
  ]
}
```

------

# 自動計劃執行報告許可
<a name="security_iam_region_switch_reports"></a>

 如果您為區域切換計劃設定自動產生報告，可連接以下範例政策。此政策包含將報告寫入 Amazon S3、存取 CloudWatch 警示資料，以及擷取父系計劃子計劃資訊的許可。

```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:DescribeAlarms",
        "cloudwatch:DescribeAlarmHistory"
      ],
      "Resource": [
        "arn:aws:cloudwatch:us-east-1:123456789012:alarm:app-health-primary"
        "arn:aws:cloudwatch:us-west-2:123456789012:alarm:app-health-secondary"
      ],
    },
    {
      "Effect": "Allow",
      "Action": [
        "arc-region-switch:GetPlanExecution",
        "arc-region-switch:ListPlanExecutionEvents"
      ],
      "Resource": [
        "arn:aws:arc-region-switch:us-east-1:123456789012:plan/child-plan-1/abcde1",
        "arn:aws:arc-region-switch:us-west-2:123456789012:plan/child-plan-2/fghij2"
      ],
    }
  ]
}
```

 注意：如果您為 Amazon S3 儲存貯體加密設定客戶受管 AWS KMS 金鑰，您還必須為金鑰新增 `kms:GenerateDataKey`和 `kms:Encrypt`許可。

# 跨帳戶資源許可
<a name="security_iam_region_switch_cross_account"></a>

 如果資源位於不同的帳戶中，您將需要跨帳戶角色。以下是跨帳戶角色的範例信任政策。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::123456789012:role/RegionSwitchExecutionRole"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "UniqueExternalId123"
        }
      }
    }
  ]
}
```

------

 以下是計劃執行角色擔任此跨帳戶角色的許可：

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "sts:AssumeRole",
      "Resource": "arn:aws:iam::987654321098:role/RegionSwitchCrossAccountRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "UniqueExternalId123"
        }
      }
    }
  ]
}
```

------

# 完成計劃執行角色許可
<a name="security_iam_region_switch_complete_policy"></a>

 建立包含所有執行區塊許可的完整政策需要相當大的政策。實際上，您應該只包含您在特定計劃中使用的執行區塊的許可。

以下是範例政策，您可以用作計劃執行角色政策的起點。請務必新增您在計劃中包含的特定執行區塊所需的其他政策。僅包含您在計劃中使用的特定執行區塊所需的許可，以遵循最低權限原則

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:SimulatePrincipalPolicy",
            "Resource": "arn:aws:iam::123456789012:role/RegionSwitchExecutionRole"
        },
        {
            "Effect": "Allow",
            "Action": [
                "arc-region-switch:GetPlan",
                "arc-region-switch:GetPlanExecution",
                "arc-region-switch:ListPlanExecutions"
            ],
            "Resource": "*"
        }
    ]
}
```

------