Terraforming my own Gaming Instance

I recently got inspired by https://medium.com/@bmatcuk/gaming-on-amazon-s-ec2-83b178f47a34.

A few weeks back I was connecting with a friend over Discord and we thought it would be fun to play an online board game. The game in question - Terraforming Mars - is available on Steam for Windows. I have only bought and used VMware with windows for the rare day each year when I need to file my LLC taxes by preparing a 1065. Quickbooks for businesses still only exists for Windows and not Mac, a major gripe, and also a business opportunity if you were looking for a business idea to solve.

Having just learned a lot about cloud computing on AWS, and even more about Terraform (terraform.io) - not to be confused with the game I am talking about) - I thought it made sense to put my new knowledge to good use.

I adapted Bob Matuck's blog and combined it with Terraform. The result is as follows:

```
# Terraform configuration

provider "aws" {
 region = "us-east-1"
}

resource "aws_volume_attachment" "ebs_att" {
 device_name = "/dev/sdh"
 volume_id   = aws_ebs_volume.gameplay-ebs.id
 instance_id = aws_spot_instance_request.cheap_gaming_cpu.spot_instance_id
}

resource "aws_spot_instance_request" "cheap_gaming_cpu" {
 ami                     = "ami-XXXXXXXXXXX"
 spot_price              = "0.35"
 instance_type           = "g2.2xlarge"
 availability_zone       = "us-east-1b"
 wait_for_fulfillment    = true
 key_name                = "XXXXXXXXX"
 vpc_security_group_ids  = ["XX-XXXXXX"] // Obfuscated a few things from this blog for obvious reasons.
 tags = {
   Name = "Terraforming Mars gameplay"
   "Terraform Managed"   = "true"
   Purpose = "gaming"
 }
}

resource "aws_ebs_volume" "gameplay-ebs" {
 availability_zone = aws_spot_instance_request.cheap_gaming_cpu.availability_zone
 size              = 30

 tags = {
   Name = "Gaming EBS"
   "Terraform Managed" = "true"
 }
}


```

First, it's important to highlight how powerful this machine is. This is a professional grade graphics machine. This thing is powerful and the speed by which you play games is only dependent on your internet connection, now the power of the hardware. In my case, I'm using servers out of US East 1, which is less than 50 miles away. This thing is fast.

Second, the terraform script works the same as Bob's manual setup of a gaming instance. After following his blog, I took a snapshot of the EC2 instance and populated that into the AMI field above. He recommends to do this anyway, but terraform automates the creation and destruciton of these instances and the whole process is abstracted to command line, making it far faster to get playing. Now, whenever I want to play games on a super fast windows machine, I simply change directory to where this TF directory is hosted and run the well known terraform curses:

`terraform init`

`terraform plan`

`terraform apply`

With a spot instance pricing of $0.35 / hour, I could play video games for several years on this high powered AWS machine before it costs anywhere close to a professional rig.