

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

# 為 DNS Firewall 規則群組與 Route 53 設定檔建立關聯
<a name="profile-associate-dns-firewall"></a>

如需建立規則群組的指示，請參閱[建立規則群組和規則](resolver-dns-firewall-rule-group-adding.md)，然後選擇標籤，使用 Route 53 主控台或 將 DNS 防火牆規則群組與 Route 53 設定檔建立關聯 AWS CLI。
+ [主控台](#profile-rule-group-console)
+ [CLI](#profile-rule-group-CLI)

------
#### [ Console ]<a name="profile-associate-dns-firewall-procedure"></a>

**建立 DNS 防火牆規則群組的關聯**

1. 登入 AWS 管理主控台 並開啟 Route 53 主控台，網址為 https：//[https://console.aws.amazon.com/route53/](https://console.aws.amazon.com/route53/)。

1. 在導覽列上，選擇您建立設定檔的區域。

1. 在導覽窗格中，選擇**設定檔**，然後在**設定檔**資料表上，選擇您要使用的設定檔連結名稱。

1. 在 **<設定檔名稱>** 頁面上，選擇 **DNS 防火牆規則群組**索引標籤，然後選擇**關聯**。

1. 在 **DNS 防火牆規則群組**區段中，您最多可以選擇先前建立的 10 個規則群組。如果您想要關聯超過 10 個規則群組，請使用 APIs。如需詳細資訊，請參閱 [AssociateResourceToProfile](https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_AssociateResourceToProfile.html)。

   若要建立新的規則群組，請參閱 [建立規則群組和規則](resolver-dns-firewall-rule-group-adding.md)。

1. 選擇**下一步**。

1. 在**定義優先順序**頁面上，您可以按一下預先指派的優先順序編號並輸入新的優先順序，以設定處理規則群組的順序。優先順序的允許值介於 100 到 9900 之間。

   規則群組會從最低數值優先順序設定開始評估，然後繼續評估。您可以隨時變更規則群組的優先順序，例如變更處理順序或為其他規則群組騰出空間。

   選擇**提交**。

1. 關聯進度會顯示在 **DNS 防火牆**規則群組對話方塊中**的狀態**欄中。

------
#### [ CLI ]

您可以執行如下所示的 AWS CLI 命令，並使用您自己的 `profile-id`、 和 `name` 值`resource-arn`，將規則群組與設定檔建立關聯`priority`：

`aws route53profiles associate-resource-to-profile --name test-resource-association --profile-id rp-4987774726example --resource-arn arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example --resource-properties "{\"priority\": 102}"`

以下是您執行 命令之後的範例輸出：

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851216.613,
        "Id": "rpr-001913120a7example",
        "ModificationTime": 1710851216.613,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example",
        "ResourceProperties": "{\"priority\":102}",
        "ResourceType": "FIREWALL_RULE_GROUP",
        "Status": "UPDATING",
        "StatusMessage": "Updating the Profile to DNS Firewall rule group association"
    }
}
```

------