Skip to content

Deployment on AWS Cloud

This section describes how to use Terraform / Packer / Ansible to provision a Document Reader Web API.

Terraform is an Infrastructure as Code (IaC) software tool. With Terraform, you can provision infrastructure by using declarative configuration files.

Prerequisites

Info

You can download template configuration files from our GitHub repository.

Configuration & Deployment

Configure AWS CLI

Set AWS CLI credentials:

aws configure

Configure Packer

  • Set a regula.license file to the docreader/packer/artifacts/license/ folder.
  • Edit the Packer variables file docreader/packer/variables/docreader.pkrvars.hcl according to your needs.
  • Required docreader_tag (default "latest") can be found at Docker Hub.
  • Run a Packer build to create AWS AMI.
  • Execute the following command at the docreader/packer folder:
packer build -var-file=variables/docreader.pkrvars.hcl docreader.pkr.hcl

Configure Terraform

  • Edit Terraform variables at docreader/terraform/main.tf.
  • Upload a certificate for your domain *.example.com using AWS Certificate Manager (ACM) (see docreader/terraform/variables.tf - domain var).

Run Terraform Templates

Execute the following commands at the docreader/terraform folder:

terraform init
terraform workspace new dev || terraform workspace select dev # (optional)
terraform plan
terraform apply