Updating docs for Terraform

This commit is contained in:
Chris Long
2019-04-21 14:18:59 -07:00
parent c53ce5681c
commit a310ce8fed
3 changed files with 30 additions and 17 deletions

View File

@@ -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. 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. The supplied Terraform configuration can then be used to create EC2 instances and all requisite networking components.
## Prerequisites ## Prerequisites
* A machine to build DetectionLab with * A system with Terraform, AWS CLI and git installed
* An AWS account * An AWS account
* An AWS user and access keys to use with the AWS CLI * AWS credentials for Terraform
* Optional but recommended: a separate user for Terraform
[![DetectionLab - Terraform](https://i.vimeocdn.com/video/777172792_640.webp)](https://vimeo.com/331695321)
<iframe src="https://player.vimeo.com/video/331695321" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
## Step by step guide ## Step by step guide
1. [Configure the AWS command line utility](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html) 1. Ensure the prerequisites are installed:
2. Copy the file at [/DetectionLab/Terraform/terraform.tfvars.example](./terraform.tfvars.example) to `/DetectionLab/Terraform/terraform.tfvars` * [Terraform](https://www.terraform.io/downloads.html)
3. In `terraform.tfvars`, provide overrides for the variables specified in [variables.tf](./variables.tf) * [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)
4. From the `/DetectionLab/Terraform/` directory, run `terraform init` to setup the initial Terraform configuration * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
5. Run `terraform apply` to begin the provisioning process 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

View File

@@ -1,16 +1,21 @@
# DetectionLab Terraform # DetectionLab Terraform
### Method 1 - Building the VMs locally and exporting them to AWS as AMIs ### Method 1 - Pre-built 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.
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. 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. 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) 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)

View File

@@ -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. 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.