IBM Cloud:如何从凭证或服务绑定中检索有关私有端点的信息?

问题描述

我为VRF和专用服务端点启用了我的帐户。创建服务凭证时,通常我只会看到公共端点的URI。我的绑定应用程序如何使用凭据来获取已启用的专用端点的URI?

以下是启用了专用端点的Watson Assistant实例的凭据。它只有公共URI。

{
  "apikey": "myApikeyvalueWouldBeHere","iam_apikey_description": "Auto-generated for key 9197a2b1-xxxx-xxxx-xxxx-7a99966e0056","iam_apikey_name": "Service credentials test","iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Manager","iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/1234567890abcdefghijklmnopqrstuvwxyz::serviceid:ServiceId-a2072c22-xxxx-xxxx-xxxx-xxx3a714f525","url": "https://api.eu-de.assistant.watson.cloud.ibm.com/instances/932d30c1-xxxx-xxxx"
}

解决方法

您的专用网络终结点应显示在服务实例的“管理”选项卡中。

在服务详细信息页面中,单击管理标签,然后单击专用网络端点

请参见Public and private network endpointsProtecting sensitive information [在助手中]。

,

可以通过UI,CLI,terraform等为专用端点生成凭据。

对于CLI,添加值为{strong> private 的--service-endpoint参数:

ibmcloud resource service-key-create myCreds Manager 
 --instance-name myWatsonAssistant_PLUS --service-endpoint private

以上内容也适用于ibmcloud resource service-binding-create

使用IBM Cloud控制台(UI)和“添加凭证”对话框时,转到高级选项,然后添加内联配置选项。在此添加以下值:

{"service-endpoints":"private"}

这将导致生成专用端点的凭据。您可以在其他接口(例如API)或terraform中传递相同的键/值。

生成的凭据将附加密钥 private_endpoint 设置为 true