This repository contains an example on how to deploy a dedicated mac host in AWS and deploy Parallels Desktop on it. will will also install two virtual machines. It contains everything needed for it to run using the latest terraform.
You will need several requirements to be able to run this terraform script
- Terraform Cli
- AWS account with an API access
- You will need the AWS
access
key and the AWSsecret key
- You will need the AWS
For running the terraform script, you should:
-
Clone the repo locally
-
Create a
local.tfvars
inside the root and add the following:aws_access_key = "" // Your AWS access key aws_secret_key = "" // Your AWS secret key aws_region = "" // the region where you want to deploy, ex: us-east-2 aws_availability_zone_index = 0 // the availability zone index, this is normally 0 use_intel = false // do you want to deploy a x86 mac or a ARM one machines_count = 1 // How many machines do you want to deploy
Attention: At the moment of writing, only the US region has the new ARM Mac hardware and even there not all availability zones have them, check here before you choose.
by default the script will try to get the latest AMI available but you can set this manually by adding your own AMI ID or a specific version of the AMI, for example:
```json
mac_ami_id = "ami-09b2201fa15c4cb83"
```
__Attention:__ The AMI ID is different for each region and availability zone, so make sure you use the correct one.
-
Run terraform init:
$ terraform init
-
Run the validate command
$ terraform validate
-
Run the plan command:
$ terraform plan -var-file local.tfvars
-
Verify that you are happy with the plan, if so run
$ terraform apply -var-file local.tfvars
Attention: Applying the plan might take several minutes
You should now have a dedicated Mac host running Parallels Desktop and with two virtual machines on it, if you want to connect to the host using ssh to further customize it you can do so:
-
Run in the terminal
$ terraform output -raw ssh_private_key > private.key & chmod 0600 private.key
-
Get the IP for the host by running in terminal
$ terraform output instance_public_ip
-
Run in terminal:
$ ssh -i private.key ec2-user@<host_ip>