# Using 1search on AWS Cloud

# Overview

The connection between your AWS VPC and 1search is done via VPC Endpoint Service. It is secure, fast and easy to setup and use in AWS context. The private link is secured by the AWS internal network without the need for any routing, peering or NAT devices. To setup the connection please perform the following steps.

For more information about AWS PrivateLink(including AWS VPC Endpoint and Endpoint Service): https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html

image

# Steps

# 1. Get AWS VPC Endpoint Service Name

Each 1search service you created will be provisioned with a dedicated VPC Endpoint Service. Thereby on your end you need the VPC Endpoint Service name to create the corresponding VPC Endpoint to establish the connection.

  1. Go to 1search client portal and login

  2. Select your service from the top right service dropdown list

  3. Switch to Infra tab at left side

  4. Note down the text field Endpoint Service Name

# 2. Provide AWS ARNs of users who are allowed to create VPC Endpoint

Next we need to grant the permission to create VPC Endpoints from Endpoint Service to AWS principals whom you permit.


Note

Make sure you finish this step before entering the next, otherwise you will get the error Service name not found. in the next step.


  1. At the same page as the previous step, click the Edit button

  2. In the Principals text field, input the AWS arns of those you allow to create VPC endpoints. You can specify multiple arns separated by a newline

    Examples:

    • arn:aws:iam::123456789:root Allow all principals in aws account 123456789
    • arn:aws:iam::123456789:user/batman Allow only user batman in account 123456789
    • arn:aws:iam::123456789:role/jenkins Allow only role jenkins in account 123456789
  3. Click the Update button to save changes

# 3. Create VPC Endpoint in your AWS VPC


Note

Make sure you've finished previous step before starting this step. Allowed list change may need a minute to take effect.


  1. Login to your AWS console and go to the VPC panel

  2. Go to the Endpoints panel from left side bar

  3. Click Create Endpoint

  4. Select Find service by name from Service category list

  5. Input the previously noted Endpoint Service Name and click Verify

    If you skipped the last step you will get a Service name not found. error message.

    If you just finished last step please allow 5 minutes to let your change take effects

  6. Select the VPC you are trying to connect to 1search from from the VPC list

  7. Select the Availability Zone and choose private subnet ID for each. You can only select one subnet for each Availability Zone

  8. Select or create a security group from Security group. Make sure you allow HTTP port 80 and 25001 for 1search queries and upserts

  9. Click Create Endpoint to finish

# 4. Register newly created VPC Endpoint DNS names

After creating the VPC Endpoint between your VPC and 1search, your newly created VPC Endpoint will automatically generate numerous DNS names(1 defualt + 1 * number of Avilability Zones) which need to be allowed in 1search.

  1. Select your newly created VPC Endpoint and a description panel should expand in the button of the page

  2. In Details - DNS names, note down only DNS names and ignore the ending string in the brackets

    Example:

    vpce-0b173aa29bbbf4818-nf47zpcn.vpce-svc-059717999f199f23f.ap-southeast-2.vpce.amazonaws.com
    vpce-0b173aa29bbbf4818-nf47zpcn-ap-southeast-2c.vpce-svc-059717999f199f23f.ap-southeast-2.vpce.amazonaws.com
    vpce-0b173aa29bbbf4818-nf47zpcn-ap-southeast-2a.vpce-svc-059717999f199f23f.ap-southeast-2.vpce.amazonaws.com
    vpce-0b173aa29bbbf4818-nf47zpcn-ap-southeast-2b.vpce-svc-059717999f199f23f.ap-southeast-2.vpce.amazonaws.com
    
  3. Go to the previously opened 1search client portal page, make sure you select the right service and that you are in the Infra tab

  4. Click Edit button

  5. In Endpoints text field, put in your noted DNS names, separated by newline

  6. Click the Update button to save the changes

  7. You can also create an A record to your all-region VPCE (i.e. the one without region specified) to have a user-friendly DNS name. After creating the alias record, remember to also register it as an "Endpoint" via our portal. e.g:

VPCE: http://vpce-0af37dd5642cb2f7b-n5aft84d-us-west-2a.vpce-svc-0b19f6a91b1fceb2f.us-west-2.vpce.amazonaws.com/

A Record alias: bookshop.mydomain.net
  1. At this point, you should be able to access 1search via a user-friendly DNS name such as bookshop.mydomain.net in the example above just like how you would normally access resources in your private subnet.