-
Notifications
You must be signed in to change notification settings - Fork 3
/
provider.tf
40 lines (33 loc) · 954 Bytes
/
provider.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
terraform {
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "~>2.53"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~>4.9.0"
}
}
}
#
# provider configuration
#
data "azuread_client_config" "current" {}
data "azurerm_client_config" "current" {}
locals {
subscription_id = var.subscription_id == null || var.subscription_id == "" ? data.azurerm_client_config.current.subscription_id : var.subscription_id
}
provider "azurerm" {
environment = var.environment
subscription_id = var.subscription_id # we cannot use a local here due to import cycle; a null value uses the client config
tenant_id = var.tenant_id # we cannot use a local here due to import cycle; a null value uses the client config
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
provider "azuread" {
environment = var.environment
}