プライベート接続エンドポイントの管理: Google Cloud
このトピックでは、外部サービスへのプライベート接続で使用するプライベート接続エンドポイントの管理方法について説明します。この例は Google Cloud に固有のものです。
プライベート接続エンドポイントのプロビジョニング
SYSTEM$PROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出すことで、プライベート接続エンドポイントを作成できます。例えば、 Google Cloud のSnowflakeアカウントの場合:
公開されているサービスに接続します。
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT (
'projects/my-project/regions/us-west2/serviceAttachments/my-http-server' ,
'my-http-server.com'
);
エンドポイントを作成した後、リソースプロバイダーによって Google Cloud で接続が承認される必要があります。
Google Cloud 上のSnowflakeが Google Cloud VPC ネットワーク内のサービスアタッチメントに接続できるようにプライベートエンドポイントをプロビジョニングします。
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT (
'projects/my-project/regions/us-east4/serviceAttachments/my-service-attachment' ,
'my-service.com'
);
Private endpoint with ID "abcd0000000000000001" to resource "projects/my-project/regions/us-east4/serviceAttachments/my-service-attachment"
was provisioned successfully. Please note the Private Endpoint ID and approve the corresponding connection request in the cloud provider console.
Google Cloud 上のSnowflakeがリージョンのクラウドキー管理サービス(クラウド KMS)エンドポイントに接続できるようにプライベートエンドポイントをプロビジョニングします。
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT (
'cloudkms.us-east4.rep.googleapis.com' ,
'cloudkms.us-east4.rep.googleapis.com'
);
Private endpoint with ID "abcd0000000000000001" to resource "cloudkms.us-east4.rep.googleapis.com" was provisioned successfully.
Please note the Private Endpoint ID and approve the corresponding connection request in the cloud provider console.
プライベートエンドポイントをプロビジョニングして、Snowflakeが Google Cloud 用の外部ステージに接続できるようにします。
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT (
'storage.us-east4.rep.googleapis.com' ,
'storage.us-east4.rep.googleapis.com'
);
Private endpoint with ID "abcd0000000000000001" to resource "storage.us-east4.rep.googleapis.com" was provisioned successfully.
Please note the Private Endpoint ID and approve the corresponding connection request in the cloud provider console.
Snowflakeは、Snowflakeアカウントをホストするクラウドプラットフォームの APIs を呼び出してエンドポイントを作成します。Snowflakeは、関連するネットワーク設定も更新します。
Google API`リージョンサービスエンドポイント<https://cloud.google.com/vpc/docs/regional-service-endpoints >`_ にプライベート接続エンドポイントをプロビジョニングできます。これらのGoogle管理エンドポイントへの接続は自動的に承認されます。
プライベート接続エンドポイントのホスト名を変更する
ネットワークリソースを変更することなく、以前にプロビジョニングしたプライベート接続エンドポイントのホスト名のみを変更できます。エンドポイントのホスト名を変更すると、このエンドポイントが別のホスト名を使用して同じサービスに接続するよう、Snowflakeに指示します。ホスト名を変更するには、 SYSTEM$SET_PRIVATELINK_ENDPOINT_HOSTNAME システム関数を呼び出します。
プライベート接続エンドポイントのリスト
SYSTEM$GET_PRIVATELINK_ENDPOINTS_INFO システム関数を呼び出すことで、作成したプライベート接続エンドポイントを一覧表示できます。例えば、 Google Cloud のSnowflakeアカウントの場合:
SQL Returned value
SELECT SYSTEM$GET_PRIVATELINK_ENDPOINTS_INFO ();
[
{
"provider_resource_id" : "projects/my-project/regions/us-east4/serviceAttachments/..." ,
"snowflake_resource_id" : "abcd0000000000000001" ,
"host" : "my-service.com" ,
"endpoint_state" : "CREATED" ,
"status" : "ACCEPTED" ,
}
]
プライベート接続エンドポイントのデプロビジョニング
既存のプライベート接続エンドポイントを削除するには、 SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT システム関数を呼び出します。例えば、 Google Cloud のSnowflakeアカウントの場合:
Google Cloud 上のSnowflakeが Google Cloud VPC ネットワーク内のサービスアタッチメントに接続できないように、プライベートエンドポイントをプロビジョニング解除します。
SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT (
'projects/my-project/regions/us-east4/serviceAttachments/my-service-attachment'
);
Private endpoint with id "abcd0000000000000001" successfully marked for deletion. Before it is fully deleted in 7-8 days, it can be restored.
Google Cloud 上のSnowflakeがリージョンのGoogleサービスエンドポイント(CloudKMS)に接続できないように、プライベートエンドポイントをプロビジョニング解除します。
SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT (
'cloudkms.us-east4.rep.googleapis.com'
);
Private endpoint with id "abcd0000000000000001" successfully marked for deletion. Before it is fully deleted in 7-8 days, it can be restored.
プライベートエンドポイントをデプロビジョニングして、Snowflakeが Google Cloud の外部ステージに接続できないようにします。
SELECT SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT (
'storage.us-east4.rep.googleapis.com'
);
Private endpoint with id "abcd0000000000000001" successfully marked for deletion. Before it is fully deleted in 7-8 days, it can be restored.
デプロビジョニングされたプライベート接続エンドポイントの復元
SYSTEM$RESTORE_PRIVATELINK_ENDPOINT システム関数を呼び出すことで、デプロビジョニングしてから7日以内にデプロビジョニングしたプライベート接続エンドポイントを復元できます。7日を過ぎるとエンドポイントは復元できなくなるので、新しいエンドポイントをプロビジョニングする必要があります。
プライベートエンドポイントを復元して、 Google Cloud 上のSnowflakeが Google Cloud VPC ネットワーク内のGoogle API 管理サービスに接続できるようにします。
SELECT SYSTEM$RESTORE_PRIVATELINK_ENDPOINT (
'projects/my-project/regions/us-east4/serviceAttachments/my-service-attachment'
);
Private endpoint with id ''abcd0000000000000001'' restored successfully.
使用上の注意
プライベートエンドポイントのプロビジョニングに使用されるSnowflakeアカウントは、同じリージョンのサービスにのみ接続できます。たとえば、 us-central1 のSnowflakeアカウントは、サービスアタッチメントと、同じく us-central1 にあるGoogleのリージョンエンドポイントへのプライベートエンドポイントのみをプロビジョニングできます。
制限事項
リージョン間の接続はサポートされていません。