Warning
This is not a production configuration or a building block. It is intended for educational use, or as a starting point for a more complete infrastructure design.
This example demonstrates minimal installation of Nutrient Document Engine in AWS using Terraform.
The resources deployed will include:
- AWS Elastic Container Service cluster as means of container orchestration
- Addons to integrate Amazon resources for logging and load balancing
- PostgreSQL database running on AWS Relational Database Service
- Nutrient Document Engine
- No S3 bucket, using
built-instorage - No HTTPS (requires a domain available)
- No proper secret management (plain environment variables)
You will need an AWS account, and a profile set for it.
You can use the AWS CLI to set this up by running aws configure --profile document-engine-example. After running this command, the configuration wizard will guide you through setting up the profile.
Or you can manually edit the ~/.aws/* configuration files.
This entails something like this in ~/.aws/credentials:
[document-engine-example]
aws_access_key_id = ...
aws_secret_access_key = ...
Clone this repository.
Prepare Terraform environment by setting the AWS profile and (optionally) region to use. This can be done by setting environment variables:
export TF_VAR_aws_profile_name="document-engine-example"
export TF_VAR_aws_region="eu-north-1" # Remove or change the default in `terraform.tfvars` file if setting this variableAlternatively, prepare to provide AWS profile name for interactive input during the following commands.
Edit terraform.tfvars file if necessary:
environment_name_prefix = "your-unique-prefix"
document_engine_api_auth_token = "your-api-auth-token"
document_engine_dashboard_username = "admin"
document_engine_dashboard_password = "your-secure-password"
document_engine_parameters = {
image_tag = "2024.9.0"
cpu = 1024
memory = 2048
desired_count = 1
logging_level = "info"
port = 5000
jwt_algorithm = "RS256"
jwt_public_key_path = "./JWT_PUBLIC_KEY.pem"
extra_env = {}
}Note
Estimated monthly cost: ~$150-200 (RDS db.m8g.large + ALB + NAT Gateway)
Consider using smaller instance types like db.t4g.micro for testing.
Put dependencies in place:
terraform init -upgradeNext, generate a JWT key pair using the generate-jwt-pair.sh script
# Run from within this directory
./generate-jwt-pair.shFinally, examine the plan and apply it:
terraform plan
terraform applyOutput should include deployment information:
...
document_engine_endpoint = "http://nutrient-de-demo-905380917.eu-north-1.elb.amazonaws.com:80"
Terraform deployment output from the previous subsection should contain document_engine_endpoint string.
It corresponds to AWS Application Load Balancer that exposes Document Engine.
Dashboard is accessible by /dashboard path, with default username admin and password nutrientAdmin!, unless you changed it.
To remove the resources created above:
terraform destroyThis software is licensed under a modified BSD license.
Nutrient offers support via https://support.nutrient.io/hc/en-us/requests/new
Are you evaluating our SDK? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://www.nutrient.io/contact-sales?=sdk