{"id":15873739,"url":"https://github.com/tombuildsstuff/tf-defaulting-variables-example","last_synced_at":"2026-01-11T02:28:07.176Z","repository":{"id":142076191,"uuid":"100405223","full_name":"tombuildsstuff/tf-defaulting-variables-example","owner":"tombuildsstuff","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-15T18:14:21.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:46:39.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tombuildsstuff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-15T18:06:17.000Z","updated_at":"2017-08-15T18:06:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"bafcce70-28cd-4f17-87f8-f5fb1ab17bdc","html_url":"https://github.com/tombuildsstuff/tf-defaulting-variables-example","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"f4243a30f86d48f8af0d07a5a821675921be833a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Ftf-defaulting-variables-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Ftf-defaulting-variables-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Ftf-defaulting-variables-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Ftf-defaulting-variables-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombuildsstuff","download_url":"https://codeload.github.com/tombuildsstuff/tf-defaulting-variables-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724798,"owners_count":20823543,"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":[],"created_at":"2024-10-06T01:05:47.330Z","updated_at":"2026-01-11T02:28:07.170Z","avatar_url":"https://github.com/tombuildsstuff.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Defaulting Variables Example\n\n## Note\n\nThe \"Random\" Terraform Provider provides access to random names:\n\nhttps://www.terraform.io/docs/providers/random/r/pet.html\n\nIn the module we use the [coalesce interpolation function](https://www.terraform.io/docs/configuration/interpolation.html#coalesce-string1-string2-) to pick the first non-empty identifier for the resource group; being either the name or the \"random pet\".\nGiven this variable is defaulted to an empty string in `example/inputs.tf` - the user won't be prompted / have to pass this variable in.\n\nThat said - I'd suggest doing this only for Resource Names, and not to create Resources if they don't exist.\n\n## Running this example\n\n**Note** this requires Terraform 0.10\n\n```\nterraform init\n```\n\nThis will download the `azurerm` and `random` terraform providers.\n\nThis guide assumes you have the following environment variables configured - see [the AzureRM Provider guide](https://www.terraform.io/docs/providers/azurerm/index.html) for more info:\n\n- `ARM_TENANT_ID`\n- `ARM_SUBSCRIPTION_ID`\n- `ARM_CLIENT_ID`\n- `ARM_CLIENT_SECRET`\n\nTo see the plan for these changes run:\n```\nterraform plan\n```\n\nTo apply these changes run:\n```\nterraform apply\n```\n\nNote: in a Production environment you should save the Plan to a file and then apply that, but for development this should be fine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Ftf-defaulting-variables-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombuildsstuff%2Ftf-defaulting-variables-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Ftf-defaulting-variables-example/lists"}