Terraform
  • 09 Sep 2024
  • 1 Minute to read
  • Dark
    Light

Terraform

  • Dark
    Light

Article summary

Volumez provides Terraform automation to streamline your data management. With Volumez Terraform PaaS, creating, deleting, and managing resources becomes seamless.

The following guide will provide the information needed to create the required infrastructure to deploy the Volumes SaaS platform within the user tenant account.

Pre-requisites:

  • Terraform installed (version 1.7.0 or higher).

  • AWS/Azure credentials set as environment variables.

  • kubectl (for Kubernetes EKS/AKS examples).

  • Helm v3.8 (for Kubernetes EKS/AKS examples).

  • AWS CLI / Azure CLI (for Kubernetes EKS/AKS examples).

Steps:

  1. Clone the Git project:

    git clone https://github.com/VolumezTech/volumez.git
    
  2. Select your platform (AWS EC2 / Azure VM / Kubernetes).

  3. Navigate to the relevant directory (Example for AWS EC2):

    cd volumez/terraform/aws/examples/ec2/complete/easy_starter
    
  4. Fill in the prerequisites:

Commands:

  • Create with default values:

    terraform init
    terraform apply -var-file="easy_starter.tfvars"
    
  • Custom variables:

    terraform init
    terraform apply -var="media_node_ami=ami-08895422b5f3aa64a" -var="media_node_type=i3en.3xlarge"
    
  • Custom variables (edit easy_starter.tfvars if needed):

    • region: Target region.

    • num_of_zones: Number of AZs to create the media/app nodes in (evenly spread between AZs).

    • create_fault_domain: Set to true for partitioned placement group strategy, otherwise cluster.

    • tenant_token: Tenant Token (JWT Access Token).

    • media_node_count: Number of media nodes to create.

    • media_node_type: Media EC2 type.

    • app_node_count: Number of performance hosts.

    • app_node_type: EC2 type for application node.

    Example configuration:

    code# General Configuration
    region  = "us-east-1"
    resources_name_prefix = "volumez"
    num_of_zones = 1
    create_fault_domain = false
    avoid_pg = true
    deploy_bastion = true
    key_name = ""
    
    # Existing Network Configuration (Optional)
    target_vpc_id             = ""
    target_subnet_id          = ""
    target_security_group_id  = ""
    target_placement_group_id = ""
    
    # Media Nodes
    media_node_count = 2
    media_node_type = "i4i.2xlarge"
    media_node_iam_role = null
    media_node_ami = "default"
    media_node_ami_username = "default"
    media_node_name_prefix = "media"
    
    # App Nodes
    app_node_count = 1
    app_node_type = "m5n.xlarge"
    app_node_iam_role = null
    app_node_ami = "default"
    app_node_ami_username = "default"
    app_node_name_prefix = "app"
    

SSH to Node:

  • If using an existing key, set the key_name in the .tfvars file and use this key to SSH.

  • Otherwise, create a key file from Terraform output and name it:

    terraform output ssh_key_value > <ssh-key-name>
    
  • SSH to media/app node in a private subnet via Bastion server:

    ssh -i <ssh-key-name> -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o "ProxyCommand=ssh -W %h:%p ec2-user@<bastion_public_dns> -i <ssh-key-name> -o StrictHostKeyChecking=no" ec2-user@<media/app_nodes_private_ips>
    

Terraform will launch EC2 instances and deploy a Volumez Connector. Once complete, you are ready to assign media and launch a Volume.


Was this article helpful?

What's Next