

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 将 DNS Firewall 规则组与 Route 53 配置文件关联
<a name="profile-associate-dns-firewall"></a>

有关创建规则组的说明，请参阅 [创建规则组和规则](resolver-dns-firewall-rule-group-adding.md)，然后选择一个选项卡，使用 Route 53 控制台或 AWS CLI将 DNS Firewall 规则组与 Route 53 配置文件关联。
+ [控制台](#profile-rule-group-console)
+ [CLI](#profile-rule-group-CLI)

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

**关联 DNS Firewall 规则组**

1. 登录 AWS 管理控制台 并打开 Route 53 控制台，网址为[https://console.aws.amazon.com/route53/](https://console.aws.amazon.com/route53/)。

1. 在导航栏上，选择您在其中创建了配置文件的区域。

1. 在导航窗格中，选择**配置文件**，然后在**配置文件**表中，选择要使用的配置文件的链接名称。

1. 在该 **<配置文件名称>** 页面上，选择 **DNS Firewall 规则组**选项卡，然后选择**关联**。

1. 在 **DNS Firewall 规则组**部分，最多可以选择 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 Firewall** 规则组对话框的**状态**列中。

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

通过运行如下 AWS CLI 命令并使用您自己的`name``profile-id`、`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"
    }
}
```

------