Skip to content

Commit

Permalink
feat: Added IAM/RBAC to OperationalInsights Workspace (LAW) Table (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr and eriqua authored Jan 8, 2024
1 parent 6ff20c9 commit 1f8757e
Show file tree
Hide file tree
Showing 9 changed files with 788 additions and 24 deletions.
242 changes: 242 additions & 0 deletions avm/res/operational-insights/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,23 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
{
name: 'CustomTableBasic_CL'
retentionInDays: 60
roleAssignments: [
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
schema: {
columns: [
{
Expand All @@ -259,6 +276,23 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
}
{
name: 'CustomTableAdvanced_CL'
roleAssignments: [
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
schema: {
columns: [
{
Expand Down Expand Up @@ -531,6 +565,23 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
{
"name": "CustomTableBasic_CL",
"retentionInDays": 60,
"roleAssignments": [
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Owner"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "<roleDefinitionIdOrName>"
}
],
"schema": {
"columns": [
{
Expand All @@ -548,6 +599,23 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
},
{
"name": "CustomTableAdvanced_CL",
"roleAssignments": [
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Owner"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "<roleDefinitionIdOrName>"
}
],
"schema": {
"columns": [
{
Expand Down Expand Up @@ -841,6 +909,92 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
]
}
]
tables: [
{
name: 'CustomTableBasic_CL'
retentionInDays: 60
roleAssignments: [
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
schema: {
columns: [
{
name: 'TimeGenerated'
type: 'DateTime'
}
{
name: 'RawData'
type: 'String'
}
]
name: 'CustomTableBasic_CL'
}
totalRetentionInDays: 90
}
{
name: 'CustomTableAdvanced_CL'
roleAssignments: [
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
schema: {
columns: [
{
name: 'TimeGenerated'
type: 'DateTime'
}
{
name: 'EventTime'
type: 'DateTime'
}
{
name: 'EventLevel'
type: 'String'
}
{
name: 'EventCode'
type: 'Int'
}
{
name: 'Message'
type: 'String'
}
{
name: 'RawData'
type: 'String'
}
]
name: 'CustomTableAdvanced_CL'
}
}
]
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Expand Down Expand Up @@ -1076,6 +1230,94 @@ module workspace 'br/public:avm/res/operational-insights/workspace:<version>' =
}
]
},
"tables": {
"value": [
{
"name": "CustomTableBasic_CL",
"retentionInDays": 60,
"roleAssignments": [
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Owner"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "<roleDefinitionIdOrName>"
}
],
"schema": {
"columns": [
{
"name": "TimeGenerated",
"type": "DateTime"
},
{
"name": "RawData",
"type": "String"
}
],
"name": "CustomTableBasic_CL"
},
"totalRetentionInDays": 90
},
{
"name": "CustomTableAdvanced_CL",
"roleAssignments": [
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Owner"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "<roleDefinitionIdOrName>"
}
],
"schema": {
"columns": [
{
"name": "TimeGenerated",
"type": "DateTime"
},
{
"name": "EventTime",
"type": "DateTime"
},
{
"name": "EventLevel",
"type": "String"
},
{
"name": "EventCode",
"type": "Int"
},
{
"name": "Message",
"type": "String"
},
{
"name": "RawData",
"type": "String"
}
],
"name": "CustomTableAdvanced_CL"
}
}
]
},
"tags": {
"value": {
"Environment": "Non-Prod",
Expand Down
13 changes: 7 additions & 6 deletions avm/res/operational-insights/workspace/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,13 @@ module logAnalyticsWorkspace_tables 'table/main.bicep' = [for (table, index) in
params: {
workspaceName: logAnalyticsWorkspace.name
name: table.name
plan: contains(table, 'plan') ? table.plan : 'Analytics'
schema: contains(table, 'schema') ? table.schema : {}
retentionInDays: contains(table, 'retentionInDays') ? table.retentionInDays : -1
totalRetentionInDays: contains(table, 'totalRetentionInDays') ? table.totalRetentionInDays : -1
restoredLogs: contains(table, 'restoredLogs') ? table.restoredLogs : {}
searchResults: contains(table, 'searchResults') ? table.searchResults : {}
plan: table.?plan
schema: table.?schema
retentionInDays: table.?retentionInDays
totalRetentionInDays: table.?totalRetentionInDays
restoredLogs: table.?restoredLogs
searchResults: table.?searchResults
roleAssignments: table.?roleAssignments
}
}]

Expand Down
Loading

0 comments on commit 1f8757e

Please sign in to comment.