{"id":21514893,"url":"https://github.com/getindata/terraform-azurerm-subscription","last_synced_at":"2026-03-19T20:41:51.396Z","repository":{"id":59146004,"uuid":"530535686","full_name":"getindata/terraform-azurerm-subscription","owner":"getindata","description":"Terraform Module for Azure Subscription","archived":false,"fork":false,"pushed_at":"2023-12-11T22:16:15.000Z","size":37,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-07T22:04:51.849Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getindata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-08-30T06:58:43.000Z","updated_at":"2022-11-16T04:17:57.000Z","dependencies_parsed_at":"2023-01-18T18:46:31.439Z","dependency_job_id":"7785b9b5-5987-4551-b946-5ab7dc87130f","html_url":"https://github.com/getindata/terraform-azurerm-subscription","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"getindata/terraform-module-template","purl":"pkg:github/getindata/terraform-azurerm-subscription","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-azurerm-subscription","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-azurerm-subscription/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-azurerm-subscription/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-azurerm-subscription/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getindata","download_url":"https://codeload.github.com/getindata/terraform-azurerm-subscription/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-azurerm-subscription/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28891448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-23T23:53:26.757Z","updated_at":"2026-01-30T11:24:14.343Z","avatar_url":"https://github.com/getindata.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Subscription Terraform Module\n\n![Azure](https://img.shields.io/badge/azure-%230072C6.svg?style=for-the-badge\u0026logo=microsoftazure\u0026logoColor=white)\n![Terraform](https://img.shields.io/badge/terraform-%235835CC.svg?style=for-the-badge\u0026logo=terraform\u0026logoColor=white)\n\n![License](https://badgen.net/github/license/getindata/terraform-azurerm-subscription/)\n![Release](https://badgen.net/github/release/getindata/terraform-azurerm-subscription/)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg height=\"150\" src=\"https://getindata.com/img/logo.svg\"\u003e\n  \u003ch3 align=\"center\"\u003eWe help companies turn their data into assets\u003c/h3\u003e\n\u003c/p\u003e\n\n---\n\nThis module manages Azure Subscription.\n\n## USAGE\n```hcl\nmodule \"test_subscription\" {\n  source  = \"github.com/getindata/terraform-azurerm-subscription\"\n\n  name              = \"Test Subscription\"\n  subscription_id   = \"00000000-0000-0000-0000-000000000000\"\n}\n```\n\n## Consumption Budget\nYou can create a consumption budget for the subscription and setup notifications based on various thresholds.\n\n```hcl\nconsumption_budgets = {\n  default = {\n    amount = 100\n    time_period = {\n      start_date = \"2022-07-01T00:00:00Z\"\n    }\n    notifications = {\n      forecastedGreaterThan100 = {\n        contact_emails = [\"notify@example.com\"]\n        operator       = \"GreaterThan\"\n        threshold      = 100\n        threshold_type = \"Forecasted\"\n      }\n    }\n  }\n}\n```\n\n\u003e This module supports only e-mail addresses for notification.\n\n## Examples\n\n- [Basic Subscription management](examples/basic)\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n\n\n\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_additional_tag_map\"\u003e\u003c/a\u003e [additional\\_tag\\_map](#input\\_additional\\_tag\\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.\u003cbr\u003eThis is for some rare cases where resources want additional configuration of tags\u003cbr\u003eand therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |\n| \u003ca name=\"input_attributes\"\u003e\u003c/a\u003e [attributes](#input\\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,\u003cbr\u003ein the order they appear in the list. New attributes are appended to the\u003cbr\u003eend of the list. The elements of the list are joined by the `delimiter`\u003cbr\u003eand treated as a single ID element. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_billing_enrollment_account_scope\"\u003e\u003c/a\u003e [billing\\_enrollment\\_account\\_scope](#input\\_billing\\_enrollment\\_account\\_scope) | Enterprise Account details. The Billing Account Name and the Enrollment Account Name. | \u003cpre\u003eobject({\u003cbr\u003e    billing_account_name : string\u003cbr\u003e    enrollment_account_name : string\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_consumption_budgets\"\u003e\u003c/a\u003e [consumption\\_budgets](#input\\_consumption\\_budgets) | Consumption budget resources associated with this resource group, it should be a map of values:\u003cbr\u003e`{\u003cbr\u003e  amount = number\u003cbr\u003e  time_period = object\u003cbr\u003e  notifications = map\u003cbr\u003e\u003cbr\u003e  #optional\u003cbr\u003e  time_grain = string\u003cbr\u003e}`\u003cbr\u003e`time_period` is an object of `start_date` (which is required) and `end_date` (which is optional).\u003cbr\u003e`time_grain` must be one of Monthly, Quarterly, Annually, BillingMonth, BillingQuarter, or BillingYear. Defaults to Monthly\u003cbr\u003e`notifications` is a map of values:\u003cbr\u003e`{\u003cbr\u003e  #optional\u003cbr\u003e  contact_emails = list(string)\u003cbr\u003e  operator = string\u003cbr\u003e  threshold = string\u003cbr\u003e  threshold_type = string\u003cbr\u003e}`\u003cbr\u003e`contact_emails` is a list of email addresses to send the budget notification to when the threshold is exceeded\u003cbr\u003e`operator` - the comparison operator for the notification. Must be one of EqualTo, GreaterThan, or GreaterThanOrEqualTo. Defaults to `EqualTo`\u003cbr\u003e`threshold` - threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000. Defaults to 90.\u003cbr\u003e`threshold_type` - the type of threshold for the notification. This determines whether the notification is triggered by forecasted costs or actual costs. The allowed values are Actual and Forecasted. Default is Actual.\u003cbr\u003e\u003cbr\u003eFor more information, please visit: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_resource_group | `map(any)` | `{}` | no |\n| \u003ca name=\"input_context\"\u003e\u003c/a\u003e [context](#input\\_context) | Single object for setting entire context at once.\u003cbr\u003eSee description of individual variables for details.\u003cbr\u003eLeave string and numeric variables as `null` to use default value.\u003cbr\u003eIndividual variable settings (non-null) override settings in context object,\u003cbr\u003eexcept for attributes, tags, and additional\\_tag\\_map, which are merged. | `any` | \u003cpre\u003e{\u003cbr\u003e  \"additional_tag_map\": {},\u003cbr\u003e  \"attributes\": [],\u003cbr\u003e  \"delimiter\": null,\u003cbr\u003e  \"descriptor_formats\": {},\u003cbr\u003e  \"enabled\": true,\u003cbr\u003e  \"environment\": null,\u003cbr\u003e  \"id_length_limit\": null,\u003cbr\u003e  \"label_key_case\": null,\u003cbr\u003e  \"label_order\": [],\u003cbr\u003e  \"label_value_case\": null,\u003cbr\u003e  \"labels_as_tags\": [\u003cbr\u003e    \"unset\"\u003cbr\u003e  ],\u003cbr\u003e  \"name\": null,\u003cbr\u003e  \"namespace\": null,\u003cbr\u003e  \"regex_replace_chars\": null,\u003cbr\u003e  \"stage\": null,\u003cbr\u003e  \"tags\": {},\u003cbr\u003e  \"tenant\": null\u003cbr\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_default_consumption_budget_notification_emails\"\u003e\u003c/a\u003e [default\\_consumption\\_budget\\_notification\\_emails](#input\\_default\\_consumption\\_budget\\_notification\\_emails) | List of e-mail addresses that will be used for notifications if they were not provided explicitly | `list(string)` | `[]` | no |\n| \u003ca name=\"input_delimiter\"\u003e\u003c/a\u003e [delimiter](#input\\_delimiter) | Delimiter to be used between ID elements.\u003cbr\u003eDefaults to `-` (hyphen). Set to `\"\"` to use no delimiter at all. | `string` | `null` | no |\n| \u003ca name=\"input_descriptor_formats\"\u003e\u003c/a\u003e [descriptor\\_formats](#input\\_descriptor\\_formats) | Describe additional descriptors to be output in the `descriptors` output map.\u003cbr\u003eMap of maps. Keys are names of descriptors. Values are maps of the form\u003cbr\u003e`{\u003cbr\u003e   format = string\u003cbr\u003e   labels = list(string)\u003cbr\u003e}`\u003cbr\u003e(Type is `any` so the map values can later be enhanced to provide additional options.)\u003cbr\u003e`format` is a Terraform format string to be passed to the `format()` function.\u003cbr\u003e`labels` is a list of labels, in order, to pass to `format()` function.\u003cbr\u003eLabel values will be normalized before being passed to `format()` so they will be\u003cbr\u003eidentical to how they appear in `id`.\u003cbr\u003eDefault is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |\n| \u003ca name=\"input_diagnostics_categories_flag_map\"\u003e\u003c/a\u003e [diagnostics\\_categories\\_flag\\_map](#input\\_diagnostics\\_categories\\_flag\\_map) | Map of Diagnostic categories. By default all of them are enabled. Ti disable particular category, add an entry with a `false` value | `map(bool)` | `{}` | no |\n| \u003ca name=\"input_diagnostics_log_analytics_workspace_id\"\u003e\u003c/a\u003e [diagnostics\\_log\\_analytics\\_workspace\\_id](#input\\_diagnostics\\_log\\_analytics\\_workspace\\_id) | Resource ID of the log analytics workspace. Used for diagnostics logs and metrics | `string` | `null` | no |\n| \u003ca name=\"input_enabled\"\u003e\u003c/a\u003e [enabled](#input\\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |\n| \u003ca name=\"input_environment\"\u003e\u003c/a\u003e [environment](#input\\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |\n| \u003ca name=\"input_id_length_limit\"\u003e\u003c/a\u003e [id\\_length\\_limit](#input\\_id\\_length\\_limit) | Limit `id` to this many characters (minimum 6).\u003cbr\u003eSet to `0` for unlimited length.\u003cbr\u003eSet to `null` for keep the existing setting, which defaults to `0`.\u003cbr\u003eDoes not affect `id_full`. | `number` | `null` | no |\n| \u003ca name=\"input_label_key_case\"\u003e\u003c/a\u003e [label\\_key\\_case](#input\\_label\\_key\\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.\u003cbr\u003eDoes not affect keys of tags passed in via the `tags` input.\u003cbr\u003ePossible values: `lower`, `title`, `upper`.\u003cbr\u003eDefault value: `title`. | `string` | `null` | no |\n| \u003ca name=\"input_label_order\"\u003e\u003c/a\u003e [label\\_order](#input\\_label\\_order) | The order in which the labels (ID elements) appear in the `id`.\u003cbr\u003eDefaults to [\"namespace\", \"environment\", \"stage\", \"name\", \"attributes\"].\u003cbr\u003eYou can omit any of the 6 labels (\"tenant\" is the 6th), but at least one must be present. | `list(string)` | `null` | no |\n| \u003ca name=\"input_label_value_case\"\u003e\u003c/a\u003e [label\\_value\\_case](#input\\_label\\_value\\_case) | Controls the letter case of ID elements (labels) as included in `id`,\u003cbr\u003eset as tag values, and output by this module individually.\u003cbr\u003eDoes not affect values of tags passed in via the `tags` input.\u003cbr\u003ePossible values: `lower`, `title`, `upper` and `none` (no transformation).\u003cbr\u003eSet this to `title` and set `delimiter` to `\"\"` to yield Pascal Case IDs.\u003cbr\u003eDefault value: `lower`. | `string` | `null` | no |\n| \u003ca name=\"input_labels_as_tags\"\u003e\u003c/a\u003e [labels\\_as\\_tags](#input\\_labels\\_as\\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.\u003cbr\u003eDefault is to include all labels.\u003cbr\u003eTags with empty values will not be included in the `tags` output.\u003cbr\u003eSet to `[]` to suppress all generated tags.\u003cbr\u003e**Notes:**\u003cbr\u003e  The value of the `name` tag, if included, will be the `id`, not the `name`.\u003cbr\u003e  Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be\u003cbr\u003e  changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | \u003cpre\u003e[\u003cbr\u003e  \"default\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_management_group_id\"\u003e\u003c/a\u003e [management\\_group\\_id](#input\\_management\\_group\\_id) | ID of the Management Group where subscription will be created | `string` | `null` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.\u003cbr\u003eThis is the only ID element not also included as a `tag`.\u003cbr\u003eThe \"name\" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |\n| \u003ca name=\"input_namespace\"\u003e\u003c/a\u003e [namespace](#input\\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |\n| \u003ca name=\"input_refresh_token\"\u003e\u003c/a\u003e [refresh\\_token](#input\\_refresh\\_token) | Indicates wherever the refresh token of service principal should be refreshed after the subscription is created. | `bool` | `true` | no |\n| \u003ca name=\"input_regex_replace_chars\"\u003e\u003c/a\u003e [regex\\_replace\\_chars](#input\\_regex\\_replace\\_chars) | Terraform regular expression (regex) string.\u003cbr\u003eCharacters matching the regex will be removed from the ID elements.\u003cbr\u003eIf not set, `\"/[^a-zA-Z0-9-]/\"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |\n| \u003ca name=\"input_stage\"\u003e\u003c/a\u003e [stage](#input\\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |\n| \u003ca name=\"input_subscription_id\"\u003e\u003c/a\u003e [subscription\\_id](#input\\_subscription\\_id) | If Provided, subscription will not be created but managed via Alias | `string` | `null` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).\u003cbr\u003eNeither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |\n| \u003ca name=\"input_tenant\"\u003e\u003c/a\u003e [tenant](#input\\_tenant) | ID element \\_(Rarely used, not included by default)\\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_this\"\u003e\u003c/a\u003e [this](#module\\_this) | cloudposse/label/null | 0.25.0 |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_alias_id\"\u003e\u003c/a\u003e [alias\\_id](#output\\_alias\\_id) | Alias ID of the subscription |\n| \u003ca name=\"output_subscription_id\"\u003e\u003c/a\u003e [subscription\\_id](#output\\_subscription\\_id) | ID of the subscription |\n| \u003ca name=\"output_subscription_id_after_refreshed_access_token\"\u003e\u003c/a\u003e [subscription\\_id\\_after\\_refreshed\\_access\\_token](#output\\_subscription\\_id\\_after\\_refreshed\\_access\\_token) | Subscription ID, which can be used after the running service principal refreshed its access token |\n| \u003ca name=\"output_subscription_name\"\u003e\u003c/a\u003e [subscription\\_name](#output\\_subscription\\_name) | Name of the subscription |\n| \u003ca name=\"output_subscription_resource_id\"\u003e\u003c/a\u003e [subscription\\_resource\\_id](#output\\_subscription\\_resource\\_id) | Resource ID of the subscription |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_azurerm\"\u003e\u003c/a\u003e [azurerm](#provider\\_azurerm) | \u003e= 3.0 |\n| \u003ca name=\"provider_null\"\u003e\u003c/a\u003e [null](#provider\\_null) | \u003e= 3.0 |\n| \u003ca name=\"provider_time\"\u003e\u003c/a\u003e [time](#provider\\_time) | 0.8.0 |\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.3.0 |\n| \u003ca name=\"requirement_azurerm\"\u003e\u003c/a\u003e [azurerm](#requirement\\_azurerm) | \u003e= 3.0 |\n| \u003ca name=\"requirement_null\"\u003e\u003c/a\u003e [null](#requirement\\_null) | \u003e= 3.0 |\n| \u003ca name=\"requirement_time\"\u003e\u003c/a\u003e [time](#requirement\\_time) | 0.8.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [azurerm_consumption_budget_subscription.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/consumption_budget_subscription) | resource |\n| [azurerm_management_group_subscription_association.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_group_subscription_association) | resource |\n| [azurerm_monitor_diagnostic_setting.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting) | resource |\n| [azurerm_subscription.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subscription) | resource |\n| [null_resource.refresh_access_token](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |\n| [time_static.consumption_budget_start_date](https://registry.terraform.io/providers/hashicorp/time/0.8.0/docs/resources/static) | resource |\n| [azurerm_billing_enrollment_account_scope.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/billing_enrollment_account_scope) | data source |\n\u003c!-- END_TF_DOCS --\u003e\n\n## CONTRIBUTING\n\nContributions are very welcomed!\n\nStart by reviewing [contribution guide](CONTRIBUTING.md) and our [code of conduct](CODE_OF_CONDUCT.md). After that, start coding and ship your changes by creating a new PR.\n\n## LICENSE\n\nApache 2 Licensed. See [LICENSE](LICENSE) for full details.\n\n## AUTHORS\n\n\u003c!--- Replace repository name --\u003e\n\u003ca href=\"https://github.com/getindata/terraform-azurerm-subscription/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=getindata/terraform-azurerm-subscription\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindata%2Fterraform-azurerm-subscription","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetindata%2Fterraform-azurerm-subscription","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindata%2Fterraform-azurerm-subscription/lists"}