専有クラスター向けプライベートエンドポイントのセットアップ
注意
この機能は、M0
無料クラスターと Flex クラスターでは使用できません。 利用できない機能について詳しくは、「 Atlas M0 (無料クラスター)、M2 、M5 の制限 を参照してください。
クライアントがプライベートエンドポイントを使用して Atlas 専用クラスターに接続できるようにするには、次の手順に従います。
Atlas でプライベート エンドポイントを使用する方法の詳細については、「Atlas のプライベート エンドポイントについて」を参照してください。
必要なアクセス権
専有クラスターのプライベート エンドポイントを設定するには、プロジェクトに対する Organization Owner
または Project Owner
アクセス権が必要です。
前提条件、考慮事項、および制限事項
プライベートエンドポイントを設定する際の前提条件、考慮事項、制限については、以下のリソースを参照してください。
実行手順
Atlas CLI を介して Amazon Web Services PrivateLink を設定するには、 がAtlas CLI をインストールし、Atlas CLI から接続します。その後、次の手順を実行します。
Atlas でプライベートエンドポイント サービスを作成します。
Atlas CLI コマンドを実行して、Atlas で Amazon Web Services PrivateLink のセットアップを開始します。Atlas はこれらのリソースをプライベートエンドポイント サービスの形式で表現します。
--region
の値が、クラスターを配置したリージョンと一致していることを確認します。atlas privateEndpoints aws create [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints aws create を参照してください。
マルチリージョンまたはマルチクラウド クラスターを使用していて、リージョン化されたプライベートエンドポイントを有効にしていない場合は、プロバイダーとリージョンごとにエンドポイントをプロビジョニングする必要があります。
レスポンスにあるプライベートエンドポイント サービスの ID に注目してください。この例では、IDは
6344ac8f51b94c6356527881
です。Private endpoint '6344ac8f51b94c6356527881' created.
プライベートエンドポイント サービス名を取得します。
注意
Atlas がプライベートエンドポイントをプロビジョニングするには、しばらく時間がかかる場合があります。この手順を完了する前に、1 分から 2 分待ちます。
Atlas CLI コマンドを実行し、ID を使用してプライベートエンドポイントを記述します。
atlas privateEndpoints aws describe <privateEndpointId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints aws describe を参照してください。
レスポンス内にある
ENDPOINT SERVICE
の値に注目してください。この値は、このプライベートエンドポイントに関連付けられている プライベートエンドポイント サービスの名前を示しています。この例では、エンドポイント サービスの名前はcom.amazonaws.vpce.us-east-1.vpce-svc-0705499aae25ac77c
です。ID ENDPOINT SERVICE STATUS ERROR 6344ac8f51b94c6356527881 com.amazonaws.vpce.us-east-1.vpce-svc-0705499aae25ac77c AVAILABLE STATUS
の値がINITIATING
である場合は、Atlas がプライベートエンドポイントをプロビジョニングするまでさらに 1 ~ 2 分待ちます。それから、このステップをもう一度試してください。
AWS でインターフェイスエンドポイントを作成します。
Amazon Web Services CLI でコマンドを実行し、次のプレースホルダーを実際の値に置き換えます。
プレースホルダー説明{VPC ID}
ピア AWS VPCを識別する一意の文字列。この値は、AWS アカウントの VPC ダッシュボードで確認できます。
{REGION}
クラスターが存在する AWS リージョン。
{サブネット ID}
Amazon Web Services VPCが使用するサブネットを識別するユニークな文字列。これらの値は、 Amazon Web Services アカウントの Subnet ダッシュボードで確認できます。
重要
少なくとも 1 つのサブネットを指定する必要があります。そうしないと、Amazon Web Services は VPC に インターフェースエンドポイント をプロビジョニングしません。VPC 内のクライアントがプライベートエンドポイントにトラフィックを送信するには、インターフェースエンドポイントが必要です。
{サービス名}
以前に取得したプライベート エンドポイント サービスを識別する一意の文字列。
aws ec2 create-vpc-endpoint --vpc-id {VPC-ID} \ --region {REGION} --service-name {SERVICE-NAME} \ --vpc-endpoint-type Interface --subnet-ids {SUBNET-IDS} Amazon Web Services CLI の詳細については、「 インターフェイスエンドポイントの作成」を参照してください。
フィールド
VpcEndpointId
のレスポンスの値に注目してください。 これはプライベートエンドポイントを識別する 22 文字の英数字stringです。 この値は、 Amazon Web Services VPCダッシュボードの Endpoints > VPC ID でも確認できます。
VPC エンドポイント ID を使用してプライベートエンドポイントを更新します。
Atlas CLI コマンドを実行し、Atlas エンドポイント サービス ID と VPC エンドポイント ID を使用して、インターフェイスエンドポイント情報を Atlas に提供します。この例では、次のパラメーターを設定します。
Parameterタイプ値の例endpointServiceId
Argument
6344ac8f51b94c6356527881
privateEndpointId
オプション
vpce-00713b5e644e830a3
atlas privateEndpoints aws interfaces create <endpointServiceId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints aws interfaces create を参照してください。
インターフェース エンドポイントとの間でトラフィックを送受信するように、リソースのセキュリティ グループを構成します。
AWS PrivateLink を使用して Atlas クラスターに接続する必要があるリソースごとに、リソースのセキュリティグループは、すべてのポートでインターフェイスエンドポイントのプライベート IP アドレスへのアウトバウンド トラフィックを許可する必要があります。
「 セキュリティ グループへのルールの追加 」を 参照してください。 詳しくは、 を参照してください。
インターフェイスエンドポイントのセキュリティグループを作成して、リソースがアクセスできるようにします。
このセキュリティグループは、AWS PrivateLink を使用して Atlas クラスターに接続する必要がある各リソースからのすべてのポートでインバウンド トラフィックを許可する必要があります。
Amazon Web Servicesコンソールで、VPC Dashboard に移動します。
[Security Groups をクリックし、[Create security group] をクリックします。
ウィザードを使用してセキュリティ グループを作成します。VPC リストから VPC を選択していることを確認します。
作成したセキュリティ グループを選択し、Inbound Rules タブをクリックします。
[Edit Rules] をクリックします。
Atlas クラスターに接続する VPC 内の各リソースからのすべてのインバウンド トラフィックを許可するルールを追加します。
[Save Rules] をクリックします。
[Endpoints] をクリックし、VPC のエンドポイントをクリックします。
[Security Groups] タブをクリックし、次に [Edit Security Groups] をクリックします。
作成したセキュリティ グループを追加し、Save をクリックします。
VPCセキュリティ グループ の詳細については、 については、Amazon Web Services のドキュメントを参照してください。
プライベートエンドポイントが利用可能かどうか確認します。
Atlas がすべてのリソースの構成を完了し、プライベートエンドポイントが使用可能になったら、AWS PrivateLink プライベートエンドポイントを使用してクラスターに接続できます。
次の方法で Amazon Web Services プライベートエンドポイントが利用可能かどうかを確認します。
Atlas CLI コマンドを実行し、ID を使用してインターフェイスエンドポイントを記述します。この例では、次のパラメーターを設定します。
Parameterタイプ値の例interfaceEndpointId
Argument
vpce-00713b5e644e830a3
endpointServiceId
オプション
6344ac8f51b94c6356527881
atlas privateEndpoints aws interfaces describe <interfaceEndpointId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints aws interfaces describe を参照してください。
次の例に示すように、
STATUS
フィールドの値がAVAILABLE
であることを確認します。ID STATUS ERROR vpce-00713b5e644e830a3 AVAILABLE
UI AWS PrivateLinkを通じて を設定するには、次の手順に従います。Atlas
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントを設定します。
重要
接続の中断を避けるためには、正しい情報を指定する必要があります。この手順のコマンドとサブステップをスキップしないことをお勧めいたします。
Amazon Web Services VPCに関する次の詳細を入力します。
Your VPC ID
ピアAmazon Web Services VPCの一意の識別子。 この値は、 Amazon Web Services アカウントの VPC ダッシュボードで確認できます。
Your Subnet IDs
Amazon Web Services VPCが使用するサブネットのユニークな識別子。
これらの値は、Amazon Web Services アカウントのSubnet ダッシュボードで確認できます。
少なくとも 1 つのサブネットを指定する必要があります。そうしないと、Amazon Web Services は VPC に インターフェースエンドポイント をプロビジョニングしません。VPC 内のクライアントがプライベートエンドポイントにトラフィックを送信するには、インターフェースエンドポイントが必要です。
ダイアログボックスに表示されるコマンドをコピーし、Amazon Web Services CLI を使用して実行します。
注意
この手順をスキップすると、プライベートエンドポイント サービスのインターフェイスエンドポイントは作成されません。
Atlas がバックグラウンドで VPC リソースの作成を完了するまで、コマンドをコピーすることはできません。
「インターフェースエンドポイントの作成」を参照して、Amazon Web Services CLI を使用してこのタスクを実行します。
[Next] をクリックします。
インターフェース エンドポイントとの間でトラフィックを送受信するように、リソースのセキュリティ グループを構成します。
AWS PrivateLink を使用して Atlas クラスターに接続する必要があるリソースごとに、リソースのセキュリティグループは、すべてのポートでインターフェイスエンドポイントのプライベート IP アドレスへのアウトバウンド トラフィックを許可する必要があります。
「 セキュリティ グループへのルールの追加 」を 参照してください。 詳しくは、 を参照してください。
インターフェイスエンドポイントのセキュリティグループを作成して、リソースがアクセスできるようにします。
このセキュリティグループは、AWS PrivateLink を使用して Atlas クラスターに接続する必要がある各リソースからのすべてのポートでインバウンド トラフィックを許可する必要があります。
Amazon Web Servicesコンソールで、VPC Dashboard に移動します。
[Security Groups をクリックし、[Create security group] をクリックします。
ウィザードを使用してセキュリティ グループを作成します。VPC リストから VPC を選択していることを確認します。
作成したセキュリティ グループを選択し、Inbound Rules タブをクリックします。
[Edit Rules] をクリックします。
Atlas クラスターに接続する VPC 内の各リソースからのすべてのインバウンド トラフィックを許可するルールを追加します。
[Save Rules] をクリックします。
[Endpoints] をクリックし、VPC のエンドポイントをクリックします。
[Security Groups] タブをクリックし、次に [Edit Security Groups] をクリックします。
作成したセキュリティ グループを追加し、Save をクリックします。
VPCセキュリティ グループ の詳細については、 については、Amazon Web Services のドキュメントを参照してください。
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントが利用可能であることを確認します。
すべてのリソースが構成され、プライベートエンドポイントが使用可能になったら、AWS PrivateLink プライベートエンドポイントを使用して Atlas クラスターに接続できます。
AWS PrivateLink プライベート エンドポイントが利用可能かどうかを確認するには、次の手順を実行します。
Private Endpoint タブで、クラスター タイプを選択し、AWS PrivateLink を使用して接続するクラスターが含まれるリージョンの、次のステータスを確認します。
Atlas Endpoint Service Status | 利用可能 |
Endpoint Status | 利用可能 |
ステータス値の詳細については、 「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。
このようなステータスが表示されない場合は、追加情報については「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。
Atlas CLI 経由で Amazon Web Services PrivateLink を設定するには、 Atlas CLI をインストールし、Atlas CLI から接続します。その後、次の手順を実行します。
Atlas でプライベートエンドポイント サービスを作成します。
Atlas CLI コマンドを実行して、Atlas でプライベートエンドポイントとプライベートエンドポイント サービスを作成します。
--region
の値が、クラスターを配置したリージョンと一致していることを確認します。atlas privateEndpoints azure create [options] コマンド構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints azure create を参照してください。
マルチリージョンまたはマルチクラウド クラスターを使用していて、リージョン化されたプライベートエンドポイントを有効にしていない場合は、プロバイダーとリージョンごとにエンドポイントをプロビジョニングする必要があります。
レスポンスにあるプライベートエンドポイント サービスの ID に注目してください。この例では、IDは
6344ac8f51b94c6356527881
です。Private endpoint '6344ac8f51b94c6356527881' created.
プライベートエンドポイント サービス名を取得します。
注意
Atlas がプライベートエンドポイントをプロビジョニングするには、しばらく時間がかかる場合があります。この手順を完了する前に、1 分から 2 分待ちます。
Atlas CLI コマンドを実行し、サービス ID を使用してプライベートエンドポイントを記述します。
atlas privateEndpoints azure describe <privateEndpointId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints azure describe を参照してください。
レスポンス内にある
ENDPOINT SERVICE
の値に注目してください。この値は、エンドポイント サービスの名前を示しています。この例では、エンドポイント サービスの名前はpls_6344ac8f51b94c6356527881
です。ID ENDPOINT SERVICE STATUS ERROR 6344ac8f51b94c6356527881 pls_6344ac8f51b94c6356527881 AVAILABLE STATUS
の値がINITIATING
である場合は、Atlas がプライベートエンドポイントをプロビジョニングするまでさらに 1 ~ 2 分待ちます。それから、このステップをもう一度試してください。
Azure でエンドポイントを作成します。
Azure CLI で
az network private-endpoint create
コマンドを実行し、次のプレースホルダーを実際の値に置き換えます。プレースホルダー説明{リソース グループ名}
Atlas への接続に使用する VNet を含む Azure リソース グループの名前。この値は、Azure ダッシュボードの [Resource Group Properties] ページで確認できます。
{仮想ネットワーク名}
Atlas への接続に使用する VNet の名前。この値は、Azure ダッシュボードの [Virtual Network] ページで確認できます。
{サブネット名}
Azure VNet 内のサブネットの名前。この値は、Azure ダッシュボードの [Virtual Network Subnets] ページで確認できます。
{プライベートエンドポイント名}
Azureリソース グループ内のプライベートエンドポイントを識別する、人間が判読できるラベル。
{サブスクリプション ID}
Azure のサブスクリプションを識別するユニークな文字列。この値は、Azure の [Subscriptions] ページで確認できます。
{リソース グループ ID}
上の リソースstring Azureグループを識別する一意の 。Atlasこの値は、Atlas UI のNetwork Accessページの [ Private Endpoint ] タブの下にあります。
この値は
rg_
で始まり、rg_65c66a56a3a43...
に似た文字と数字の組み合わせを含みます。{エンドポイント サービス名}
エンドポイント サービスを識別する一意の文字列。これは、前のステップで返されたエンドポイント サービス名です。
az network private-endpoint create --resource-group {RESOURCE-GROUP-NAME} --name {PRIVATE-ENDPOINT-NAME} --vnet-name {VIRTUAL-NETWORK-NAME} --subnet {SUBNET-NAME} --private-connection-resource-id /subscriptions/{SUBSCRIPTION-ID}/resourceGroups/{RESOURCE-GROUP-ID}/providers/Microsoft.Network/privateLinkServices/{ENDPOINT-SERVICE-NAME} --connection-name {ENDPOINT-SERVICE-NAME} --manual-request true Azure CLI の詳細については、「Azure CLI を使用したプライベートエンドポイントの作成」を参照してください。
次の値をコピーして保存します。
Resource ID
Azure VNet 内のプライベートエンドポイントを識別するユニークな文字列。次のいずれかの方法でこの値を見つけます。
この値を取得するには、Azure ダッシュボードを使用します。Azure ダッシュボードのプライベートエンドポイントの [Properties] ページの [Resource ID] フィールドにこのプロパティが表示されます。
次のコマンドの出力を使用します。このコマンドは、
id
フィールドでハイライトされている値を返します。1 azure network private-endpoint create 1 { 2 "customDnsConfigs": [], 3 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 4 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 5 "location": "eastus2", 6 "manualPrivateLinkServiceConnections": [ 7 { 8 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 9 "groupIds": null, 10 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink/manualPrivateLinkServiceConnections/pls_5f860388d432510d5a6e1a3e", 11 "name": "pls_5f860388d432510d5a6e1a3e", 12 "privateLinkServiceConnectionState": { 13 "actionsRequired": "None", 14 "description": "Connection deleted by service provider", 15 "status": "Disconnected" 16 }, 17 "privateLinkServiceId": "pls_5f860388d432510d5a6e1a3e.00000000-0000-0000-0000-000000000000.eastus2.privatelinkservice", 18 "provisioningState": "Succeeded", 19 "requestMessage": null, 20 "resourceGroup": "privatelink", 21 "type": "Microsoft.Network/privateEndpoints/manualPrivateLinkServiceConnections" 22 } 23 ], 24 "name": "privatelink", 25 "networkInterfaces": [ 26 { 27 "dnsSettings": null, 28 "dscpConfiguration": null, 29 "enableAcceleratedNetworking": null, 30 "enableIpForwarding": null, 31 "etag": null, 32 "hostedWorkloads": null, 33 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 34 "ipConfigurations": null, 35 "location": null, 36 "macAddress": null, 37 "name": null, 38 "networkSecurityGroup": null, 39 "primary": null, 40 "privateEndpoint": null, 41 "provisioningState": null, 42 "resourceGroup": "privatelink", 43 "resourceGuid": null, 44 "tags": null, 45 "tapConfigurations": null, 46 "type": null, 47 "virtualMachine": null 48 } 49 ], 50 "privateLinkServiceConnections": [], 51 "provisioningState": "Succeeded", 52 "resourceGroup": "privatelink", 53 "subnet": { 54 "addressPrefix": null, 55 "addressPrefixes": null, 56 "delegations": null, 57 "etag": null, 58 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 59 "ipAllocations": null, 60 "ipConfigurationProfiles": null, 61 "ipConfigurations": null, 62 "name": null, 63 "natGateway": null, 64 "networkSecurityGroup": null, 65 "privateEndpointNetworkPolicies": null, 66 "privateEndpoints": null, 67 "privateLinkServiceNetworkPolicies": null, 68 "provisioningState": null, 69 "purpose": null, 70 "resourceGroup": "privatelink", 71 "resourceNavigationLinks": null, 72 "routeTable": null, 73 "serviceAssociationLinks": null, 74 "serviceEndpointPolicies": null, 75 "serviceEndpoints": null 76 }, 77 "tags": null, 78 "type": "Microsoft.Network/privateEndpoints" 79 } この値は、azure network private-endpoint list の CLI コマンドを使用して返すこともできます。
Private IP
Azure VNet で作成したプライベートエンドポイント ネットワーク インターフェイスのプライベート IP アドレス。次のいずれかの方法でこの値を見つけます。
この値を取得するには、Azure ダッシュボードを使用します。Azure ダッシュボードのプライベートエンドポイントの [Overview] ページの [Private IP] フィールドにこのプロパティが表示されます。
この値を取得するには、Azure CLI を使用します。
次のコマンドの出力を使用します。このコマンドは、ハイライトされた
networkInterfaces.id
フィールドにネットワーク インターフェイスの ID を返します。1 azure network private-endpoint create 1 { 2 "customDnsConfigs": [], 3 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 4 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 5 "location": "eastus2", 6 "manualPrivateLinkServiceConnections": [ 7 { 8 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 9 "groupIds": null, 10 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink/manualPrivateLinkServiceConnections/pls_5f860388d432510d5a6e1a3e", 11 "name": "pls_5f860388d432510d5a6e1a3e", 12 "privateLinkServiceConnectionState": { 13 "actionsRequired": "None", 14 "description": "Connection deleted by service provider", 15 "status": "Disconnected" 16 }, 17 "privateLinkServiceId": "pls_5f860388d432510d5a6e1a3e.00000000-0000-0000-0000-000000000000.eastus2.privatelinkservice", 18 "provisioningState": "Succeeded", 19 "requestMessage": null, 20 "resourceGroup": "privatelink", 21 "type": "Microsoft.Network/privateEndpoints/manualPrivateLinkServiceConnections" 22 } 23 ], 24 "name": "privatelink", 25 "networkInterfaces": [ 26 { 27 "dnsSettings": null, 28 "dscpConfiguration": null, 29 "enableAcceleratedNetworking": null, 30 "enableIpForwarding": null, 31 "etag": null, 32 "hostedWorkloads": null, 33 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 34 "ipConfigurations": null, 35 "location": null, 36 "macAddress": null, 37 "name": null, 38 "networkSecurityGroup": null, 39 "primary": null, 40 "privateEndpoint": null, 41 "provisioningState": null, 42 "resourceGroup": "privatelink", 43 "resourceGuid": null, 44 "tags": null, 45 "tapConfigurations": null, 46 "type": null, 47 "virtualMachine": null 48 } 49 ], 50 "privateLinkServiceConnections": [], 51 "provisioningState": "Succeeded", 52 "resourceGroup": "privatelink", 53 "subnet": { 54 "addressPrefix": null, 55 "addressPrefixes": null, 56 "delegations": null, 57 "etag": null, 58 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 59 "ipAllocations": null, 60 "ipConfigurationProfiles": null, 61 "ipConfigurations": null, 62 "name": null, 63 "natGateway": null, 64 "networkSecurityGroup": null, 65 "privateEndpointNetworkPolicies": null, 66 "privateEndpoints": null, 67 "privateLinkServiceNetworkPolicies": null, 68 "provisioningState": null, 69 "purpose": null, 70 "resourceGroup": "privatelink", 71 "resourceNavigationLinks": null, 72 "routeTable": null, 73 "serviceAssociationLinks": null, 74 "serviceEndpointPolicies": null, 75 "serviceEndpoints": null 76 }, 77 "tags": null, 78 "type": "Microsoft.Network/privateEndpoints" 79 } az network nic show --id {networkInterface.id} を実行します。
networkInterfaces.id
フィールドの値を指定してAzure CLI コマンドを実行すると、プライベート エンドポイント ネットワーク インターフェイスのipConfigurations.privateIPAddress
が取得されます。 このフィールドの値が Private IPです。 入力と出力は、次のようになります。 Private Endpoint IP Address19}フィールドのハイライトされた値に注意。1 az network nic show --id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000 1 { 2 "dnsSettings": { 3 "appliedDnsServers": [], 4 "dnsServers": [], 5 "internalDnsNameLabel": null, 6 "internalDomainNameSuffix": "<>.cx.internal.cloudapp.net", 7 "internalFqdn": null 8 }, 9 "dscpConfiguration": null, 10 "enableAcceleratedNetworking": false, 11 "enableIpForwarding": false, 12 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 13 "hostedWorkloads": [], 14 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 15 "ipConfigurations": [ 16 { 17 "applicationGatewayBackendAddressPools": null, 18 "applicationSecurityGroups": null, 19 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 20 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000/ipConfigurations/privateEndpointIpConfig", 21 "loadBalancerBackendAddressPools": null, 22 "loadBalancerInboundNatRules": null, 23 "name": "privateEndpointIpConfig", 24 "primary": true, 25 "privateIpAddress": "10.0.0.4", 26 "privateIpAddressVersion": "IPv4", 27 "privateIpAllocationMethod": "Dynamic", 28 "privateLinkConnectionProperties": { 29 "fqdns": [], 30 "groupId": "", 31 "requiredMemberName": "" 32 }, 33 "provisioningState": "Succeeded", 34 "publicIpAddress": null, 35 "resourceGroup": "privatelink", 36 "subnet": { 37 "addressPrefix": null, 38 "addressPrefixes": null, 39 "delegations": null, 40 "etag": null, 41 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 42 "ipAllocations": null, 43 "ipConfigurationProfiles": null, 44 "ipConfigurations": null, 45 "name": null, 46 "natGateway": null, 47 "networkSecurityGroup": null, 48 "privateEndpointNetworkPolicies": null, 49 "privateEndpoints": null, 50 "privateLinkServiceNetworkPolicies": null, 51 "provisioningState": null, 52 "purpose": null, 53 "resourceGroup": "privatelink", 54 "resourceNavigationLinks": null, 55 "routeTable": null, 56 "serviceAssociationLinks": null, 57 "serviceEndpointPolicies": null, 58 "serviceEndpoints": null 59 }, 60 "type": "Microsoft.Network/networkInterfaces/ipConfigurations", 61 "virtualNetworkTaps": null 62 } 63 ], 64 "location": "eastus2", 65 "macAddress": "", 66 "name": "privatelink.nic.00000000-0000-0000-0000-000000000000", 67 "networkSecurityGroup": null, 68 "primary": null, 69 "privateEndpoint": { 70 "customDnsConfigs": null, 71 "etag": null, 72 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 73 "location": null, 74 "manualPrivateLinkServiceConnections": null, 75 "name": null, 76 "networkInterfaces": null, 77 "privateLinkServiceConnections": null, 78 "provisioningState": null, 79 "resourceGroup": "privatelink", 80 "subnet": null, 81 "tags": null, 82 "type": null 83 }, 84 "provisioningState": "Succeeded", 85 "resourceGroup": "privatelink", 86 "resourceGuid": "00000000-0000-0000-0000-000000000000", 87 "tags": null, 88 "tapConfigurations": [], 89 "type": "Microsoft.Network/networkInterfaces", 90 "virtualMachine": null 91 }
リソース ID とプライベート IP を使用してプライベートエンドポイントを更新します。
MongoDB Atlas CLI コマンドを実行し、MongoDB Atlas エンドポイント サービス ID、 Azureリソース ID、 Azureプライベート IP を使用して MongoDB Atlas にインターフェイスエンドポイントを作成します。この例では、次のパラメーターを設定します。
Parameterタイプ値の例endpointServiceId
Argument
6344ac8f51b94c6356527881
privateEndpointId
オプション
/subscriptions/4e133d35-e734-4385-a565-c0945567ae346/
resourceGroups/rg_95847a959b876e255dbb9b33_dfragd7w/
providers/Microsoft.Network/privateEndpoints/
test-endpoint
privateEndpointIpAddress
オプション
10.0.0.4
atlas privateEndpoints azure interfaces create <endpointServiceId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints azure interfaces create を参照してください。
レスポンスにあるプライベートエンドポイントのインターフェイスエンドポイント ID に注目してください。この例では、ID は
/subscriptions/
4e133d35-e734-4385-a565-c0945567ae346/resourceGroups/
rg_95847a959b876e255dbb9b33_dfragd7w/providers/
Microsoft.Network/privateEndpoints/cli-test
です。Interface endpoint '/subscriptions/4e133d35-e734-4385-a565-c0945567ae346/resourceGroups/rg_95847a959b876e255dbb9b33_dfragd7w/providers/Microsoft.Network/privateEndpoints/cli-test' created.
プライベートエンドポイントが利用可能かどうか確認します。
Atlas がすべてのリソースの構成を完了し、プライベートエンドポイントが使用可能になったら、Azure Private Link プライベートエンドポイントを使用してクラスターに接続できます。
次の方法で Azure プライベートエンドポイントが利用可能かどうかを確認します。
Atlas CLI コマンドを実行し、その ID と前のステップで取得したインターフェイスエンドポイント ID を使用してインターフェイスエンドポイントを記述します。この例では、次のパラメーターを設定します。
Parameterタイプ値の例privateEndpointResourceId
Argument
/subscriptions/4e133d35-e734-4385-a565-c0945567ae346/
resourceGroups/rg_95847a959b876e255dbb9b33_dfragd7w/
providers/Microsoft.Network/privateEndpoints/cli-test
endpointServiceId
オプション
6344ac8f51b94c6356527881
atlas privateEndpoints azure interfaces describe <privateEndpointResourceId> [options] コマンドの構文とパラメータの詳細については、Atlas CLI ドキュメントの atlas privateEndpoints azure interfaces describe を参照してください。
次の例に示すように、
STATUS
フィールドの値がAVAILABLE
であることを確認します。ID STATUS ERROR pls_6344ac8f51b94c6356527881 AVAILABLE
Atlas UI を通じて Azure Private Link を設定するには、次の手順に従います。
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントを設定します。
重要
接続の中断を避けるためには、正しい情報を指定する必要があります。この手順のコマンドとサブステップをスキップしないことをお勧めいたします。
Azure VNet に関する次の詳細を入力します。
Resource Group Name
Atlas への接続に使用する VNet を含むリソース グループの名前。この値は、Azureダッシュボードの [Resource Group Properties] ページで確認できます。
Virtual Network Name
Atlas への接続に使用する VNet の名前。この値は、Azureダッシュボードの [Virtual Network] ページで確認できます。
Subnet Name
Azure VNet 内のサブネットの名前。この値は、Azure ダッシュボードの [Virtual Network Subnets] ページで確認できます。
Private Endpoint Name フィールドに、プライベートエンドポイントの一意の名前を入力します。
ダイアログ ボックスに表示される
az network private-endpoint create
コマンドをコピーし、Azure CLI を使用して実行して、VNet にプライベートエンドポイントを作成します。注意
Atlas がバックグラウンドで VNet リソースの作成を完了するまで、コマンドをコピーすることはできません。
このコマンドの詳細については、Azure のドキュメントを参照してください。
プライベートエンドポイントを作成するときに、次のようなエラーが表示される場合があります。
ServiceError: code: LinkedAuthorizationFailed - , The client has permission to perform action 'Microsoft.Network/privateLinkServices/PrivateEndpointConnectionsApproval/action' on scope '/subscriptions/<subscription-id>/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink', however the current tenant '<tenant-id>' is not authorized to access linked subscription '<tenant-id>'. このエラーが発生した場合は、プライベートエンドポイントの作成に使用した Azure CLI コマンドに
--manual-request true
パラメーターを追加して、コマンドを再度実行する必要があります。[Next] をクリックします。
プライベートエンドポイント接続を終了します。
重要
接続の中断を避けるためには、正しい情報を指定する必要があります。この手順のコマンドとサブステップをスキップしないことをお勧めいたします。
プライベートエンドポイントに関する以下の詳細を入力します。
Private Endpoint Resource ID
Azure VNet で作成したプライベートエンドポイントのユニークな識別子。次のいずれかの方法でこの値を見つけます。
Azure ダッシュボードのプライベートエンドポイントの [Properties] ページの [Resource ID] フィールドにこのプロパティが表示されます。
先ほどプライベートエンドポイントを作成するために実行した以下のコマンドの出力は、id フィールドでハイライトされている値を返します。
1 azure network private-endpoint create 1 { 2 "customDnsConfigs": [], 3 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 4 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 5 "location": "eastus2", 6 "manualPrivateLinkServiceConnections": [ 7 { 8 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 9 "groupIds": null, 10 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink/manualPrivateLinkServiceConnections/pls_5f860388d432510d5a6e1a3e", 11 "name": "pls_5f860388d432510d5a6e1a3e", 12 "privateLinkServiceConnectionState": { 13 "actionsRequired": "None", 14 "description": "Connection deleted by service provider", 15 "status": "Disconnected" 16 }, 17 "privateLinkServiceId": "pls_5f860388d432510d5a6e1a3e.00000000-0000-0000-0000-000000000000.eastus2.privatelinkservice", 18 "provisioningState": "Succeeded", 19 "requestMessage": null, 20 "resourceGroup": "privatelink", 21 "type": "Microsoft.Network/privateEndpoints/manualPrivateLinkServiceConnections" 22 } 23 ], 24 "name": "privatelink", 25 "networkInterfaces": [ 26 { 27 "dnsSettings": null, 28 "dscpConfiguration": null, 29 "enableAcceleratedNetworking": null, 30 "enableIpForwarding": null, 31 "etag": null, 32 "hostedWorkloads": null, 33 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 34 "ipConfigurations": null, 35 "location": null, 36 "macAddress": null, 37 "name": null, 38 "networkSecurityGroup": null, 39 "primary": null, 40 "privateEndpoint": null, 41 "provisioningState": null, 42 "resourceGroup": "privatelink", 43 "resourceGuid": null, 44 "tags": null, 45 "tapConfigurations": null, 46 "type": null, 47 "virtualMachine": null 48 } 49 ], 50 "privateLinkServiceConnections": [], 51 "provisioningState": "Succeeded", 52 "resourceGroup": "privatelink", 53 "subnet": { 54 "addressPrefix": null, 55 "addressPrefixes": null, 56 "delegations": null, 57 "etag": null, 58 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 59 "ipAllocations": null, 60 "ipConfigurationProfiles": null, 61 "ipConfigurations": null, 62 "name": null, 63 "natGateway": null, 64 "networkSecurityGroup": null, 65 "privateEndpointNetworkPolicies": null, 66 "privateEndpoints": null, 67 "privateLinkServiceNetworkPolicies": null, 68 "provisioningState": null, 69 "purpose": null, 70 "resourceGroup": "privatelink", 71 "resourceNavigationLinks": null, 72 "routeTable": null, 73 "serviceAssociationLinks": null, 74 "serviceEndpointPolicies": null, 75 "serviceEndpoints": null 76 }, 77 "tags": null, 78 "type": "Microsoft.Network/privateEndpoints" 79 }
Private Endpoint IP Address
Azure VNet で作成したプライベートエンドポイント ネットワーク インターフェイスのプライベート IP アドレス。次のいずれかの方法でこの値を見つけます。
この値を取得するには、Azure ダッシュボードを使用します。Azure ダッシュボードのプライベートエンドポイントの [Overview] ページの [Private IP] フィールドにこのプロパティが表示されます。
この値を取得するには、Azure CLI を使用します。
先ほどプライベートエンドポイントを作成するために実行した以下のコマンドの出力は、ハイライトされている networkInterfaces.id フィールドに値を返します。
1 azure network private-endpoint create 1 { 2 "customDnsConfigs": [], 3 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 4 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 5 "location": "eastus2", 6 "manualPrivateLinkServiceConnections": [ 7 { 8 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 9 "groupIds": null, 10 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink/manualPrivateLinkServiceConnections/pls_5f860388d432510d5a6e1a3e", 11 "name": "pls_5f860388d432510d5a6e1a3e", 12 "privateLinkServiceConnectionState": { 13 "actionsRequired": "None", 14 "description": "Connection deleted by service provider", 15 "status": "Disconnected" 16 }, 17 "privateLinkServiceId": "pls_5f860388d432510d5a6e1a3e.00000000-0000-0000-0000-000000000000.eastus2.privatelinkservice", 18 "provisioningState": "Succeeded", 19 "requestMessage": null, 20 "resourceGroup": "privatelink", 21 "type": "Microsoft.Network/privateEndpoints/manualPrivateLinkServiceConnections" 22 } 23 ], 24 "name": "privatelink", 25 "networkInterfaces": [ 26 { 27 "dnsSettings": null, 28 "dscpConfiguration": null, 29 "enableAcceleratedNetworking": null, 30 "enableIpForwarding": null, 31 "etag": null, 32 "hostedWorkloads": null, 33 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 34 "ipConfigurations": null, 35 "location": null, 36 "macAddress": null, 37 "name": null, 38 "networkSecurityGroup": null, 39 "primary": null, 40 "privateEndpoint": null, 41 "provisioningState": null, 42 "resourceGroup": "privatelink", 43 "resourceGuid": null, 44 "tags": null, 45 "tapConfigurations": null, 46 "type": null, 47 "virtualMachine": null 48 } 49 ], 50 "privateLinkServiceConnections": [], 51 "provisioningState": "Succeeded", 52 "resourceGroup": "privatelink", 53 "subnet": { 54 "addressPrefix": null, 55 "addressPrefixes": null, 56 "delegations": null, 57 "etag": null, 58 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 59 "ipAllocations": null, 60 "ipConfigurationProfiles": null, 61 "ipConfigurations": null, 62 "name": null, 63 "natGateway": null, 64 "networkSecurityGroup": null, 65 "privateEndpointNetworkPolicies": null, 66 "privateEndpoints": null, 67 "privateLinkServiceNetworkPolicies": null, 68 "provisioningState": null, 69 "purpose": null, 70 "resourceGroup": "privatelink", 71 "resourceNavigationLinks": null, 72 "routeTable": null, 73 "serviceAssociationLinks": null, 74 "serviceEndpointPolicies": null, 75 "serviceEndpoints": null 76 }, 77 "tags": null, 78 "type": "Microsoft.Network/privateEndpoints" 79 } az network nic show --id {networkInterface.id} を実行します。Azure CLI コマンドに networkInterfaces.id フィールドの値を指定して、プライベート エンドポイント ネットワーク インターフェイスの ipConfigurations.privateIPAddress を取得します。このフィールドの値が Private Endpoint IP Addressです。入力と出力は、次のようになります。Private Endpoint IP Address フィールドの強調表示された値に注意します。
1 az network nic show --id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000 1 { 2 "dnsSettings": { 3 "appliedDnsServers": [], 4 "dnsServers": [], 5 "internalDnsNameLabel": null, 6 "internalDomainNameSuffix": "<>.cx.internal.cloudapp.net", 7 "internalFqdn": null 8 }, 9 "dscpConfiguration": null, 10 "enableAcceleratedNetworking": false, 11 "enableIpForwarding": false, 12 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 13 "hostedWorkloads": [], 14 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000", 15 "ipConfigurations": [ 16 { 17 "applicationGatewayBackendAddressPools": null, 18 "applicationSecurityGroups": null, 19 "etag": "W/\"00000000-0000-0000-0000-000000000000\"", 20 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/networkInterfaces/privatelink.nic.00000000-0000-0000-0000-000000000000/ipConfigurations/privateEndpointIpConfig", 21 "loadBalancerBackendAddressPools": null, 22 "loadBalancerInboundNatRules": null, 23 "name": "privateEndpointIpConfig", 24 "primary": true, 25 "privateIpAddress": "10.0.0.4", 26 "privateIpAddressVersion": "IPv4", 27 "privateIpAllocationMethod": "Dynamic", 28 "privateLinkConnectionProperties": { 29 "fqdns": [], 30 "groupId": "", 31 "requiredMemberName": "" 32 }, 33 "provisioningState": "Succeeded", 34 "publicIpAddress": null, 35 "resourceGroup": "privatelink", 36 "subnet": { 37 "addressPrefix": null, 38 "addressPrefixes": null, 39 "delegations": null, 40 "etag": null, 41 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/virtualNetworks/privatelink/subnets/privatelink", 42 "ipAllocations": null, 43 "ipConfigurationProfiles": null, 44 "ipConfigurations": null, 45 "name": null, 46 "natGateway": null, 47 "networkSecurityGroup": null, 48 "privateEndpointNetworkPolicies": null, 49 "privateEndpoints": null, 50 "privateLinkServiceNetworkPolicies": null, 51 "provisioningState": null, 52 "purpose": null, 53 "resourceGroup": "privatelink", 54 "resourceNavigationLinks": null, 55 "routeTable": null, 56 "serviceAssociationLinks": null, 57 "serviceEndpointPolicies": null, 58 "serviceEndpoints": null 59 }, 60 "type": "Microsoft.Network/networkInterfaces/ipConfigurations", 61 "virtualNetworkTaps": null 62 } 63 ], 64 "location": "eastus2", 65 "macAddress": "", 66 "name": "privatelink.nic.00000000-0000-0000-0000-000000000000", 67 "networkSecurityGroup": null, 68 "primary": null, 69 "privateEndpoint": { 70 "customDnsConfigs": null, 71 "etag": null, 72 "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/privatelink/providers/Microsoft.Network/privateEndpoints/privatelink", 73 "location": null, 74 "manualPrivateLinkServiceConnections": null, 75 "name": null, 76 "networkInterfaces": null, 77 "privateLinkServiceConnections": null, 78 "provisioningState": null, 79 "resourceGroup": "privatelink", 80 "subnet": null, 81 "tags": null, 82 "type": null 83 }, 84 "provisioningState": "Succeeded", 85 "resourceGroup": "privatelink", 86 "resourceGuid": "00000000-0000-0000-0000-000000000000", 87 "tags": null, 88 "tapConfigurations": [], 89 "type": "Microsoft.Network/networkInterfaces", 90 "virtualMachine": null 91 }
エンドポイントの説明(任意)を入力します。
[Create] をクリックします。
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントが利用可能であることを確認します。
すべてのリソースの構成を完了し、プライベートエンドポイントが使用可能になったら、Azure Private Link プライベートエンドポイントを使用して Atlas クラスターに接続できます。
Azure Private Link プライベート エンドポイントが利用可能かどうかを確認するには、次の手順を実行します。
Private Endpoint タブで、クラスター タイプを選択し、Azure Private Link を使用して接続するクラスターが含まれるリージョンの、次のステータスを確認します。
Atlas Endpoint Service Status | 利用可能 |
Endpoint Status | 利用可能 |
ステータス値の詳細については、 「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。
このようなステータスが表示されない場合は、追加情報については「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。
Atlas CLI を使用して Google Cloud で GCP Private Service Connect を設定するには、 Atlas CLI をインストールし、Atlas CLI から接続します。その後、次の手順を実行します。
Atlas でプライベートエンドポイントを作成します。
Atlas CLI コマンドを実行して、Atlas にプライベートエンドポイントを作成します。
--region
の値が、クラスターを配置したリージョンと一致していることを確認します。atlas privateEndpoints gcp create [options] コマンドのシンタックスとパラメーターの詳細については、atlas privateEndpoints gcp create の MongoDB Atlas CLI ドキュメントを参照してください。
マルチリージョンまたはマルチクラウド クラスターを使用していて、リージョン化されたプライベートエンドポイントを有効にしていない場合は、プロバイダーとリージョンごとにエンドポイントをプロビジョニングする必要があります。
応答内のプライベートエンドポイントの ID をメモします。この例では、ID は
6344ac8f51b94c6356527881
です。Private endpoint '6344ac8f51b94c6356527881' created.
プライベートエンドポイントが使用可能になるまで待ちます。
注意
Atlas がプライベートエンドポイントをプロビジョニングするには、しばらく時間がかかる場合があります。この手順を完了する前に、1 分から 2 分待ちます。
Atlas CLI コマンドを実行し、ID を使用してプライベートエンドポイントを記述します。
atlas privateEndpoints gcp describe <privateEndpointId> [options]
コマンド構文とパラメーターの詳細については、atlas privateEndpoints gcp describe の Atlas CLI ドキュメントを参照してください。
次に、出力の例を示します。
ID GROUP NAME REGION STATUS ERROR 6344ac8f51b94c6356527881 N/A CENTRAL_US AVAILABLE
STATUS
の値が INITIATING
である場合は、Atlas がプライベートエンドポイントをプロビジョニングするまでさらに 1 ~ 2 分待ちます。それから、このステップをもう一度試してください。
GCP でエンドポイントを作成します。
setup_psc.sh
という名前の shell スクリプト ファイルを作成します。次のコードをコピーして、
setup_psc.sh
ファイルに貼り付け、次のプレースホルダーを自分の値に置き換えます。プレースホルダー説明{GCP-PROJECT-ID}
Google Cloud 内の Google Cloud プロジェクトを識別するユニークな文字列。
{ATLAS-GCP-PROJECT-ID}
Atlas がリソースをデプロイする Google Cloud プロジェクトを識別するユニークな文字列。
{ENDPOINT}
プライベートエンドポイントを識別するユニークな文字列。これは、作成するすべての転送ルールのプレフィックスです。
{REGION}
クラスターが存在する Google Cloud リージョン。
{SUBNET}
Private Service Connect エンドポイントを作成するときは、VPC ネットワーク内のサブネットを指定します。エンドポイントをカプセル化するために新しいサブネットを作成するか、既存のサブネットを使用できます。このサブネットには、少なくとも 50 個の未割り当て IP アドレスが必要です。
{VPC-NAME}
Atlas への接続に使用する VNet の名前。この値は、Google Cloud ダッシュボードの VPC ネットワーク ページで確認できます。
{GROUP-ID}
Atlasでプロジェクトを識別するユニークな 24 文字の文字列。
!/bin/bash gcloud config set project {GCP-PROJECT-ID} for i in {0..49} do gcloud compute addresses create {ENDPOINT}-ip-$i --region={REGION} --subnet={SUBNET} done for i in {0..49} do if [ $(gcloud compute addresses describe {ENDPOINT}-ip-$i --region={REGION} --format="value(status)") != "RESERVED" ]; then echo "{ENDPOINT}-ip-$i is not RESERVED"; exit 1; fi done for i in {0..49} do gcloud compute forwarding-rules create {ENDPOINT}-$i --region={REGION} --network={VPC-NAME} --address={ENDPOINT}-ip-$i --target-service-attachment=projects/{ATLAS-GCP-PROJECT-ID}/regions/{REGION}/serviceAttachments/sa-{REGION}-{GROUP-ID}-$i done shell ファイルの実行
sh setup_psc.sh Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/addresses/-ip-0]., Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/addresses/-ip-1]., ... Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/addresses/-ip-49]., Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/forwardingRules/-ip-0]., Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/forwardingRules/-ip-1]., ... Created [https://www.googleapis.com/compute/v1/projects/<PROJECT-ID>/regions/<REGION>/forwardingRules/-ip-49]. 次のコマンドを実行して Google Cloud の転送先アドレスのリストを生成し、
atlasEndpoints.txt
というファイルに保存し、前のステップのプレースホルダーを置き換えます。プレースホルダー説明{REGION}
クラスターが存在する Google Cloud リージョン。
{ENDPOINT}
プライベートエンドポイントを識別するユニークな文字列。これは、作成するすべての転送ルールのプレフィックスです。
gcloud compute forwarding-rules list --regions={REGION} --format="csv(name,IPAddress)" --filter="name:({ENDPOINT}*)" > atlasEndpoints.txt
atlasEndpoints.txt
ファイルの形式を更新します。
atlasEndpoints.txt
の内容を再フォーマットするには、次のコマンドを実行します。
sed -i '' '1d' atlasEndpoints.txt tr -s ',' '@' <atlasEndpoints.txt>atlasEndpoints2.txt tr -s '\n' ',' <atlasEndpoints2.txt>atlasEndpoints.txt sed -i '' '$ s/.$//' atlasEndpoints.txt rm atlasEndpoints2.txt
注意
次のステップでは、 atlasEndpoints.txt
の内容を endpoint
パラメーターの値として使用します。
VPC エンドポイント ID を使用してプライベートエンドポイントを更新します。
Atlas CLI コマンドを実行し、Atlas エンドポイント ID と VPC エンドポイント ID を使用して Atlas にインターフェイスエンドポイントを作成します。この例では、次のパラメーターを設定します。
Parameterタイプ値の例endpointGroupId
Argument
tester-1
endpointServiceId
オプション
6344ac8f51b94c6356527881
gcpProjectId
オプション
atlascli-private-endpoints
endpoint
オプション
tester-1@10.142.0.1,tester-2@10.142.0.2, ... , tester-49@10.142.0.49, tester-50@10.142.0.50
...
は、その間にある他の 46 個のエンドポイントを表します。Atlas CLI を使用して Google Cloud プライベートエンドポイントの新しいインターフェースを追加するには、次のコマンドを実行します。
atlas privateEndpoints gcp interfaces create <endpointGroupId> [options] コマンド構文とパラメータの詳細については、atlas privateEndpoints gcp interface create の Atlas CLI ドキュメントを参照してください。
プライベートエンドポイントが利用可能かどうか確認します。
Atlas がすべてのリソースの構成を完了し、プライベートエンドポイントが使用可能になったら、GCP Private Service Connect プライベートエンドポイントを使用してクラスターに接続できます。
次の方法で Google Cloud プライベートエンドポイントが利用可能かどうかを確認します。
Atlas CLI コマンドを実行して、ID を使用してインターフェースエンドポイントを記述します。この例では、前の手順の次のパラメーターを使用します。
Parameterタイプ値の例id
Argument
tester-1
endpointServiceId
オプション
6344ac8f51b94c6356527881
指定したGoogle Cloud Platformプライベートエンドポイントのインターフェースを返します。 Atlas CLI を使用して、次のコマンドを実行します。
atlas privateEndpoints gcp interfaces describe <id> [options] コマンド構文とパラメータの詳細については、 Atlas CLIドキュメントのAtlas privateEndpoints GCP interfaces describe を参照してください。
次の例に示すように、
STATUS
フィールドの値がAVAILABLE
であることを確認します。ENDPOINT STATUS DELETE REQUESTED tester-1 AVAILABLE false STATUS
値がVERIFIED
の場合は、Atlas がプライベートエンドポイントを使用できるようになるまで、さらに 1~2 分かかります。
次の方法で、Atlas UI を使用して Google Cloud で GCP Private Service Connect を設定します。
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントを設定します。
重要
接続の中断を避けるためには、正しい情報を指定する必要があります。この手順のコマンドとサブステップをスキップしないことをお勧めいたします。
Google Cloud VPC に関する次の詳細を入力します。
Google Cloud Project ID
プロジェクトのユニークな ID。この値は、Google Cloud プラットフォームの [Dashboard] ページで確認できます。
VPC Name
Atlas に接続するために使用する VPC の名前。この値は、Google Cloud ダッシュボードの [VPC Networks] ページで確認できます。
Subnet Name
Google Cloud VPC 内のサブネットの名前。この値は、Google Cloud ダッシュボードの [VPC Networks] ページで確認できます。
Private Service Connect Endpoint Prefixフィールドにプライベートエンドポイントのユニークな名前を入力します。これは、作成されたすべてのエンドポイントのプレフィックスとエンドポイントグループの名前になります。 Nextをクリックします。
shell スクリプトをダウンロードし、CLI を使用して実行して、Google Cloud Platform VPCに転送ルールを作成します。これにより、次のステップで必要となる IP アドレスとエンドポイント名のリストを含む JSON ファイルが出力されます。[Next] をクリックします。
[Upload JSON File] をクリックして、出力された JSON ファイルを選択してアップロードします。
[Create Private Endpoint] をクリックします。
AtlasGoNetwork AccessAtlas で、プロジェクトの ページにGoします。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のNetwork Accessをクリックします。
[ネットワーク アクセス]ページが表示されます。
プライベートエンドポイントが利用可能であることを確認します。
GCP Private Service Connect プライベートエンドポイントを使用して Atlas クラスタに接続できるのは、すべてのリソースが設定され、プライベートエンドポイントが使用可能になったときです。
次の方法で GCP Private Service Connect プライベートエンドポイントが利用可能かどうかを確認します。
[Private Endpoint] タブで、GCP Private Service Connect を使用して接続するクラスターを含むリージョンの次のステータスを確認します。
Atlas Endpoint Service Status | 利用可能 |
Endpoint Status | 利用可能 |
ステータス値の詳細については、 「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。
このようなステータスが表示されない場合は、追加情報については「 プライベートエンドポイント接続の問題のトラブルシューティング 」を参照してください。