Course outlines for learning terraform.
ssh_config.tf
:resource "local_file" "ssh_config" {
content = templatefile("./templates/ssh_config.tpl",
{
ip = azurerm_public_ip.publicip.ip_address,
username = var.admin_username
} )
filename = "./ssh_config"
}
templates/ssh_config.tpl
:Host ${ip}
User ${username}
export TF_VAR_admin_password="Password1234!"
export TF_VAR_admin_username="my_username"
terraform init
terraform plan
terraform apply