Node.js用VMware Tanzu NetworkのContrast service brokerの追加

Contrast service brokerを使用して、VMware Tanzu Networkで容易にサービスをアプリケーションにバインドして、Contrast Node.jsエージェントを使用できます。

VMware Tanzu Networkを設定するには、サポートに問い合わせてください。Service Brokerのソースコードを入手したら、以下を実行します。

  1. Service Brokerアプリケーションをデプロイします。

    cf push contrast-security-service-broker
  2. VMware Tanzu NetworkにService Brokerが表示されるようになります。Service Brokerでは、デフォルトではプランが提供されません。CONTRAST_SERVICE_PLANS環境変数を使用して、プランを設定します。Pivotal Ops Managerを使用して環境変数を設定することもできます。Bluemixを使用している場合は、アプリケーションを選択して、Runtimeを選択してからEnvironment Variablesを選択して値を設定します。

  3. コマンドラインで値を設定する方法の例を以下に示します。

    cf set-env contrast-security-service-broker CONTRAST_SERVICE_PLANS
        " {
                "ServicePlan1": {
                     "name":"ServicePlan1",
                     "teamserver_url":"https://yourteamserverurl.com",
                     "username":"your_username",
                     "org_uuid":"00000000-1111-2222-3333-000000000000",
                     "api_key":"your_api_key",
                     "service_key":"your_service_key"
                 },
                 "AnotherServicePlan":{
                     "name":"AnotherServicePlan",
                     "teamserver_url":"https://yourteamserverurl.com",
                     "username":"your_username",
                     "org_uuid":"00000000-1111-2222-3333-000000000001",
                     "api_key":"your_api_key",
                     "service_key":"some_other_service_key"
                     }
                 } "

    注記

    IBM Cloudでエージェントを実行する場合は、一重引用符を使用してCONTRAST_SERVICE_PLANS環境変数を設定する必要があります。例:

        cf set-env contrast-security-service-broker CONTRAST_SERVICE_PLANS
        " {
                'ServicePlan1': {
                     'name':'ServicePlan1',
                     'teamserver_url':'https://yourteamserverurl.com',
                     'username':'your_username',
                     'org_uuid':'00000000-1111-2222-3333-000000000000',
                     'api_key':'your_api_key',
                     'service_key':'your_service_key'
                 },
                 'AnotherServicePlan':{
                     'name':'AnotherServicePlan',
                     'teamserver_url':'https://yourteamserverurl.com',
                     'username':'your_username',
                     'org_uuid':'00000000-1111-2222-3333-000000000000',
                     'api_key':'your_api_key',
                     'service_key':'some_other_service_key'
                     }
                 } "
  4. 環境変数を変更したら、アプリケーションをリステージします。

    cf restage contrast-security-service-broker
  5. アプリケーションでは、ユーザ名とパスワードの環境変数も要求されます。

    cf set-env contrast-security-service-broker SECURITY_USER_NAME aSecureUsername
    cf set-env contrast-security-service-broker SECURITY_USER_PASSWORD aSecurePassword
  6. Service Brokerインスタンスを作成します。少なくとも1つのサービスプランを定義します。上記と同じユーザ名とパスワードを使用する必要があります。

    cf create-service-broker contrast-security-service-broker USER_NAME PASSWORD
    <URL of your application>

    注記

    IBM Cloudで、コマンドの最後に--space-scopedを追加します。例:

    cf create-service-broker contrast-security-service-broker USER_NAME PASSWORD
    <URL of your application> --space-scoped
  7. 全てのService Brokerは、最初は非公開となっています。以下のコマンドを使用して公開します。

    cf enable-service-access contrast-security-service-broker
  8. Service Brokerが機能するようになったら、サービスインスタンスを作成してアプリケーションにバインドします。サービスインスタンスを作成するには、以下のコマンドを実行します。

    cf create-service contrast-security-service-broker ServicePlan1 <name_of_service>
  9. アプリケーションにバインドするには、以下のコマンドを実行します。

    cf bind-service <app_name> <name_of_service>
  10. アプリケーションとともにエージェントが起動します。また、Contrastにアプリケーションが表示されます。