#
# AWS
# Windows User Simulator instance
#

provider "aws" {
    region = "us-west-2"
}

variable "ami" {
    type = "string"
}

variable "server_count" {
    type = "string"
    default = "1"
}

variable "instance_type" {
    type = "string"
    default = "t2.micro"
}

variable "key_name" {
    type = "string"
}


locals {
    ServerName = "UserSimulatorLoadTest"
}


resource "aws_instance" "LoadTest" {
    count = "${var.server_count}"
    ami = "${var.ami}"
    instance_type = "${var.instance_type}"
    key_name = "${var.key_name}"
    user_data = "${file("Windows/startup.xml")}"
    security_groups = [
        # Developer: RDP for Unity Build Machines
        "[Bigscreen] RDP for Unity Build Machines"
    ]

    tags = {
        Name = "[LoadTest] ${local.ServerName}"
    }
}
