Custom cloud configuration is available for Professional and Enterprise tiers only.

Mantle runs in your AWS cloud account, so your data stays in your hands. In order for Mantle to organize your data and run pipelines within your AWS account, some permissions and services need to be configured.

We have provided a Terraform configuration to help you set up these resources. Terraform is a tool that allows you to define and manage your infrastructure configuration using code.

S3 buckets

You will select read and write buckets for data. Terraform will configure permissions.

Batch queue

Terraform will create a queue for compute jobs. You can specify some configuration parameters.

IAM users and roles

Terraform will create users and roles to configure AWS permissions.

Launch template

Terraform will create a launch template to configure compute instances.

Prerequisites

Steps

  1. Create a new directory for your Terraform configuration and navigate to it.
  2. Create a main.tf file in your directory with the following contents:
Mantle Terraform Example
provider "aws" {
  region = "<your-region>"
}

# Sets the account ID for the current user account.
data "aws_caller_identity" "current" {}

# Instantiate the Mantle module.
module "mantle" {
  source                 = "git::git@github.com:mantlebio/aws-batch-tf.git//terraform"
  region                 = "<your-region>"
  account_id             = data.aws_caller_identity.current.account_id
  mantle_tenant_id       = "<your-tenant-id>"
  read_write_bucket_name = "<your-read-write-bucket>"
  read_bucket_names      = ["<your-read-bucket-1>", "<your-read-bucket-2>"]
  create_new_readwrite_bucket = true
}
  1. Edit the main.tf file to include:
  • The AWS region you want to use (<your-region>)
  • Your Mantle tenant ID (<your-tenant-id>)
  • The S3 bucket where you want Mantle to store results and logs (<your-read-write-bucket>)
  • At least one S3 bucket where you store data you want to use in Mantle (["<your-read-bucket-1>", "<your-read-bucket-2>"])
  • Any other settings you want to change (see variables below)
  1. Inside your Terraform directory, run terraform init to download the necessary plugins.
  2. Inside your Terraform directory, run terraform apply to create the resources in your AWS account.
  3. When the resources are created, you will see the outputs of the terraform apply command. These outputs will include the ARN of the IAM role that Mantle will use to access your resources.

Variables

The Terraform configuration has a few variables that you can set to customize the resources that are created.

Basic

region
string
required

AWS region to set up resources in

account_id
string
required

Your AWS account ID (if using the example template above, this will be automatically populated)

mantle_tenant_id
string
required

Your tenant ID in Mantle (from the URL <tenant>.app.mantlebio.com)

S3 buckets

read_bucket_names
list(string)

A list of buckets Mantle should have read access to (anywhere where you store data that needs to be processed)

read_write_bucket_name
string
required

The bucket Mantle should have read-write access to. This is where results and logs will be stored.

create_new_readwrite_bucket
bool
default: "true"

If true, Terraform will attempt to create a new bucket for the read_write_bucket. If false, it assumes it exists already and updates permissions accordingly.

Batch queue

batch_queue_max_cpus
number
default: "32"

The maximum number of CPU the Batch queue can use at any given time. NOTE: Make sure this number is less than your accounts maximum.

batch_queue_min_cpus
number
default: "0"

The minimum number of CPU the Batch queue can use at any given time.

security_group_ids
list(string)

List of security groups to attach to the Batch queue. If not set, default AWS security groups are used.

subnet_ids
list(string)

List of subnets to attach to the Batch queue. If not set, default AWS subnets are used.