Data Lens offer all their lenses as products in AWS Marketplace. Using AWS CloudFormation Templates, we have constructed a way in which you are able to use a one-click solution to deploy any of the lenses. Each template creates an AWS ECS service that contains a task running the required lens. The template also creates all other infrastructure required to host and access the ECS service (route tables, security groups, roles). This includes a VPC, 1 public subnet, and 2 private subnets. For security, the service is run in the private subnet and can be accessed only from a bastion host in the public subnet. The second private subnet is required only to allow a load balancer to be attached to the service but is otherwise redundant. This section provides information specific to running the lenses as products from the AWS MarketPlace. For more detailed instructions on working with lenses please see the main user guide for the specific lens you are working with.

AWS Architecture

Quick Create Stacks

Each lens has a Quick Create Stack for deployment which can be used once you have subscribed to the Lens in the relevant AWS Marketplace product page. Before creating the stack all that is required is to fill out the parameters fields which allow you to input custom values when you create or update the stack and check the box acknowledging that Cloudformation may create IAM resources. The details of the parameters required for each lens are shown below.

Structured File Lens

Once the parameters have been input and the acknowledgment check box ticked the stack can be created.

SQL Lens

Once the parameters have been input and the acknowledgment check box ticked the stack can be created.

RESTful Lens

Once the parameters have been input and the acknowledgment check box ticked the stack can be created.

Document Lens

Once the parameters have been input and the acknowledgment check box ticked the stack can be created.

Lens Writer

Once the parameters have been input and the acknowledgment check box ticked the stack can be created.

Connecting To Lenses

Once the creation of a stack has completed in cloudformation an Outputs section should be available. The Outputs section for all of the lenses will contain the dns name for the bastion host and and the dns name for the loadbalancer attached to the ECS Cluster with the suffix for the endpoint to run the process method on the lens (ApiEndpoint).

As the lens is in a private subnet we need to ssh into the bastion host from our local terminal to be able to send REST requests to the lens. The format for this command is as follows

ssh -i "<private-key-file>" ec2-user@<bastion-host-dns-name>

We provided the key file name as one of our parameters. The bastion host dns name is provided as an Output from the stack. Putting these into the above format we have the command

ssh -i "cloudformation-key.pem" ec2-user@ec2-3-228-6-67.compute-1.amazonaws.com

From the bastion host we can then use curl to perform a GET request to the ApiEndpoint value providing whatever specific parameter the lens requires.