Update Terraform Network Adapter to ens5 and use t3 instances where possible

This commit is contained in:
Chris Long
2020-05-09 16:30:11 -07:00
parent 745a4cd81b
commit 692265b7c0
3 changed files with 9 additions and 9 deletions

View File

@@ -155,7 +155,7 @@ resource "aws_key_pair" "auth" {
}
resource "aws_instance" "logger" {
instance_type = "t2.medium"
instance_type = "t3.medium"
ami = coalesce(var.logger_ami, data.aws_ami.logger_ami.image_id)
tags = {
@@ -167,7 +167,6 @@ resource "aws_instance" "logger" {
key_name = aws_key_pair.auth.key_name
private_ip = "192.168.38.105"
# Provision the AWS Ubuntu 16.04 AMI from scratch.
# Provision the AWS Ubuntu 16.04 AMI from scratch.
provisioner "remote-exec" {
inline = [
@@ -177,8 +176,9 @@ resource "aws_instance" "logger" {
"sudo mkdir /home/vagrant/.ssh && sudo cp /home/ubuntu/.ssh/authorized_keys /home/vagrant/.ssh/authorized_keys && sudo chown -R vagrant:vagrant /home/vagrant/.ssh",
"echo 'vagrant ALL=(ALL:ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers",
"sudo git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab",
"sudo sed -i 's/eth1/eth0/g' /opt/DetectionLab/Vagrant/bootstrap.sh",
"sudo sed -i 's/ETH1/ETH0/g' /opt/DetectionLab/Vagrant/bootstrap.sh",
"sudo sed -i 's/eth1/ens5/g' /opt/DetectionLab/Vagrant/bootstrap.sh",
"sudo sed -i 's/ETH1/ens5/g' /opt/DetectionLab/Vagrant/bootstrap.sh",
"sudo sed -i 's/eth1/ens5/g' /opt/DetectionLab/Vagrant/resources/suricata/suricata.yaml",
"sudo sed -i 's#/vagrant/resources#/opt/DetectionLab/Vagrant/resources#g' /opt/DetectionLab/Vagrant/bootstrap.sh",
"sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config",
"sudo service ssh restart",
@@ -202,7 +202,7 @@ resource "aws_instance" "logger" {
}
resource "aws_instance" "dc" {
instance_type = "t2.medium"
instance_type = "t3.medium"
provisioner "remote-exec" {
inline = [
@@ -237,7 +237,7 @@ resource "aws_instance" "dc" {
}
resource "aws_instance" "wef" {
instance_type = "t2.medium"
instance_type = "t3.medium"
provisioner "remote-exec" {
inline = [

View File

@@ -46,7 +46,7 @@ variable "external_dns_servers" {
default = ["8.8.8.8"]
}
# Use Data Sources to resolve the AMI-ID for the Ubuntu 16.04 AMI
# Use Data Sources to resolve the AMI-ID for the Ubuntu 18.04 AMI
data "aws_ami" "logger_ami" {
owners = ["099720109477"]

View File

@@ -42,8 +42,8 @@ vagrant plugin install vagrant-reload
vagrant plugin install vagrant-vmware-desktop
echo $LICENSEFILE | base64 -d > /tmp/license.lic
vagrant plugin license vagrant-vmware-desktop /tmp/license.lic
wget --progress=bar:force "https://releases.hashicorp.com/vagrant-vmware-utility/1.0.7/vagrant-vmware-utility_1.0.7_x86_64.deb"
dpkg -i vagrant-vmware-utility_1.0.7_x86_64.deb
wget --progress=bar:force "https://releases.hashicorp.com/vagrant-vmware-utility/1.0.9/vagrant-vmware-utility_1.0.9_x86_64.deb"
dpkg -i vagrant-vmware-utility_1.0.9_x86_64.deb
# Make the Vagrant instances headless
cd /opt/DetectionLab/Vagrant || exit 1