

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

# 將 VPC Resolver 查詢記錄組態與 Route 53 設定檔建立關聯
<a name="profile-associate-query-logging"></a>

如需如何建立 VPC Resolver 查詢記錄組態的指示，請參閱[設定 (VPC Resolver 查詢記錄）](resolver-query-logging-configurations-managing.md#resolver-query-logs-configuring)，然後選擇標籤，使用 Route 53 主控台或 將 VPC Resolver 組態與 Route 53 設定檔建立關聯 AWS CLI。
+ [主控台](#profile-query-log-config-console)
+ [CLI](#profile-query-log-config-CLI)

------
#### [ Console ]<a name="profile-associate-query-logging-procedure"></a>

**建立查詢記錄組態的關聯**

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

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

1. 在**設定檔名稱**頁面上，選擇**解析程式查詢日誌組態**索引標籤，然後選擇**關聯**。

1. 在**關聯查詢記錄組態**頁面的**解析程式查詢日誌組態**資料表中，您最多可以選擇先前建立的三個組態。如果您想要與三個以上的查詢記錄組態建立關聯，請使用 API。如需詳細資訊，請參閱 [AssociateResourceToProfile](https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_AssociateResourceToProfile.html)。

1. 若要建立新的 VPC Resolver 查詢記錄組態，請參閱 [設定 (VPC Resolver 查詢記錄）](resolver-query-logging-configurations-managing.md#resolver-query-logs-configuring)。

1. 選擇**關聯**

1. 關聯進度會顯示在**解析程式查詢日誌組態**索引標籤的狀態****欄中。

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

您可以執行如下所示的 AWS CLI 命令，並使用您自己的 `name``profile-id`和 值，將查詢日誌組態與設定檔建立關聯`resource-arn`。

`aws route53profiles associate-resource-to-profile --name test-resource-association --profile-id rp-4987774726example --resource-arn arn:aws:route53resolver:us-east-1:123456789012:resolver-query-log-config/rqlc-cfe7f72example `

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

```
{
    "ProfileResourceAssociation": {
        "CreationTime": 1710851226.613,
        "Id": "rpr-001913120b8example",
        "ModificationTime": 1710851226.613,
        "Name": "test-resource-association",
        "OwnerId": "123456789012",
        "ProfileId": "rp-4987774726example",
        "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:resolver-query-log-config/rqlc-cfe7f72example",
        "ResourceType": "RESOLVER_QUERY_LOG_CONFIG",
        "Status": "CREATING",
        "StatusMessage": "Creating rp-4987774726example to rqlc-cfe7f72example association"
    }
}
```

------