-
Notifications
You must be signed in to change notification settings - Fork 17
/
r-rbac.tf
105 lines (79 loc) · 3.78 KB
/
r-rbac.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
# https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/storage
resource "azurerm_role_assignment" "sta_contributor" {
for_each = toset(var.rbac_storage_contributor_role_principal_ids)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Account Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_blob_owner" {
for_each = toset(var.rbac_storage_blob_role_principal_ids.owners)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Blob Data Owner"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_blob_contributor" {
for_each = toset(var.rbac_storage_blob_role_principal_ids.contributors)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Blob Data Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_blob_reader" {
for_each = toset(var.rbac_storage_blob_role_principal_ids.readers)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Blob Data Reader"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_file_priv_contributor" {
for_each = toset(var.rbac_storage_file_role_principal_ids.privileged_contributors)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage File Data Privileged Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_file_priv_reader" {
for_each = toset(var.rbac_storage_file_role_principal_ids.privileged_readers)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage File Data Privileged Reader"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_file_smb_owner" {
for_each = toset(var.rbac_storage_file_role_principal_ids.smb_owners)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage File Data SMB Share Elevated Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_file_smb_contributor" {
for_each = toset(var.rbac_storage_file_role_principal_ids.smb_contributors)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage File Data SMB Share Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_file_smb_reader" {
for_each = toset(var.rbac_storage_file_role_principal_ids.smb_readers)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage File Data SMB Share Reader"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_table_contributor" {
for_each = toset(var.rbac_storage_table_role_principal_ids.contributors)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Table Data Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_table_reader" {
for_each = toset(var.rbac_storage_table_role_principal_ids.readers)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Table Data Reader"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_queue_contributor" {
for_each = toset(var.rbac_storage_queue_contributor_role_principal_ids.contributors)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Queue Data Contributor"
principal_id = each.value
}
resource "azurerm_role_assignment" "sta_queue_reader" {
for_each = toset(var.rbac_storage_queue_contributor_role_principal_ids.readers)
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Queue Data Reader"
principal_id = each.value
}