

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

# ReplicaRegions
<a name="sam-property-webfunction-replicaregions"></a>

指定 `MultiRegion`或 `PerRegion` Web 函數端點複寫函數的區域。您可以指定區域代碼和區域群組的清單，或包含區域並選擇性地排除其中部分區域的物件。

您可以在指定區域的任何位置使用下列區域群組：
+ `US`: `us-east-1`, `us-east-2`, `us-west-1`, `us-west-2`
+ `EU`: `eu-west-1`, `eu-west-2`, `eu-west-3`, `eu-central-1`, `eu-north-1`
+ `AP`: `ap-south-1`, `ap-northeast-1`, `ap-northeast-2`, `ap-northeast-3`, `ap-southeast-1`, `ap-southeast-2`
+ `CA`: `ca-central-1`
+ `SA`: `sa-east-1`
+ `SPARSE_GLOBAL`：每個洲一或兩個區域，涵蓋較少區域的全球範圍：`us-east-1`、`eu-west-1`、`eu-central-1`、`ap-northeast-1``ap-southeast-1`、`ap-southeast-2`、、 `sa-east-1`
+ `ALL_STANDARD`：`US`、、`CA`、 和 `SA`群組中的每個區域 `EU` `AP`(17 個區域）

## 語法
<a name="sam-property-webfunction-replicaregions-syntax"></a>

若要在 AWS Serverless Application Model (AWS SAM) 範本中宣告此實體，請使用下列語法。

### YAML
<a name="sam-property-webfunction-replicaregions-syntax.yaml"></a>

```
[ExcludeRegions](#sam-webfunction-replicaregions-excluderegions): {{List}}
[IncludeRegions](#sam-webfunction-replicaregions-includeregions): {{List}}
```

## Properties
<a name="sam-property-webfunction-replicaregions-properties"></a>

 `ExcludeRegions`   <a name="sam-webfunction-replicaregions-excluderegions"></a>
要從 移除的區域代碼和區域群組清單`IncludeRegions`。您也必須指定 `IncludeRegions`。項目不能是內部函數，而且當 `IncludeRegions`包含內部函數`ExcludeRegions`時，您無法使用 。  
*類型：*清單  
*必要*：否  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等屬性。

 `IncludeRegions`   <a name="sam-webfunction-replicaregions-includeregions"></a>
要複寫函數的區域代碼和區域群組清單。清單本身不能是內部 函數，但個別項目可以。  
*類型：*清單  
*必要*：否  
*CloudFormation 相容性*：此屬性類似於 `AWS::Lambda::WebFunctionEndpoint` resource. AWS SAM expands 區域群組的 `[Regions](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-lambda-webfunctionendpoint.html#cfn-lambda-webfunctionendpoint-regions)` 屬性，並移除任何`ExcludeRegions`項目以產生區域清單。

## 範例
<a name="sam-property-webfunction-replicaregions-examples"></a>

### 區域清單
<a name="sam-property-webfunction-replicaregions-example-list"></a>

下列範例會將函數複寫到兩個區域。

```
ReplicaRegions:
  - us-east-1
  - eu-west-1
```

### 具有排除的區域群組
<a name="sam-property-webfunction-replicaregions-example-exclude"></a>

下列範例會將 函數複寫至美國區域，但 除外`us-west-1`。

```
ReplicaRegions:
  IncludeRegions:
    - US
  ExcludeRegions:
    - us-west-1
```