GCP Private Service Connect traffic filtersedit

Traffic filtering, to allow only Private Service Connect connections, is one of the security layers available in Elasticsearch Service. It allows you to limit how your deployments can be accessed.

Read more about Traffic Filtering for the general concepts behind traffic filtering in Elasticsearch Service.

Private Service Connect filtering is supported only for Google Cloud regions.

Private Service Connect establishes a secure connection between two Google Cloud VPCs. The VPCs can belong to separate accounts, for example a service provider and their service consumers. Google Cloud routes the Private Service Connect traffic within the Google Cloud data centers and never exposes it to the public internet. In such a configuration, Elastic Cloud is the third-party service provider and the customers are service consumers.

Private Link is a connection between a Private Service Connect Endpoint and a Service Attachment. Learn more about using Private Service Connect on Google Cloud.

Private Service Connect connections are regional, your Private Service Connect Endpoint needs to live in the same region as your deployment. The Endpoint can be accessed from any region once you enable its Global Access feature.

Private Service Connect URIsedit

Service Attachments are set up by Elastic in all supported GCP regions under the following URIs:

GCP Public Regions
Region Service Attachment URI Private zone DNS name





























































The process of setting up the Private link connection to your clusters is split between Google Cloud (e.g. by using Google Cloud console), and Elastic Cloud UI. These are the high-level steps:

Google Cloud console Elastic Cloud UI

1. Create a Private Service Connect endpoint using Elastic Cloud Service Attachment URI.

2. Create a DNS record pointing to the Private Service Connect endpoint.

3. Create a Private Service Connect rule set with the PSC Connection ID.

4. Associate the Private Service Connect rule set with your deployments.

5. Interact with your deployments over Private Service Connect.

Create your Private Service Connect endpoint and DNS entries in Google Cloudedit

  1. Create a Private Service Connect endpoint in your VPC using the Service Attachment URI for your region.

    Follow the Google Cloud instructions for details on creating a Private Service Connect endpoint to access Private Service Connect services.

    Use the Service Attachment URI for your region. Select the Published service option and enter the selected Service Attachment URI as the Target service. For example for the region asia-southeast1 the Service Attachment URI is projects/cloud-production-168820/regions/asia-southeast1/serviceAttachments/proxy-psc-production-asia-southeast1-v1-attachment

    you need to reserve a static internal IP address in your VPC. The address is used by Private Service Connect endpoint.

    Note down the PSC Connection ID, e.g. 18446744072646845332.

  2. Create a DNS record.

    1. Create a DNS Zone of type Private. Set the DNS name to Private zone DNS name for your region. For example, in asia-southeast1 use psc.asia-southeast1.gcp.elastic-cloud.com as the zone domain name. Make sure the zone is associated with your VPC.
    2. Then create a DNS record set with an A record pointing to the Private Service Connect endpoint IP. Use * as the DNS name, A as the Resource Record Type, and put the Private Service Connect endpoint IP address as the record value.

      Follow the Google Cloud instructions for details on creating an A record which points to your Private Service Connect endpoint IP address.

  3. Test the connection.

    Find out the Elasticsearch cluster ID of your deployment. You can do that by selecting Copy cluster id in the Cloud UI. It looks something like 9c794b7c08fa494b9990fa3f6f74c2f8.

    The Elasticsearch cluster ID is different from the deployment ID, custom alias endpoint, and Cloud ID values that feature prominently in the user console.

    To access your Elasticsearch cluster over Private Link:,

    • If you have a custom endpoint alias configured, you can use the custom endpoint URL to connect.


      For example:


    • Alternatively, use the following URL structure:


      For example:


    You can test the Google Cloud console part of the setup with the following command (substitute the region and Elasticsearch ID with your cluster):

    $ curl -v https://6b111580caaa4a9e84b18ec7c600155e.psc.asia-southeast1.gcp.elastic-cloud.com:9243
    *   Trying
    < HTTP/2 403

    Check the IP address it should be the same as the IP address assigned to your Private Service Connect endpoint.

    The connection is established, and a valid certificate is presented to the client. The 403 Forbidden is expected, you haven’t associated any deployment with the Private Service Connect endpoint yet.

Add the Private Service Connect rules to your deploymentsedit

Follow these high-level steps to add private link rules to your deployments.

Find your Private Service Connect connection IDedit

  1. Go to your Private Service Connect endpoint in the Google Cloud console.
  2. Copy the value of PSC Connection ID.

Create rules using the Private Service Connect endpoint connection IDedit

When you have your Private Service Connect endpoint connection ID, you can create a traffic filter rule set.

  1. From the Account menu, select Traffic filters.
  2. Select Create filter.
  3. Select Private Service Connect endpoint.
  4. Create your rule set, providing a meaningful name and description.
  5. Select the region for the rule set.
  6. Enter your PSC Connection ID.
  7. Select if this rule set should be automatically attached to new deployments.

    Each rule set is bound to a particular region and can be only assigned to deployments in the same region.

  8. (Optional) You can claim your PSC Connection ID, so that no other organization is able to use it in a traffic filter ruleset.

The next step is to associate the rule set with your deployments.

Associate the Private Service Connect endpoint with your deploymentedit

To associate a private link rule set with your deployment:

  1. Go to the deployment.
  2. On the Security page, under Traffic filters select Apply filter.
  3. Choose the filter you want to apply and select Apply filter.

Access the deployment over the Private Service Connectedit

For traffic to connect with the deployment over Private Service Connect, the client making the request needs to be located within the VPC where you’ve created the Private Service Connect endpoint. You can also setup network traffic to flow through the originating VPC from somewhere else, such as another VPC or a VPN from your corporate network. This assumes that the Private Service Connect endpoint and the DNS record are also available within that context. Check your cloud service provider documentation for setup instructions.

Use the alias you’ve set up as CNAME A record to access your deployment.

For example, if your Elasticsearch ID is 6b111580caaa4a9e84b18ec7c600155e and it is located in asia-southeast1 region you can access it under https://6b111580caaa4a9e84b18ec7c600155e.psc.asia-southeast1.gcp.elastic-cloud.com:9243.

$ curl -u 'username:password' -v https://6b111580caaa4a9e84b18ec7c600155e.psc.asia-southeast1.gcp.elastic-cloud.com:9243
< HTTP/1.1 200 OK

If you are using Private Service Connect together with Fleet, and enrolling the Elastic Agent with a Private Service Connect URL, you need to configure Fleet Server to use and propagate the Private Service Connect URL by updating the Fleet Server hosts field in the Fleet settings section of Kibana. Otherwise, Elastic Agent will reset to use a default address instead of the Private Service Connect URL. The URL needs to follow this pattern: https://<Fleet component ID/deployment alias>.fleet.<private zone DNS name>:443.

Similarly, the Elasticsearch host needs to be updated to propagate the Private Service Connect URL. The Elasticsearch URL needs to follow this pattern: https://<Elasticsearch cluster ID/deployment alias>.es.<private zone DNS name>:443.

The settings xpack.fleet.agents.fleet_server.hosts and xpack.fleet.outputs that are needed to enable this configuration in Kibana are currently available on-prem only, and not in the Kibana settings in Elastic Cloud.

Edit a Private Service Connect rule setedit

You can edit a rule set name or to change the PSC connection ID.

  1. From the Account menu, select Traffic filters.
  2. Find the rule set you want to edit.
  3. Select the Edit icon.

Delete a Private Service Connect rule setedit

If you need to remove a rule set, you must first remove any associations with deployments.

To delete a rule set with all its rules:

  1. Remove any deployment associations.
  2. From the Account menu, select Traffic filters.
  3. Find the rule set you want to edit.
  4. Select the Remove icon. The icon is inactive if there are deployments assigned to the rule set.

Remove a Private Service Connect rule set association from your deploymentedit

To remove an association through the UI:

  1. Go to the deployment.
  2. On the Security page, under Traffic filters select Remove.