-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
55 lines (44 loc) · 1.26 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
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.56.0"
}
}
}
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
data "azuread_client_config" "current" {}
### Group ###
resource "azurerm_resource_group" "default" {
name = "rgmydatalake"
location = "eastus"
}
### Data Lake ###
resource "azurerm_storage_account" "lake" {
name = "dlsmydatalake789"
resource_group_name = azurerm_resource_group.default.name
location = azurerm_resource_group.default.location
account_tier = "Standard"
account_replication_type = "LRS"
account_kind = "StorageV2"
// Enable this for Gen2 Hierarchy
is_hns_enabled = true
}
resource "azurerm_role_assignment" "adlsv2" {
scope = azurerm_storage_account.lake.id
role_definition_name = "Storage Blob Data Contributor"
principal_id = data.azuread_client_config.current.object_id
}
resource "azurerm_storage_data_lake_gen2_filesystem" "default" {
name = "myfilesystem001"
storage_account_id = azurerm_storage_account.lake.id
depends_on = [
azurerm_role_assignment.adlsv2
]
}