本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
OpenSearch 網域的跨帳戶資料存取
您可以在一個帳戶中設定 OpenSearch UI 應用程式,以存取不同帳戶中的 OpenSearch 網域。當您使用跨帳戶資料來源建立 OpenSearch UI 應用程式時,您會提供iamRoleForDataSourceArn指向目標帳戶中 IAM 角色的 。OpenSearch UI 透過擔任此角色並呼叫 es:DescribeDomain 來驗證網域可存取性來驗證請求。跨帳戶角色僅用於控制平面驗證。資料平面存取是由目標網域的存取政策單獨控制。
範本程式碼
本主題中的程式碼範例僅供說明之用。它們示範了基本功能,並且可能不包括錯誤處理、安全最佳實務或生產就緒功能。在生產環境中使用範本程式碼之前,請檢閱並修改範本以符合您的特定需求,並在您的環境中徹底測試。
重要概念
- 來源帳戶
-
AWS 帳戶 託管 OpenSearch UI 應用程式的 。
- 目標帳戶
-
AWS 帳戶 OpenSearch 網域所在的 。
- 跨帳戶角色
-
目標帳戶中的 IAM 角色,僅用於控制平面驗證。此角色只需要
es:DescribeDomain許可。 - IAM Identity Center 應用程式角色
-
來源帳戶中的 IAM 角色,用於 IAM Identity Center 使用者資料平面存取。
先決條件
設定跨帳戶資料存取之前,請確定您有下列項目:
-
AWS CLI 已安裝和設定
-
同時存取來源和目標 AWS 帳戶
-
對於 IAM Identity Center 流程: AWS IAM Identity Center 組織執行個體
案例
選擇符合您身分驗證方法和網域組態的案例:
案例 1:存取公有網域的 IAM 使用者
步驟 1:建立跨帳戶 IAM 角色 (目標帳戶)
在目標帳戶中建立 IAM 角色,允許來源帳戶擔任該角色進行網域驗證。
建立跨帳戶角色
-
建立允許來源帳戶擔任角色的信任政策:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:root" }, "Action": "sts:AssumeRole" }] } -
建立角色:
aws iam create-role \ --role-nameOpenSearchUIAccessRole\ --assume-role-policy-document file://trust-policy.json -
建立僅具有
es:DescribeDomain動作的許可政策:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "es:DescribeDomain", "Resource": "arn:aws:es:region:target-account-id:domain/*" }] } -
將許可政策連接至角色:
aws iam put-role-policy \ --role-nameOpenSearchUIAccessRole\ --policy-nameValidationOnly\ --policy-document file://permissions-policy.json
步驟 2:建立 OpenSearch 網域 (目標帳戶)
在已啟用精細存取控制和加密的目標帳戶中建立 OpenSearch 網域:
aws opensearch create-domain \ --domain-namedomain-name\ --engine-version OpenSearch_2.19 \ --cluster-config InstanceType=m5.large.search,InstanceCount=1 \ --ebs-options "EBSEnabled=true,VolumeType=gp3,VolumeSize=100" \ --advanced-security-options '{"Enabled":true,"InternalUserDatabaseEnabled":true,"MasterUserOptions":{"MasterUserName":"admin","MasterUserPassword":"master-password"}}' \ --node-to-node-encryption-options '{"Enabled":true}' \ --encryption-at-rest-options '{"Enabled":true}' \ --domain-endpoint-options '{"EnforceHTTPS":true,"TLSSecurityPolicy":"Policy-Min-TLS-1-2-2019-07"}' \ --access-policies '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"*"},"Action":"es:ESHttp*","Resource":"arn:aws:es:region:target-account-id:domain/domain-name/*"}]}' \ --regionregion
等待網域狀態變為 ,Active再繼續。
步驟 3:建立 OpenSearch UI 應用程式 (來源帳戶)
使用跨帳戶資料來源在來源帳戶中建立應用程式:
aws opensearch create-application \ --regionregion\ --name "cross-account-iam-app" \ --data-sources '[{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/domain-name", "dataSourceDescription":"Cross-account domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"*\"]"}]'
步驟 4:驗證和存取
擷取應用程式詳細資訊以取得端點 URL:
aws opensearch get-application \ --regionregion\ --idapplication-id
-
從回應導覽至應用程式端點 URL。
-
使用 IAM 登入資料登入。
-
IAM 使用者使用自己的登入資料簽署資料平面請求。
-
目標網域存取政策控制使用者可以存取哪些資料。
案例 2:存取公有網域的 IAM Identity Center 使用者
步驟 1:建立跨帳戶 IAM 角色 (目標帳戶)
在目標帳戶中建立 IAM 角色,允許來源帳戶擔任該角色進行網域驗證。
建立跨帳戶角色
-
建立允許來源帳戶擔任角色的信任政策:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:root" }, "Action": "sts:AssumeRole" }] } -
建立角色:
aws iam create-role \ --role-nameOpenSearchUIAccessRole\ --assume-role-policy-document file://trust-policy.json -
建立僅具有
es:DescribeDomain動作的許可政策:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "es:DescribeDomain", "Resource": "arn:aws:es:region:target-account-id:domain/*" }] } -
將許可政策連接至角色:
aws iam put-role-policy \ --role-nameOpenSearchUIAccessRole\ --policy-nameValidationOnly\ --policy-document file://permissions-policy.json
步驟 2:建立 OpenSearch 網域 (目標帳戶)
在目標帳戶中建立 OpenSearch 網域。使用與 相同的命令步驟 2:建立 OpenSearch 網域 (目標帳戶),但更新存取政策以允許來源帳戶的 IAM Identity Center 應用程式角色:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:role/NeoIdCAppRole" }, "Action": "es:ESHttp*", "Resource": "arn:aws:es:region:target-account-id:domain/domain-name/*" }] }
等待網域狀態變為 ,Active再繼續。
步驟 3:建立 IAM Identity Center 應用程式的 IAM 角色 (來源帳戶)
在 OpenSearch UI 用於 IAM Identity Center 使用者資料平面存取的來源帳戶中建立 IAM 角色。
建立 IAM Identity Center 應用程式角色
-
建立信任政策:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:AssumeRole" }, { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:SetContext", "Condition": { "ForAllValues:ArnEquals": { "sts:RequestContextProviders": "arn:aws:iam::source-account-id:oidc-provider/portal.sso.region.amazonaws.com/apl/application-id" } } } ] } -
建立許可政策:
{ "Version": "2012-10-17", "Statement": [{ "Sid": "OpenSearchDomain", "Effect": "Allow", "Action": ["es:ESHttp*"], "Resource": "*" }] } -
建立角色並連接政策:
aws iam create-role \ --role-nameNeoIdCAppRole\ --assume-role-policy-document file://neoidc-trust-policy.jsonaws iam put-role-policy \ --role-nameNeoIdCAppRole\ --policy-nameNeoIdCAppPermissions\ --policy-document file://neoidc-permissions-policy.json
步驟 4:使用 IAM Identity Center (來源帳戶) 建立 OpenSearch UI 應用程式
aws opensearch create-application \ --regionregion\ --name "cross-account-idc-app" \ --iam-identity-center-options '{ "enabled":true, "iamIdentityCenterInstanceArn":"arn:aws:sso:::instance/ssoins-instance-id", "iamRoleForIdentityCenterApplicationArn":"arn:aws:iam::source-account-id:role/NeoIdCAppRole" }' \ --data-sources '[{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/domain-name", "dataSourceDescription":"Cross-account domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"*\"]"}]'
步驟 5:建立和指派 IAM Identity Center 使用者和群組
建立 IAM Identity Center 使用者
執行下列命令。使用您的資訊取代預留位置的值。
aws identitystore create-user \ --identity-store-idd-directory-id\ --user-nameuser-email\ --display-name "display-name" \ --name Formatted=string,FamilyName=last-name,GivenName=first-name\ --emails Value=user-email,Type=work,Primary=true
建立 IAM Identity Center 群組並新增使用者
執行下列命令:
aws identitystore create-group \ --identity-store-idd-directory-id\ --display-name "OpenSearchUsers" \ --description "Users with OpenSearch access" aws identitystore create-group-membership \ --identity-store-idd-directory-id\ --group-idgroup-id\ --member-id UserId=user-id
將使用者或群組指派給應用程式
執行以下命令:
aws sso-admin create-application-assignment \ --application-arn "arn:aws:sso:::source-account-id:application/ssoins-instance-id/apl-application-id" \ --principal-iduser-id-or-group-id\ --principal-typeUSER
在目標網域上設定後端角色映射
將 IAM Identity Center 群組映射至目標網域上的 OpenSearch 安全角色:
curl -XPUT "https://domain-endpoint/_plugins/_security/api/rolesmapping/all_access" \ -uadmin:master-password\ -H 'Content-Type: application/json' \ -d '{ "backend_roles": ["group-id"], "hosts": [], "users": [] }'
步驟 6:驗證和存取
aws opensearch get-application \ --regionregion\ --idapplication-id
-
導覽至應用程式端點 URL。
-
使用 IAM Identity Center 使用者憑證登入。
-
IAM Identity Center 使用者的資料請求會使用 IAM Identity Center 應用程式角色簽署,而不是跨帳戶角色。
-
網域控制資料存取許可上的後端角色映射。
案例 3:存取 VPC 網域的 IAM 使用者
步驟 1:建立跨帳戶 IAM 角色 (目標帳戶)
在目標帳戶中建立 IAM 角色,允許來源帳戶擔任該角色進行網域驗證。
建立跨帳戶角色
-
建立允許來源帳戶擔任角色的信任政策:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:root" }, "Action": "sts:AssumeRole" }] } -
建立角色:
aws iam create-role \ --role-nameOpenSearchUIAccessRole\ --assume-role-policy-document file://trust-policy.json -
建立僅具有
es:DescribeDomain動作的許可政策:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "es:DescribeDomain", "Resource": "arn:aws:es:region:target-account-id:domain/*" }] } -
將許可政策連接至角色:
aws iam put-role-policy \ --role-nameOpenSearchUIAccessRole\ --policy-nameValidationOnly\ --policy-document file://permissions-policy.json
步驟 2:設定 VPC (目標帳戶)
如果目標帳戶中已存在 VPC,請略過此步驟。
# Create VPC aws ec2 create-vpc \ --cidr-block 10.0.0.0/16 \ --regionregion# Create subnet aws ec2 create-subnet \ --vpc-idvpc-id\ --cidr-block 10.0.1.0/24 \ --availability-zoneregiona \ --regionregion# Create security group aws ec2 create-security-group \ --group-nameopensearch-vpc-sg\ --description "Security group for OpenSearch VPC domain" \ --vpc-idvpc-id\ --regionregion# Allow inbound HTTPS aws ec2 authorize-security-group-ingress \ --group-idsecurity-group-id\ --protocol tcp \ --port 443 \ --cidr 10.0.0.0/16 \ --regionregion
進一步了解 VPC 網域建立。
步驟 3:建立 VPC 網域 (目標帳戶)
aws opensearch create-domain \ --domain-namevpc-domain-name\ --engine-version OpenSearch_2.19 \ --cluster-config InstanceType=m5.large.search,InstanceCount=1 \ --ebs-options "EBSEnabled=true,VolumeType=gp3,VolumeSize=100" \ --vpc-options "SubnetIds=subnet-id,SecurityGroupIds=security-group-id" \ --advanced-security-options '{"Enabled":true,"InternalUserDatabaseEnabled":true,"MasterUserOptions":{"MasterUserName":"admin","MasterUserPassword":"master-password"}}' \ --node-to-node-encryption-options '{"Enabled":true}' \ --encryption-at-rest-options '{"Enabled":true}' \ --domain-endpoint-options '{"EnforceHTTPS":true,"TLSSecurityPolicy":"Policy-Min-TLS-1-2-2019-07"}' \ --access-policies '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"*"},"Action":"es:ESHttp*","Resource":"arn:aws:es:region:target-account-id:domain/vpc-domain-name/*"}]}' \ --regionregion
等待網域狀態變為 ,Active再繼續。
步驟 4:授權 OpenSearch UI 服務主體的 VPC 端點 (目標帳戶)
重要
這是 VPC 網域獨有的關鍵步驟。OpenSearch UI 服務必須明確授權才能存取 VPC 端點。
# Authorize the service principal aws opensearch authorize-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --regionregion# Verify authorization aws opensearch list-vpc-endpoint-access \ --domain-namevpc-domain-name\ --regionregion
預期回應:
{ "AuthorizedPrincipalList": [ { "PrincipalType": "AWS_SERVICE", "Principal": "application.opensearchservice.amazonaws.com" } ] }
步驟 5:建立 OpenSearch UI 應用程式 (來源帳戶)
aws opensearch create-application \ --regionregion\ --name "cross-account-vpc-iam-app" \ --data-sources '[{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/vpc-domain-name", "dataSourceDescription":"Cross-account VPC domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"*\"]"}]'
步驟 6:驗證和存取
擷取應用程式詳細資訊以取得端點 URL:
aws opensearch get-application \ --regionregion\ --idapplication-id
-
從回應導覽至應用程式端點 URL。
-
使用 IAM 登入資料登入。
-
IAM 使用者使用自己的登入資料簽署資料平面請求。
-
目標網域存取政策控制使用者可以存取哪些資料。
案例 4:存取 VPC 網域的 IAM Identity Center 使用者
步驟 1:建立跨帳戶 IAM 角色 (目標帳戶)
在目標帳戶中建立 IAM 角色,允許來源帳戶擔任該角色進行網域驗證。
建立跨帳戶角色
-
建立允許來源帳戶擔任角色的信任政策:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:root" }, "Action": "sts:AssumeRole" }] } -
建立角色:
aws iam create-role \ --role-nameOpenSearchUIAccessRole\ --assume-role-policy-document file://trust-policy.json -
建立僅具有
es:DescribeDomain動作的許可政策:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "es:DescribeDomain", "Resource": "arn:aws:es:region:target-account-id:domain/*" }] } -
將許可政策連接至角色:
aws iam put-role-policy \ --role-nameOpenSearchUIAccessRole\ --policy-nameValidationOnly\ --policy-document file://permissions-policy.json
步驟 2:設定 VPC (目標帳戶)
如果目標帳戶中已存在 VPC,請略過此步驟。
# Create VPC aws ec2 create-vpc \ --cidr-block 10.0.0.0/16 \ --regionregion# Create subnet aws ec2 create-subnet \ --vpc-idvpc-id\ --cidr-block 10.0.1.0/24 \ --availability-zoneregiona \ --regionregion# Create security group aws ec2 create-security-group \ --group-nameopensearch-vpc-sg\ --description "Security group for OpenSearch VPC domain" \ --vpc-idvpc-id\ --regionregion# Allow inbound HTTPS aws ec2 authorize-security-group-ingress \ --group-idsecurity-group-id\ --protocol tcp \ --port 443 \ --cidr 10.0.0.0/16 \ --regionregion
進一步了解 VPC 網域建立。
步驟 3:建立 VPC 網域 (目標帳戶)
使用與 相同的命令步驟 3:建立 VPC 網域 (目標帳戶),但更新存取政策以允許來源帳戶的 IAM Identity Center 應用程式角色:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::source-account-id:role/NeoIdCAppRole" }, "Action": "es:ESHttp*", "Resource": "arn:aws:es:region:target-account-id:domain/vpc-domain-name/*" }] }
等待網域狀態變為 ,Active再繼續。
步驟 4:授權 OpenSearch UI 服務主體的 VPC 端點 (目標帳戶)
重要
這是 VPC 網域獨有的關鍵步驟。OpenSearch UI 服務必須明確授權才能存取 VPC 端點。
# Authorize the service principal aws opensearch authorize-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --regionregion# Verify authorization aws opensearch list-vpc-endpoint-access \ --domain-namevpc-domain-name\ --regionregion
預期回應:
{ "AuthorizedPrincipalList": [ { "PrincipalType": "AWS_SERVICE", "Principal": "application.opensearchservice.amazonaws.com" } ] }
步驟 5:建立 IAM Identity Center 應用程式的 IAM 角色 (來源帳戶)
在 OpenSearch UI 用於 IAM Identity Center 使用者資料平面存取的來源帳戶中建立 IAM 角色。
建立 IAM Identity Center 應用程式角色
-
建立信任政策:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:AssumeRole" }, { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:SetContext", "Condition": { "ForAllValues:ArnEquals": { "sts:RequestContextProviders": "arn:aws:iam::source-account-id:oidc-provider/portal.sso.region.amazonaws.com/apl/application-id" } } } ] } -
建立許可政策:
{ "Version": "2012-10-17", "Statement": [{ "Sid": "OpenSearchDomain", "Effect": "Allow", "Action": ["es:ESHttp*"], "Resource": "*" }] } -
建立角色並連接政策:
aws iam create-role \ --role-nameNeoIdCAppRole\ --assume-role-policy-document file://neoidc-trust-policy.jsonaws iam put-role-policy \ --role-nameNeoIdCAppRole\ --policy-nameNeoIdCAppPermissions\ --policy-document file://neoidc-permissions-policy.json
步驟 6:使用 IAM Identity Center (來源帳戶) 建立 OpenSearch UI 應用程式
aws opensearch create-application \ --regionregion\ --name "cross-account-vpc-idc-app" \ --iam-identity-center-options '{ "enabled":true, "iamIdentityCenterInstanceArn":"arn:aws:sso:::instance/ssoins-instance-id", "iamRoleForIdentityCenterApplicationArn":"arn:aws:iam::source-account-id:role/NeoIdCAppRole" }' \ --data-sources '[{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/vpc-domain-name", "dataSourceDescription":"Cross-account VPC domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"*\"]"}]'
步驟 7:建立和指派 IAM Identity Center 使用者和群組
建立 IAM Identity Center 使用者
執行下列命令。使用您的資訊取代預留位置的值。
aws identitystore create-user \ --identity-store-idd-directory-id\ --user-nameuser-email\ --display-name "display-name" \ --name Formatted=string,FamilyName=last-name,GivenName=first-name\ --emails Value=user-email,Type=work,Primary=true
建立 IAM Identity Center 群組並新增使用者
執行下列命令:
aws identitystore create-group \ --identity-store-idd-directory-id\ --display-name "OpenSearchUsers" \ --description "Users with OpenSearch access" aws identitystore create-group-membership \ --identity-store-idd-directory-id\ --group-idgroup-id\ --member-id UserId=user-id
將使用者或群組指派給應用程式
執行以下命令:
aws sso-admin create-application-assignment \ --application-arn "arn:aws:sso:::source-account-id:application/ssoins-instance-id/apl-application-id" \ --principal-iduser-id-or-group-id\ --principal-typeUSER
在目標網域上設定後端角色映射
將 IAM Identity Center 群組對應至目標網域上的 OpenSearch 安全角色:
curl -XPUT "https://domain-endpoint/_plugins/_security/api/rolesmapping/all_access" \ -uadmin:master-password\ -H 'Content-Type: application/json' \ -d '{ "backend_roles": ["group-id"], "hosts": [], "users": [] }'
步驟 8:驗證和存取
aws opensearch get-application \ --regionregion\ --idapplication-id
-
導覽至應用程式端點 URL。
-
使用 IAM Identity Center 使用者憑證登入。
-
IAM Identity Center 使用者的資料請求會使用 IAM Identity Center 應用程式角色簽署,而不是跨帳戶角色。
-
網域控制資料存取許可上的後端角色映射。
管理 應用程式
使用跨帳戶資料來源更新應用程式
執行下列命令。使用您的資訊取代預留位置的值。
aws opensearch update-application \ --regionregion\ --idapplication-id\ --data-sources '[{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/domain-1", "dataSourceDescription":"First cross-account domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" },{ "dataSourceArn":"arn:aws:es:region:target-account-id:domain/domain-2", "dataSourceDescription":"Second cross-account domain", "iamRoleForDataSourceArn":"arn:aws:iam::target-account-id:role/OpenSearchUIAccessRole" }]'
重要
更新操作會取代整個資料來源陣列。包含您要保留的所有資料來源。
列出應用程式
執行以下命令:
aws opensearch list-applications \ --regionregion
刪除應用程式
執行以下命令:
aws opensearch delete-application \ --regionregion\ --idapplication-id
撤銷 VPC 端點存取
執行以下命令:
aws opensearch revoke-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --regionregion
快速參考
下表摘要說明網域類型和身分驗證方法之間的主要差異。
| 面向 | 公有網域 | VPC 網域 |
|---|---|---|
| VPC 端點授權 | 非必要 | 必要 – 必須授權 application.opensearchservice.amazonaws.com |
| 網路設定 | 無 | VPC、子網路、具有 HTTPS (443) 傳入的安全群組 |
| IAM 存取政策 | 必要 | 必要 |
| 跨帳戶角色 | 跨帳戶的必要項目 | 跨帳戶的必要項目 |
| 面向 | IAM 使用者 | IAM Identity Center 使用者 |
|---|---|---|
| 資料平面登入資料 | 使用者自己的 IAM 登入資料 | IAM Identity Center 應用程式角色 |
| 存取控制 | 網域存取政策 | 網域存取政策和後端角色映射 |
| 其他設定 | 無 | IAM Identity Center 應用程式角色、使用者/群組建立、應用程式指派、後端角色映射 |
| OpenSearch UI 應用程式組態 | 沒有 IAM Identity Center 選項 | --iam-identity-center-options 必要 |
重要說明
-
iamRoleForDataSourceArn必須與 位於相同的 帳戶中dataSourceArn。 -
只有跨帳戶資料來源
iamRoleForDataSourceArn需要 。為相同帳戶資料來源省略它。 -
跨帳戶角色只需要
es:DescribeDomain許可。它永遠不會用於資料平面存取。 -
對於 VPC 網域,必須同時設定 IAM 政策和 VPC 端點授權。
-
支援的引擎版本:OpenSearch 1.3 及更高版本。
疑難排解
| 問題 | Resolution |
|---|---|
| 應用程式建立失敗,並顯示「無法存取網域」 | 確認跨帳戶角色具有 es:DescribeDomain許可,且信任政策允許來源帳戶。 |
| VPC 網域關聯失敗 | 確定 VPC 端點已獲得 的授權application.opensearchservice.amazonaws.com。 |
| IAM 使用者的資料平面存取遭拒 | 檢查目標網域存取政策是否允許 IAM 使用者或角色主體。 |
| IAM Identity Center 使用者的資料平面存取遭拒 | 確認後端角色映射包含 IAM Identity Center 群組 ID,且網域政策允許 IAM Identity Center 應用程式角色。 |
| 帳戶不相符錯誤 | 確定 iamRoleForDataSourceArn 位於與 中網域相同的 帳戶中dataSourceArn。 |