Skip to content

Quine Enterprise Terraform Module for AWS

Deploys Quine Enterprise on AWS ECS Fargate using the terraform-aws-quine-enterprise module.

Prerequisites

  • Terraform >= 1.5.0
  • AWS CLI configured with credentials
  • Route53 hosted zone (for HTTPS)
  • Quine Enterprise license key

Usage

Step 1: Create the Terraform files

Create the following files in a new directory:

terraform {
  required_version = ">= 1.5.0"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.0"
    }
  }
}

provider "aws" {
  region = var.aws_region
}

resource "aws_acm_certificate" "this" {
  domain_name       = var.domain_name
  validation_method = "DNS"

  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_route53_record" "cert_validation" {
  for_each = {
    for dvo in aws_acm_certificate.this.domain_validation_options : dvo.domain_name => {
      name   = dvo.resource_record_name
      record = dvo.resource_record_value
      type   = dvo.resource_record_type
    }
  }

  zone_id = var.hosted_zone_id
  name    = each.value.name
  type    = each.value.type
  records = [each.value.record]
  ttl     = 60
}

resource "aws_acm_certificate_validation" "this" {
  certificate_arn         = aws_acm_certificate.this.arn
  validation_record_fqdns = [for record in aws_route53_record.cert_validation : record.fqdn]
}

module "quine_enterprise" {
  source = "github.com/thatdot/terraform-aws-quine-enterprise?ref=v1.0.0"

  project_name    = var.project_name
  container_image = var.container_image

  enable_https    = true
  certificate_arn = aws_acm_certificate.this.arn

  java_opts = "-Dquine.license-key=${var.license_key}"

  depends_on = [aws_acm_certificate_validation.this]
}

resource "aws_route53_record" "alb_alias" {
  zone_id = var.hosted_zone_id
  name    = var.domain_name
  type    = "A"

  alias {
    name                   = module.quine_enterprise.alb_dns_name
    zone_id                = module.quine_enterprise.alb_zone_id
    evaluate_target_health = true
  }
}
variable "aws_region" {
  description = "AWS region"
  type        = string
  default     = "us-west-2"
}

variable "project_name" {
  description = "Project name for resource naming"
  type        = string
}

variable "container_image" {
  description = "Quine Enterprise container image"
  type        = string
}

variable "license_key" {
  description = "Quine Enterprise license key"
  type        = string
  sensitive   = true
}

variable "domain_name" {
  description = "Domain name for HTTPS (e.g., quine.example.com)"
  type        = string
}

variable "hosted_zone_id" {
  description = "Route53 hosted zone ID"
  type        = string
}
output "url" {
  description = "URL to access Quine Enterprise"
  value       = "https://${var.domain_name}"
}

output "alb_dns_name" {
  description = "ALB DNS name"
  value       = module.quine_enterprise.alb_dns_name
}

output "ecs_cluster_name" {
  description = "ECS cluster name"
  value       = module.quine_enterprise.ecs_cluster_name
}

output "cloudwatch_log_group" {
  description = "CloudWatch log group"
  value       = module.quine_enterprise.cloudwatch_log_group_name
}
project_name    = "quine-enterprise"
container_image = "your-registry/quine-enterprise:latest"
license_key     = "YOUR_LICENSE_KEY"
domain_name     = "quine-enterprise.example.com"
hosted_zone_id  = "Z0123456789ABCDEFGHIJ"

Step 2: Configure variables

Copy the example variables file and edit it with your values:

cp terraform.tfvars.example terraform.tfvars

Fill in the required values in terraform.tfvars:

  • domain_name - Your domain (e.g., quine-enterprise.example.com)
  • hosted_zone_id - Route53 zone ID for your domain
  • container_image - Your Quine Enterprise container image
  • license_key - Your Quine Enterprise license key

Step 3: Deploy

terraform init
terraform plan
terraform apply

Once complete, access Quine Enterprise at https://<your-domain-name>.

Cleanup

terraform destroy