To use this, you need an AWS account and some credentials.
Caution The GPU machines are not part of the free tier; therefore, charges may apply.
Note: All the content is in a single file for clarity
To init the stack, you need to run:
This creates a file called
tfstate and downloads the scripts mandatory for terraform to interact with AWS
Warning do not remove the tfstate file, or you will not be able to destroy your machine without manual intervention.
3 variables are used in this stack:
- the ssh key name. For more info on the process, please see Creating a key pair using amazon EC2
- the region where you want your instance
- the IP address allowed by the firewall (your IP -
curl ifconfig.cois you friend)
You can enter those values at runtime, or create a file
terraform.tfvars containing the following entries:
region = "us-east-1" keyName = "MyKeyName" ssh_authorized_ip = "0.0.0.0/0" // Don't do that !
Creating the machine
terraform apply creates a machine and display its IP address on stdout.
You can connect to the machine by
ssh with the user
Destroying the machine
terraform destroy destroys the machine. All data are lost. Billing is stopped.
Finding the IP
terraform output is your friend. It will display the public IP of the machine.