{"id":15684292,"url":"https://github.com/trstringer/terraform-azure-linux-vm","last_synced_at":"2025-05-07T15:50:31.517Z","repository":{"id":147740310,"uuid":"87945397","full_name":"trstringer/terraform-azure-linux-vm","owner":"trstringer","description":":penguin: Provision an Azure Linux VM with Terraform","archived":false,"fork":false,"pushed_at":"2024-06-06T01:17:55.000Z","size":9,"stargazers_count":9,"open_issues_count":0,"forks_count":22,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T11:35:36.195Z","etag":null,"topics":["azure","devops","linux","terraform"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trstringer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T14:40:49.000Z","updated_at":"2023-08-24T07:28:54.000Z","dependencies_parsed_at":"2025-03-11T06:42:48.534Z","dependency_job_id":null,"html_url":"https://github.com/trstringer/terraform-azure-linux-vm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fterraform-azure-linux-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fterraform-azure-linux-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fterraform-azure-linux-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fterraform-azure-linux-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trstringer","download_url":"https://codeload.github.com/trstringer/terraform-azure-linux-vm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252910671,"owners_count":21823885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","devops","linux","terraform"],"created_at":"2024-10-03T17:14:10.774Z","updated_at":"2025-05-07T15:50:31.509Z","avatar_url":"https://github.com/trstringer.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux VM Provisioning with Terraform\n\n*Quickly create a single Linux VM in Azure, with sane and secure defaults*\n\n## Requirements\n\n- Terraform\n- Azure Subscription\n\n## Setup and Configuration\n\nEnsure that you have Terraform installed. If you don't, you can [reference the official Terraform documentation on installing](https://www.terraform.io/intro/getting-started/install.html)...\n\n```\nwhich terraform\n```\n\nThe Azure provider in Terraform requires the following environment variables defined...\n\n- `ARM_SUBSCRIPTION_ID`\n- `ARM_TENANT_ID`\n- `ARM_CLIENT_SECRET`\n- `ARM_CLIENT_ID`\n\nFollow the [instructions here](https://www.terraform.io/docs/providers/azurerm/index.html#to-create-using-azure-cli-) on how to create application credentials required for the above variables.\n\n## Provisioning\n\nThere are two ways to use this to provision...\n\n1. Clone to git repository and run the module directly\n1. Create a new Terraform module that sources this remote module\n\n### Source this remote module\n\nThis is approach #2 from above. You can create a base module locally to source this module...\n\n```hcl\nmodule \"azlinuxvm\" {\n  source = \"github.com/tstringer/terraform-azure-linux-vm\"\n\n  name_prefix    = \"myprefix\"\n  hostname       = \"myhostname\"\n  ssh_public_key = \"${file(\"/home/yourlocaluser/.ssh/id_rsa.pub\")}\"\n}\n```\n\nThen run `terraform get` to pull this module, and `terraform plan` to see what will happen, and lastly `terraform apply` to kick off the provisioning.\n\n### Run module directly\n\nClone this repository...\n```\n$ git clone https://github.com/tstringer/terraform-azure-linux-vm.git\n```\n\nNavigate your terminal to this module's root directory. It's wise to first see what Terraform will do in your subscription...\n\n```\nterraform plan -var \"name_prefix=linux\" -var \"hostname=linux$(echo $RANDOM)\" -var \"ssh_public_key=$(cat ~/.ssh/id_rsa.pub)\"\n```\n\nIf you are satisfied, then start the provisioning process...\n\n```\nterraform apply -var \"name_prefix=linux\" -var \"hostname=linux$(echo $RANDOM)\" -var \"ssh_public_key=$(cat ~/.ssh/id_rsa.pub)\"\n```\n\n\u003e :bulb: As you can see here, there are three required variables (and only three): \n* `name_prefix` (what to prefix your Azure resources with)\n* `hostname` (this will be the public DNS name, recommended to randomize it to prevent likeliness of collisions)\n* `ssh_public_key` (your public key). To see optional variables and their defaults, take a look at `vars.tf`\n\n## Output\n\nAfter you run this Terraform module, there will be two outputs: `admin_username` and `vm_fqdn`. These two pieces are what you need to then immediately ssh into your new Linux machine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fterraform-azure-linux-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrstringer%2Fterraform-azure-linux-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fterraform-azure-linux-vm/lists"}