Skip to content

Deployment on AWS Cloud

This section describes how to use Terraform/Packer/Ansible to provision a Face SDK Web API.

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



You can download template configuration files from our GitHub Public repository.

Configuration and Deployment

Configure AWS CLI

  • Set AWS CLI credentials:
aws configure

Configure Packer

  • Set a regula.license file to the faceapi/packer/artifacts/license/ folder.
  • Edit the Packer variables file faceapi/packer/variables/faceapi.pkrvars.hcl according to your needs.
  • Required faceapi_tag (default "") can be found at Docker Hub.
  • faceapi_engine is either cpu (default) or gpu. This is important for the next Terraform section.
  • Run a Packer build to create AWS AMI.


Execute the command at the faceapi/packer folder.

packer build -var-file=variables/faceapi.pkrvars.hcl faceapi.pkr.hcl

Configure Terraform

  • Edit Terraform variables at faceapi/terraform/
  • Upload a certificate for your domain "*" using AWS Certificate Manager (ACM). (See faceapi/terraform/ - domain var.)

Run Terraform templates


Execute commands at the faceapi/terraform folder.


The default engine is CPU. To deploy a GPU version, do the following:
- Set faceapi_engine to gpu and faceapi_instance_type to one of the g4dn instance types, i.e. g4dn.large at the terraform/ file.
- The Packer image also should have faceapi_engine set to gpu.

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