diff --git a/Terraform/Pre-Built_AMIs.md b/Terraform/Pre-Built_AMIs.md index e967284..7ada709 100644 --- a/Terraform/Pre-Built_AMIs.md +++ b/Terraform/Pre-Built_AMIs.md @@ -1,19 +1,27 @@ -# Method 2 - Use Pre-Built AMIs +# Method 1 - Use Pre-Built AMIs This method uses Terraform to bring DetectionLab infrastructure online by using pre-built shared AMIs. The supplied Terraform configuration can then be used to create EC2 instances and all requisite networking components. ## Prerequisites -* A machine to build DetectionLab with +* A system with Terraform, AWS CLI and git installed * An AWS account -* An AWS user and access keys to use with the AWS CLI -* Optional but recommended: a separate user for Terraform +* AWS credentials for Terraform + +[![DetectionLab - Terraform](https://i.vimeocdn.com/video/777172792_640.webp)](https://vimeo.com/331695321) + + ## Step by step guide -1. [Configure the AWS command line utility](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html) -2. Copy the file at [/DetectionLab/Terraform/terraform.tfvars.example](./terraform.tfvars.example) to `/DetectionLab/Terraform/terraform.tfvars` -3. In `terraform.tfvars`, provide overrides for the variables specified in [variables.tf](./variables.tf) -4. From the `/DetectionLab/Terraform/` directory, run `terraform init` to setup the initial Terraform configuration -5. Run `terraform apply` to begin the provisioning process +1. Ensure the prerequisites are installed: + * [Terraform](https://www.terraform.io/downloads.html) + * [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) + * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +2. [Configure the AWS command line utility](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html) and set up a user for Terraform. +3. Create a private/public keypair to use to SSH into logger: `ssh-keygen -b 2048 -f ~/.ssh/id_logger` +4. Copy the file at [/DetectionLab/Terraform/terraform.tfvars.example](./terraform.tfvars.example) to `/DetectionLab/Terraform/terraform.tfvars` +5. In `terraform.tfvars`, provide overrides for the variables specified in [variables.tf](./variables.tf) +6. From the `/DetectionLab/Terraform/` directory, run `terraform init` to setup the initial Terraform configuration +7. Run `terraform apply` to begin the provisioning process diff --git a/Terraform/README.md b/Terraform/README.md index 5d6ae8a..d377023 100644 --- a/Terraform/README.md +++ b/Terraform/README.md @@ -1,16 +1,21 @@ # DetectionLab Terraform -### Method 1 - Building the VMs locally and exporting them to AWS as AMIs -One method for spinning up DetectionLab in AWS is to begin by using Virtualbox or VMware to build DetectionLab locally. You can then use AWS's VM import capabilities to create AMIs based off of the virtual machines. Once that process is complete, the infrastructure can easily be spun up using a Terraform configuration file. +### Method 1 - Pre-built AMIs -This method has the benefit of allowing users to customize the VMs before importing them to AWS. +#### Estimated time to build: 30 minutes -The instructions for deploying DetectionLab in AWS via this method are available here: [Build Your Own AMIs README](./VM_to_AMIs.md) - - -### Method 2 - Pre-built AMIs As of March 2019, I am now sharing pre-built AMIs on the Amazon Marketplace. The code inside of main.tf uses Terraform data sources to determine the correct AMI ID and will use the pre-built AMIs by default. Using this method, it should be possible to bring DetectionLab online in under 15 minutes. The instructions for deploying DetectionLab in AWS using the pre-built AMIs are available here: [Pre-Built AMIs README](./Pre-Built_AMIs.md) + +### Method 2 - Building the VMs locally and exporting them to AWS as AMIs + +#### Estimated time to build: 3-4 hours + +One method for spinning up DetectionLab in AWS is to begin by using Virtualbox or VMware to build DetectionLab locally. You can then use AWS's VM import capabilities to create AMIs based off of the virtual machines. Once that process is complete, the infrastructure can easily be spun up using a Terraform configuration file. + +This method has the benefit of allowing users to customize the VMs before importing them to AWS. + +The instructions for deploying DetectionLab in AWS via this method are available here: [Build Your Own AMIs README](./VM_to_AMIs.md) diff --git a/Terraform/VM_to_AMIs.md b/Terraform/VM_to_AMIs.md index b77a87c..35bbe04 100644 --- a/Terraform/VM_to_AMIs.md +++ b/Terraform/VM_to_AMIs.md @@ -1,4 +1,4 @@ -# Method 1 - Build Locally and Import to AWS +# Method 2 - Build Locally and Import to AWS This method involves using Terraform to bring DetectionLab infrastructure online by first building it locally using Virtualbox/VMware and then [importing the resulting virtual machines](https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#import-vm-image) as AMIs on AWS.