-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
108 lines (90 loc) · 3.48 KB
/
main.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
terraform {
required_version = ">= 0.11.11"
backend "azurerm" {
}
}
provider "azurerm" {
version = "=1.21.0"
}
resource "random_integer" "ri" {
min = 10000
max = 99999
}
resource "azurerm_resource_group" "test" {
name = "${var.AZURE_RESOURCE_GROUP_NAME}"
location = "${var.AZURE_DC_LOCATION}"
}
resource "azurerm_eventhub_namespace" "test" {
name = "${var.AZURE_EVENTHUB_NAMESPACE}${random_integer.ri.result}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "${var.AZURE_EVENTHUB_SKU}"
capacity = "${var.AZURE_EVENTHUB_CAPACITY}"
kafka_enabled = "${var.AZURE_EVENTHUB_KAFKA_ENABLED}"
tags {
environment = "${var.AZURE_ENVIRONMENT_TAG}"
}
}
resource "azurerm_eventhub" "test" {
name = "${var.AZURE_EVENTHUB_HUBNAME}${random_integer.ri.result}"
namespace_name = "${azurerm_eventhub_namespace.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
partition_count = "${var.AZURE_EVENTHUB_PARTITION_COUNT}"
message_retention = "${var.AZURE_EVENTHUB_MESSAGE_RETENTION}"
}
data "azurerm_data_lake_store" "test" {
name = "${var.AZURE_DATA_LAKE_STORE_NAME}${random_integer.ri.result}"
resource_group_name = "${azurerm_resource_group.test.name}"
}
resource "azurerm_cosmosdb_account" "db" {
name = "${var.COSMOSDB_NAME}${random_integer.ri.result}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
offer_type = "${var.COSMOSDB_OFFER}"
kind = "${var.COSMOSDB_KIND}"
enable_automatic_failover = true
consistency_policy {
consistency_level = "${var.COSMOSDB_CONSISTENCY_LEVEL}"
}
geo_location {
location = "${azurerm_resource_group.test.location}"
failover_priority = 0
}
geo_location {
location = "${var.COSMOSDB_FAILOVER_LOCATION}"
failover_priority = 1
}
}
resource "azurerm_storage_account" "test" {
name = "${var.AZURE_FUNCTIONAPP_NAME}${random_integer.ri.result}stor"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_app_service_plan" "test" {
name = "${var.AZURE_FUNCTIONAPP_NAME}${random_integer.ri.result}plan"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
kind = "FunctionApp"
sku {
tier = "Dynamic"
size = "Y1"
}
}
resource "azurerm_function_app" "test" {
name = "${var.AZURE_FUNCTIONAPP_NAME}${random_integer.ri.result}"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}"
}
resource "azurerm_databricks_workspace" "test" {
name = "databrickstest${random_integer.ri.result}"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
sku = "standard"
tags {
environment = "${var.AZURE_ENVIRONMENT_TAG}"
}
}