Deploy an Ubuntu or Debian Amazon Web Services server with Terraform
This guide provides the information needed to deploy an Ubuntu or Debian Amazon Web Services cloud server with systemd and a bastion to your Advanced Server Access team with Terraform. Depending on your target server and enrollment type, some topics in this guide may not apply to you, such as if your team's project will not be using Terraform or if you plan to add a different server type to your project. Modify these steps as needed to fit your team or refer to another cloud deployment guide.
Creating a cloud server with Terraform means installing the Terraform tool on your personal machine and using an access ID, enrollment token, and secret ID to create servers on the Amazon Web Services console. Once created, your new servers should list automatically within your team's console in Advanced Server Access.
Note: This guide uses the ScaleFT Starter Kit as its Terraform module. View the kit on GitHub. For your setup, use your company's Terraform repository for your production environment. The configuration values in your terraform.tfvars file should be similar to those in this guide.
- Download and install Terraform
- Locate and save your Amazon Web Services security credentials
- Configure Terraform for Advanced Server Access and Amazon Web Services
- Next steps
You need the following permissions you need to deploy an Amazon Web Services server with Terraform:
Amazon Web Services
|Amazon Web Services Account||An Amazon Web Services account is needed to access the AWS Management console, where you create virtual machines for your team.|
Advanced Server Access
|Advanced Server Access team||This is the top-level object that is representing an organization within Advanced Server Access.|
|Advanced Server Access project||This is the authorization-scope of your team, organizing your users, groups, and servers.|
- Unzip the downloaded file and run the unix executable.
- Navigate to the Amazon Web Services console and sign in to your account.
Click the dropdown next to your username in the top-right corner of the console and select My Security Credentials.
If prompted with another window concerning AWS Identity and Access Management users, click Continue to Security Credentials.
- Expand Access Keys (Access Key ID and Secret Access Key).
- Click Create New Access Key, then expand Hide Access Key to see your new access key ID and secret access key.
- Copy the access key ID and then secret access key and save them both in a secure location.
Create a file named terraform.tfvars and add the following lines:
- Replace <access-key> and <secret-key> in terraform.tfvars with the access key ID and secret access key values that you copied earlier.
- Replace <enrollment-token> in terraform.tfvars with your Advanced Server Access enrollment token.
Save the file and place it in your Terraform module.
In your machine's console, run which terraform to confirm that your Terraform path exists. Depending on your platform, the output should look something to: /Users/user/bin/terraform
- Confirm that you are in your Terraform module, then run terraform init
- Confirm that the information in terraform.tfvars is correct by running terraform plan. If you receive any errors, troubleshoot as needed before proceeding.
- Run terraform apply to begin creating your servers. Enter yes if prompted for approval.
Confirm that your new servers are listed in Advanced Server Access before you attempt to connect to them.