-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathterraform.tf
63 lines (52 loc) · 1.74 KB
/
terraform.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Configure Terraform to set the required AzureRM provider
# version and features{} block.
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.58.0" #UPDATE THE PROVIDER VERSION TO LATEST. CHECK HERE FOR LATEST VERSION https://registry.terraform.io/providers/hashicorp/azurerm/latest
configuration_aliases = [
azurerm.connectivity,
azurerm.management,
azurerm.identity,
]
}
}
}
provider "azurerm" {
features {}
}
# Declare an aliased provider block using your preferred configuration.
# This will be used for the deployment of all "Connectivity resources" to the specified `subscription_id`.
provider "azurerm" {
alias = "connectivity"
subscription_id = var.subscription_id_connectivity
features {}
}
# Declare a standard provider block using your preferred configuration.
# This will be used for the deployment of all "Management resources" to the specified `subscription_id`.
provider "azurerm" {
alias = "management"
subscription_id = var.subscription_id_management
features {}
}
provider "azurerm" {
alias = "identity"
subscription_id = var.subscription_id_identity
features {}
}
data "azurerm_client_config" "core" {
provider = azurerm
}
# Obtain client configuration from the "management" provider
data "azurerm_client_config" "management" {
provider = azurerm.management
}
# Obtain client configuration from the "connectivity" provider
data "azurerm_client_config" "connectivity" {
provider = azurerm.connectivity
}
# Obtain client configuration from the "connectivity" provider
data "azurerm_client_config" "identity" {
provider = azurerm.identity
}