Skip to content

Latest commit

 

History

History

1-Using-Variables

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Using Variables

In our first example, we used a static password for our user. In this example, we'll pass an SSH key as a Terraform variable instead.

config.yaml remains mostly the same with the exception of ${ssh_key} being in the place an SSH key is supposed to be. This value will be replaced using Terraform's templatefile function.

To deploy the example run,

# Download dependencies
terraform init

# Deploy!
terraform apply -var="ssh_key={{ place your SSH public key here }}"

Once the deployment is complete, the public IP address of the node will be printed. You can now SSH to the node as the user user and your SSH key.