翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
OpenSearch ドメインへのクロスリージョンデータアクセス
OpenSearch UI アプリケーションは、異なる の OpenSearch ドメインにアクセスする AWS リージョン ように 1 つの AWS リージョンで設定できます。これにより、同じパーティション内の複数の AWS リージョンにわたって OpenSearch ドメインからデータを集約する統合ダッシュボードを作成できます。クロスリージョンデータソースのサポートでは、ターゲットドメインできめ細かなアクセスコントロールを有効にする必要があります。きめ細かなアクセスコントロールは、ドメインアクセスポリシー以外にも追加の認可レイヤーを提供するため、個々のインデックス、ドキュメント、フィールドへのアクセスを制御できます。
主要なコンセプト
- アプリケーションリージョン
-
OpenSearch UI アプリケーションがホスト AWS リージョン されている 。
- ターゲット リージョン
-
AWS リージョン OpenSearch ドメインが存在する 。これは、OpenSearch UI がそのリージョンで使用可能かどうかに関係なく、同じパーティション内の任意のリージョンにすることができます。
- クロスアカウントロール
-
データソースの関連付け中のみ使用されるターゲットアカウントの IAM ロール。OpenSearch UI はこのロールを引き受けて を呼び出します。これにより
es:DescribeDomain、ドメインエンドポイントを取得し、きめ細かなアクセスコントロールが有効になっていることを確認します。このロールは、ドメインがアプリケーションとは異なるアカウントにある場合にのみ必要です。詳細については、「OpenSearch ドメインへのクロスアカウントデータアクセス」を参照してください。 - IAM Identity Center アプリケーションロール
-
IAM Identity Center ユーザーデータプレーンアクセスに使用されるアプリケーションアカウントの IAM ロール。
- サポートされているリージョン (VPC ドメインの場合)
-
VPC ドメインの場合、VPC AWS リージョンエンドポイントを承認するときに OpenSearch UI アプリケーションがホストされている を許可リストに登録する必要があります。この許可リストは、OpenSearch UI が VPC ドメインを呼び出すために必要です。
前提条件
クロスリージョンデータアクセスを設定する前に、以下があることを確認してください。
-
AWS CLI のインストールと設定
-
アプリケーションリージョンとターゲットリージョンの両方 AWS アカウント の へのアクセス
-
きめ細かなアクセスコントロールが有効になっている OpenSearch ドメイン。マルチリージョンデータソースの関連付けは、きめ細かなアクセスコントロールが有効になっているドメインでのみサポートされます。
-
クロスアカウントシナリオの場合: ソースとターゲットの両方へのアクセス AWS アカウント
-
IAM Identity Center フローの場合: AWS IAM アイデンティティセンター 組織インスタンス。OpenSearch UI アプリケーションは、IAM Identity Center インスタンスと同じリージョンに存在する必要があります。
シナリオ
認証方法とドメイン設定に一致するシナリオを選択します。
各シナリオは、同じアカウントのクロスリージョンアクセスを対象としています。クロスアカウントクロスリージョンアクセスの場合は、これらのシナリオの手順と、「」で説明されているクロスアカウントロールの設定を組み合わせてくださいOpenSearch ドメインへのクロスアカウントデータアクセス。
シナリオ 1: 別のリージョンのパブリックドメインにアクセスする IAM ユーザー
このシナリオでは、1 つのリージョンに OpenSearch UI アプリケーションを作成し、同じアカウント内の別のリージョンにあるパブリック OpenSearch ドメインに接続します。
ステップ 1: OpenSearch ドメインを作成する (ターゲットリージョン)
きめ細かなアクセスコントロールを有効にして、ターゲットリージョンに OpenSearch ドメインを作成します。アクセスポリシーの範囲をアカウントのルートまたは特定の IAM プリンシパルに設定します。
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":"arn:aws:iam::account-id:root"},"Action":"es:ESHttp*","Resource":"arn:aws:es:target-region:account-id:domain/domain-name/*"}]}' \ --regiontarget-region
続行するActive前に、ドメインのステータスが になるまで待ちます。
ステップ 2: OpenSearch UI アプリケーションを作成する (アプリケーションリージョン)
クロスリージョンデータソースを使用して、アプリケーションリージョンにアプリケーションを作成します。リージョンはデータソース ARN から自動的に抽出されます。
aws opensearch create-application \ --regionapplication-region\ --name "cross-region-iam-app" \ --data-sources '[{ "dataSourceArn":"arn:aws:es:target-region:account-id:domain/domain-name", "dataSourceDescription":"Cross-region domain" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"test-user\"]"}]'
ステップ 3: 検証とアクセス
アプリケーションの詳細を取得してエンドポイント URL を取得します。
aws opensearch get-application \ --regionapplication-region\ --idapplication-id
-
レスポンスからアプリケーションエンドポイント URL に移動します。
-
IAM 認証情報を使用してサインインします。
-
IAM ユーザーは、独自の認証情報を使用してデータプレーンリクエストに署名します。
-
ターゲットドメインのアクセスポリシーとバックエンドロールマッピングは、ユーザーがアクセスできるデータを制御します。
シナリオ 2: 別のリージョンのパブリックドメインにアクセスする IAM Identity Center ユーザー
このシナリオでは、1 つのリージョンで IAM アイデンティティセンター認証を使用して OpenSearch UI アプリケーションを作成し、同じアカウント内の別のリージョンのパブリック OpenSearch ドメインに接続します。
ステップ 1: IAM アイデンティティセンターを有効にして OpenSearch ドメインを作成する (ターゲットリージョン)
きめ細かなアクセスコントロールと IAM Identity Center 統合を有効にして、ターゲットリージョンに OpenSearch ドメインを作成します。で --identity-center-optionsパラメータを使用してIdentityCenterInstanceRegion、IAM Identity Center インスタンスが配置されているリージョンを指定します。このリージョンは、OpenSearch UI アプリケーションがホストされているリージョンと同じである必要があります。
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"}' \ --identity-center-options '{"EnabledAPIAccess":true,"IdentityCenterInstanceARN":"arn:aws:sso:::instance/ssoins-instance-id","IdentityCenterInstanceRegion":"idc-region","RolesKey":"GroupId","SubjectKey":"UserId"}' \ --access-policies '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::account-id:role/NeoIdCAppRole"},"Action":"es:ESHttp*","Resource":"arn:aws:es:target-region:account-id:domain/domain-name/*"}]}' \ --regiontarget-region
続行するActive前に、ドメインのステータスが になるまで待ちます。
ステップ 2: IAM Identity Center アプリケーションの IAM ロールを作成する
OpenSearch UI が IAM Identity Center ユーザーデータプレーンアクセスに使用する IAM ロールを作成します。
IAM Identity Center アプリケーションロールを作成するには
-
sts:AssumeRoleステートメントのみを使用して信頼ポリシーを作成します。次のステップでアプリケーションを作成した後、このポリシーを更新してsts:SetContextステートメントを追加します。{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } -
アクセス許可ポリシーを作成します。
{ "Version": "2012-10-17", "Statement": [{ "Sid": "OpenSearchDomain", "Effect": "Allow", "Action": ["es:ESHttp*"], "Resource": "arn:aws:es:target-region:account-id:domain/domain-name/*" }] } -
ロールを作成し、ポリシーをアタッチします。
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
ステップ 3: IAM アイデンティティセンターで OpenSearch UI アプリケーションを作成する (アプリケーションリージョン)
注記
IAM Identity Center インスタンスが OpenSearch UI アプリケーションリージョンと同じリージョンにあることを確認します。
aws opensearch create-application \ --regionapplication-region\ --name "cross-region-idc-app" \ --iam-identity-center-options '{ "enabled":true, "iamIdentityCenterInstanceArn":"arn:aws:sso:::instance/ssoins-instance-id", "iamRoleForIdentityCenterApplicationArn":"arn:aws:iam::account-id:role/NeoIdCAppRole" }' \ --data-sources '[{ "dataSourceArn":"arn:aws:es:target-region:account-id:domain/domain-name", "dataSourceDescription":"Cross-region domain" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"test-user\"]"}]'
アプリケーションを作成したら、レスポンスの SSO アプリケーション ID を書き留めます。次に、IAM Identity Center アプリケーションロールの信頼ポリシーを更新して、sts:SetContextステートメントを追加します。
{ "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::account-id:oidc-provider/portal.sso.idc-region.amazonaws.com/apl/application-id" } } } ] }
aws iam update-assume-role-policy \ --role-nameNeoIdCAppRole\ --policy-document file://updated-trust-policy.json
ステップ 4: 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::account-id:application/ssoins-instance-id/apl-application-id" \ --principal-iduser-id-or-group-id\ --principal-typeUSER
ターゲットドメインでバックエンドロールマッピングを設定する
IAM Identity Center グループをターゲットドメインの OpenSearch セキュリティロールにマッピングします。
curl -XPATCH "https://domain-endpoint/_plugins/_security/api/rolesmapping/all_access" \ -uadmin:master-password\ -H 'Content-Type: application/json' \ -d '[{"op": "add", "path": "/backend_roles", "value": ["group-id"]}]'
ステップ 5: 検証とアクセス
アプリケーションの詳細を取得してエンドポイント URL を取得します。
aws opensearch get-application \ --regionapplication-region\ --idapplication-id
-
アプリケーションエンドポイント URL に移動します。
-
IAM Identity Center ユーザー認証情報を使用してサインインします。
-
IAM Identity Center ユーザーのデータリクエストは、IAM Identity Center アプリケーションロールで署名されます。
-
ドメインコントロールデータアクセス許可のバックエンドロールマッピング。
シナリオ 3: 別のリージョンの VPC ドメインにアクセスする IAM ユーザー
このシナリオでは、1 つのリージョンに OpenSearch UI アプリケーションを作成し、同じアカウント内の別のリージョンの VPC OpenSearch ドメインに接続します。VPC ドメインには、追加のネットワーク設定と、クロスリージョンサポートによる明示的な VPC エンドポイント認可が必要です。
ステップ 1: VPC をセットアップする (ターゲットリージョン)
ターゲットリージョンに VPC がすでに存在する場合は、このステップをスキップします。
# Create VPC aws ec2 create-vpc \ --cidr-block 10.0.0.0/16 \ --regiontarget-region# Create subnet aws ec2 create-subnet \ --vpc-idvpc-id\ --cidr-block 10.0.1.0/24 \ --availability-zonetarget-regiona \ --regiontarget-region# Create security group aws ec2 create-security-group \ --group-nameopensearch-vpc-sg\ --description "Security group for OpenSearch VPC domain" \ --vpc-idvpc-id\ --regiontarget-region# Allow inbound HTTPS aws ec2 authorize-security-group-ingress \ --group-idsecurity-group-id\ --protocol tcp \ --port 443 \ --cidr 10.0.0.0/16 \ --regiontarget-region
VPC ドメインの作成について詳しく説明します。
ステップ 2: 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":"arn:aws:iam::account-id:root"},"Action":"es:ESHttp*","Resource":"arn:aws:es:target-region:account-id:domain/vpc-domain-name/*"}]}' \ --regiontarget-region
続行するActive前に、ドメインのステータスが になるまで待ちます。
ステップ 3: クロスリージョンサポート (ターゲットリージョン) を使用して OpenSearch UI サービスプリンシパルの VPC エンドポイントを承認する
# Authorize the service principal with cross-region support aws opensearch authorize-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --service-options '{"SupportedRegions":["target-region","application-region"]}' \ --regiontarget-region# Verify authorization aws opensearch list-vpc-endpoint-access \ --domain-namevpc-domain-name\ --regiontarget-region
予想されるレスポンス
{ "AuthorizedPrincipalList": [ { "PrincipalType": "AWS_SERVICE", "Principal": "application.opensearchservice.amazonaws.com", "ServiceOptions": { "SupportedRegions": ["target-region", "application-region"] } } ] }
ステップ 4: OpenSearch UI アプリケーションを作成する (アプリケーションリージョン)
aws opensearch create-application \ --regionapplication-region\ --name "cross-region-vpc-iam-app" \ --data-sources '[{ "dataSourceArn":"arn:aws:es:target-region:account-id:domain/vpc-domain-name", "dataSourceDescription":"Cross-region VPC domain" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"test-user\"]"}]'
ステップ 5: 検証とアクセス
アプリケーションの詳細を取得してエンドポイント URL を取得します。
aws opensearch get-application \ --regionapplication-region\ --idapplication-id
-
レスポンスからアプリケーションエンドポイント URL に移動します。
-
IAM 認証情報を使用してサインインします。
-
IAM ユーザーは、独自の認証情報を使用してデータプレーンリクエストに署名します。
-
ターゲットドメインのアクセスポリシーとバックエンドロールマッピングは、ユーザーがアクセスできるデータを制御します。
シナリオ 4: 別のリージョンの VPC ドメインにアクセスする IAM Identity Center ユーザー
このシナリオでは、1 つのリージョンで IAM アイデンティティセンター認証を使用して OpenSearch UI アプリケーションを作成し、同じアカウント内の別のリージョンの VPC OpenSearch ドメインに接続します。
ステップ 1: VPC をセットアップする (ターゲットリージョン)
ターゲットリージョンに VPC がすでに存在する場合は、このステップをスキップします。
# Create VPC aws ec2 create-vpc \ --cidr-block 10.0.0.0/16 \ --regiontarget-region# Create subnet aws ec2 create-subnet \ --vpc-idvpc-id\ --cidr-block 10.0.1.0/24 \ --availability-zonetarget-regiona \ --regiontarget-region# Create security group aws ec2 create-security-group \ --group-nameopensearch-vpc-sg\ --description "Security group for OpenSearch VPC domain" \ --vpc-idvpc-id\ --regiontarget-region# Allow inbound HTTPS aws ec2 authorize-security-group-ingress \ --group-idsecurity-group-id\ --protocol tcp \ --port 443 \ --cidr 10.0.0.0/16 \ --regiontarget-region
VPC ドメインの作成について詳しく説明します。
ステップ 2: IAM アイデンティティセンターを有効にして VPC ドメインを作成する (ターゲットリージョン)
きめ細かなアクセスコントロール、IAM Identity Center 統合、VPC 設定を有効にして、ターゲットリージョンに OpenSearch ドメインを作成します。アクセスポリシーを更新して IAM Identity Center アプリケーションロールを許可し、 --identity-center-optionsパラメータを追加します。
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"}' \ --identity-center-options '{"EnabledAPIAccess":true,"IdentityCenterInstanceARN":"arn:aws:sso:::instance/ssoins-instance-id","IdentityCenterInstanceRegion":"idc-region","RolesKey":"GroupId","SubjectKey":"UserId"}' \ --access-policies '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::account-id:role/NeoIdCAppRole"},"Action":"es:ESHttp*","Resource":"arn:aws:es:target-region:account-id:domain/vpc-domain-name/*"}]}' \ --regiontarget-region
続行するActive前に、ドメインのステータスが になるまで待ちます。
ステップ 3: クロスリージョンサポート (ターゲットリージョン) を使用して OpenSearch UI サービスプリンシパルの VPC エンドポイントを承認する
重要
これは、クロスリージョンアクセスを持つ VPC ドメインに固有の重要なステップです。OpenSearch UI サービスには、VPC エンドポイントへのアクセスを明示的に許可し、アプリケーションリージョンをSupportedRegionsリストに含める必要があります。
# Authorize the service principal with cross-region support aws opensearch authorize-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --service-options '{"SupportedRegions":["target-region","application-region"]}' \ --regiontarget-region# Verify authorization aws opensearch list-vpc-endpoint-access \ --domain-namevpc-domain-name\ --regiontarget-region
予想されるレスポンス
{ "AuthorizedPrincipalList": [ { "PrincipalType": "AWS_SERVICE", "Principal": "application.opensearchservice.amazonaws.com", "ServiceOptions": { "SupportedRegions": ["target-region", "application-region"] } } ] }
ステップ 4: IAM Identity Center アプリケーションの IAM ロールを作成する
OpenSearch UI が IAM Identity Center ユーザーデータプレーンアクセスに使用する IAM ロールを作成します。
IAM Identity Center アプリケーションロールを作成するには
-
sts:AssumeRoleステートメントのみを使用して信頼ポリシーを作成します。次のステップでアプリケーションを作成した後、このポリシーを更新してsts:SetContextステートメントを追加します。{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "application.opensearchservice.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } -
アクセス許可ポリシーを作成します。
{ "Version": "2012-10-17", "Statement": [{ "Sid": "OpenSearchDomain", "Effect": "Allow", "Action": ["es:ESHttp*"], "Resource": "arn:aws:es:target-region:account-id:domain/vpc-domain-name/*" }] } -
ロールを作成し、ポリシーをアタッチします。
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
ステップ 5: IAM アイデンティティセンターで OpenSearch UI アプリケーションを作成する (アプリケーションリージョン)
aws opensearch create-application \ --regionapplication-region\ --name "cross-region-vpc-idc-app" \ --iam-identity-center-options '{ "enabled":true, "iamIdentityCenterInstanceArn":"arn:aws:sso:::instance/ssoins-instance-id", "iamRoleForIdentityCenterApplicationArn":"arn:aws:iam::account-id:role/NeoIdCAppRole" }' \ --data-sources '[{ "dataSourceArn":"arn:aws:es:target-region:account-id:domain/vpc-domain-name", "dataSourceDescription":"Cross-region VPC domain" }]' \ --app-configs '[{"key":"opensearchDashboards.dashboardAdmin.users","value":"[\"test-user\"]"}]'
アプリケーションを作成したら、レスポンスの SSO アプリケーション ID を書き留めます。次に、IAM Identity Center アプリケーションロールの信頼ポリシーを更新して、sts:SetContextステートメントを追加します。
{ "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::account-id:oidc-provider/portal.sso.idc-region.amazonaws.com/apl/application-id" } } } ] }
aws iam update-assume-role-policy \ --role-nameNeoIdCAppRole\ --policy-document file://updated-trust-policy.json
ステップ 6: IAM Identity Center ユーザーとグループを作成して割り当てる
ユーザー、グループステップ 4: IAM Identity Center ユーザーとグループを作成して割り当てるを作成し、アプリケーションに割り当て、ターゲットドメインでバックエンドロールマッピングを設定するには、 と同じ手順に従います。
ステップ 7: 検証とアクセス
アプリケーションの詳細を取得してエンドポイント URL を取得します。
aws opensearch get-application \ --regionapplication-region\ --idapplication-id
-
アプリケーションエンドポイント URL に移動します。
-
IAM Identity Center ユーザー認証情報を使用してサインインします。
-
IAM Identity Center ユーザーのデータリクエストは、IAM Identity Center アプリケーションロールで署名されます。
-
ドメインコントロールデータアクセス許可のバックエンドロールマッピング。
アプリケーションの管理
クロスリージョンデータソースを使用してアプリケーションを更新する
以下のコマンドを実行してください。プレースホルダー値を、ユーザー自身の情報に置き換えます。
aws opensearch update-application \ --regionapplication-region\ --idapplication-id\ --data-sources '[{ "dataSourceArn":"arn:aws:es:target-region-1:account-id:domain/domain-1", "dataSourceDescription":"Domain in target Region 1" },{ "dataSourceArn":"arn:aws:es:target-region-2:account-id:domain/domain-2", "dataSourceDescription":"Domain in target Region 2" }]'
重要
更新オペレーションは、データソース配列全体を置き換えます。保持するすべてのデータソースを含めます。
アプリケーションを一覧表示する
次のコマンドを実行します。
aws opensearch list-applications \ --regionapplication-region
アプリケーションの削除
次のコマンドを実行します。
aws opensearch delete-application \ --regionapplication-region\ --idapplication-id
特定のリージョンの VPC エンドポイントアクセスを取り消す
他の を保持しながら特定の AWS リージョンのクロスリージョンアクセスを取り消すには、 --service-optionsパラメータをリージョンとともに使用して取り消します。
aws opensearch revoke-vpc-endpoint-access \ --domain-namevpc-domain-name\ --service "application.opensearchservice.amazonaws.com" \ --service-options '{"SupportedRegions":["region-to-revoke"]}' \ --regiontarget-region
クイックリファレンス
次の表は、ドメインタイプ、認証方法、同一リージョンアクセスとクロスリージョンアクセスの主な違いをまとめたものです。
| 側面 | パブリックドメイン | VPC ドメイン |
|---|---|---|
| VPC エンドポイント認可 | 不要 | 必須 – application.opensearchservice.amazonaws.comで を承認する必要があります SupportedRegions |
| ネットワーク設定 | なし | HTTPS (443) インバウンドの VPC、サブネット、セキュリティグループ |
| IAM アクセスポリシー | 必須 | 必須 |
| 側面 | IAM ユーザー | IAM Identity Center ユーザー |
|---|---|---|
| データプレーンの認証情報 | ユーザー独自の IAM 認証情報 | IAM Identity Center アプリケーションロール |
| アクセスコントロール | ドメインアクセスポリシーとバックエンドロールマッピング | ドメインアクセスポリシーとバックエンドロールマッピング |
| アプリケーションリージョンの制約 | 任意のリージョン | IAM Identity Center インスタンスと同じリージョンに存在する必要があります |
| ドメイン設定 | 標準 | --identity-center-options で必要 IdentityCenterInstanceRegion |
| 追加セットアップ | なし | IAM Identity Center アプリケーションロール、ユーザー/グループの作成、アプリケーションの割り当て、バックエンドロールマッピング |
| 側面 | 同一リージョン | クロスリージョン |
|---|---|---|
| データソース ARN | アプリケーションと同じリージョン | アプリケーションとは異なるリージョン (同じパーティション) |
| VPC エンドポイント認可 | 省略 --service-options |
--service-options に を含める SupportedRegions |
| IAM Identity Center ドメイン設定 | IdentityCenterInstanceRegion が任意 |
IdentityCenterInstanceRegion が必須 |
| クロスパーティションサポート | 該当なし | サポートされていない – データソースは同じパーティションに存在する必要があります |
重要な注意事項
-
クロスリージョンデータソースの関連付けでは、ターゲットドメインできめ細かなアクセスコントロールを有効にする必要があります。
-
クロスリージョンデータソースは同じパーティション内にある必要があります。クロスパーティションアクセス ( から など
aws-cn)awsはサポートされていません。 -
データソースリージョンは、データソース ARN から自動的に抽出されます。
CreateApplicationまたはUpdateApplicationAPIs では、追加のリージョンパラメータは必要ありません。 -
同一アカウントのクロスリージョンデータソースの場合、
iamRoleForDataSourceArnは必要ありません。これは、クロスアカウントデータソースにのみ必要です。 -
VPC ドメインの場合は、 を呼び出すときに
SupportedRegionsパラメータにアプリケーションリージョンを含める必要がありますAuthorizeVpcEndpointAccess。を省略すると、同じリージョンのアクセスのみが--service-options許可されます。 -
IAM Identity Center フローの場合、OpenSearch UI アプリケーションは IAM Identity Center インスタンスと同じリージョンに存在する必要があります。
-
クロスリージョンドメインを持つ IAM Identity Center フローの場合、クロスリージョントークンイントロスペクションを有効にする
--identity-center-optionsには、ターゲットドメインIdentityCenterInstanceRegionに を含める必要があります。 -
サポートされているエンジンバージョン: OpenSearch 1.3 以降。
トラブルシューティング
| 問題 | 解決方法 |
|---|---|
| 「ドメインにアクセスできません」でアプリケーションの作成が失敗する | ドメインがターゲットリージョンに存在し、きめ細かなアクセスコントロールが有効になっていることを確認します。クロスアカウントシナリオでは、クロスアカウントロールに アクセスes:DescribeDomain許可があり、信頼ポリシーでソースアカウントが許可されていることを確認します。 |
| クロスリージョンの VPC ドメインアクセスが失敗する | に含まれているアプリケーションリージョンapplication.opensearchservice.amazonaws.comを使用して、VPC エンドポイントが に対して承認されていることを確認しますSupportedRegions。 |
| IAM ユーザーのデータプレーンアクセスが拒否されました | ターゲットドメインアクセスポリシーが IAM ユーザーまたはロールプリンシパルを許可し、きめ細かなアクセスコントロールバックエンドロールマッピングが適切なアクセス許可を付与していることを確認します。 |
| IAM Identity Center ユーザーのデータプレーンアクセスが拒否されました | バックエンドロールマッピングに IAM Identity Center グループ ID が含まれ、ドメインポリシーIdentityCenterInstanceRegionで IAM Identity Center アプリケーションロールが許可され、ドメインの OpenSearch UI アプリケーションと同じリージョンに正しく設定されていることを確認します。 |
| クロスパーティションデータソースが拒否されました | クロスパーティションアクセスはサポートされていません。データソース ARN がアプリケーションと同じパーティションにあることを確認します。 |
| クロスリージョンドメインの IAM Identity Center 認証が失敗する | IdentityCenterInstanceRegion IAM Identity Center インスタンスが有効になっている正しいリージョンに が設定されていることを確認します。OpenSearch UI アプリケーションも同じリージョンに存在する必要があります。 |