Skip to content

Commit 502cc37

Browse files
DEV-74058_Azure_ARM_deployment: DEV-74058:Initial commit
1 parent 8b89e94 commit 502cc37

9 files changed

+10964
-0
lines changed

arm-template-deployment/ARMTemplateExport.json

+9,928
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resource_group_region": {
6+
"type": "String",
7+
"metadata": "Please select the region which has the lm resources deployed i.e the resource group and resources"
8+
},
9+
"LM_Company_name": {
10+
"type": "String"
11+
}
12+
},
13+
"variables": {
14+
"deploymentResourceGroupName": "[concat('lm-logs-',parameters('LM_Company_name'),'-', replace(parameters('resource_group_region'),' ',''), '-group')]",
15+
"identityDeploymentName": "deployment-assets-except-role-assignment",
16+
"managedIdentityName": "[concat('msi-', variables('deploymentResourceGroupName'), '-deploy')]",
17+
"managedIdentityId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.ManagedIdentity/userAssignedIdentities/', variables('managedIdentityName'))]",
18+
"bootstrapRoleAssignmentId": "[guid(subscription().id, variables('userAccessAdministratorRoleDefinitionId'),variables('managedIdentityId'))]",
19+
"contributorRoleAssignmentId": "[guid(subscription().id, variables('contributorRoleDefinitionId'),variables('managedIdentityId'))]",
20+
"userAccessAdministratorRoleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9')]",
21+
"contributorRoleDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]"
22+
},
23+
"resources": [
24+
{
25+
"type": "Microsoft.Resources/deployments",
26+
"apiVersion": "2019-10-01",
27+
"name": "[variables('identityDeploymentName')]",
28+
"properties": {
29+
"mode": "Incremental",
30+
"expressionEvaluationOptions": {
31+
"scope": "inner"
32+
},
33+
"parameters": {
34+
"location": {
35+
"value": "[parameters('resource_group_region')]"
36+
},
37+
"managedIdentityName": {
38+
"value": "[variables('managedIdentityName')]"
39+
}
40+
},
41+
"template": {
42+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
43+
"contentVersion": "1.0.0.0",
44+
"parameters": {
45+
"location": {
46+
"type": "string"
47+
},
48+
"managedIdentityName": {
49+
"type": "string"
50+
}
51+
},
52+
"variables": {},
53+
"resources": [
54+
{
55+
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
56+
"name": "[parameters('managedIdentityName')]",
57+
"apiVersion": "2018-11-30",
58+
"location": "[parameters('location')]"
59+
}
60+
],
61+
"outputs": {
62+
"principalId": {
63+
"type": "string",
64+
"value": "[reference(parameters('managedIdentityName')).principalId]"
65+
}
66+
}
67+
}
68+
},
69+
"resourceGroup": "[variables('deploymentResourceGroupName')]"
70+
},
71+
{
72+
"type": "Microsoft.Authorization/roleAssignments",
73+
"apiVersion": "2020-04-01-preview",
74+
"name": "[variables('bootstrapRoleAssignmentId')]",
75+
"dependsOn": [
76+
"[variables('identityDeploymentName')]"
77+
],
78+
"properties": {
79+
"roleDefinitionId": "[variables('userAccessAdministratorRoleDefinitionId')]",
80+
"principalId": "[reference(variables('identityDeploymentName')).outputs.principalId.value]",
81+
"principalType": "ServicePrincipal",
82+
"scope": "[subscription().id]"
83+
}
84+
},
85+
{
86+
"type": "Microsoft.Authorization/roleAssignments",
87+
"apiVersion": "2020-04-01-preview",
88+
"name": "[variables('contributorRoleAssignmentId')]",
89+
"dependsOn": [
90+
"[variables('identityDeploymentName')]",
91+
"[resourceId('Microsoft.Authorization/roleAssignments/', variables('bootstrapRoleAssignmentId'))]"
92+
],
93+
"properties": {
94+
"roleDefinitionId": "[variables('contributorRoleDefinitionId')]",
95+
"principalId": "[reference(variables('identityDeploymentName')).outputs.principalId.value]",
96+
"principalType": "ServicePrincipal",
97+
"scope": "[subscription().id]"
98+
}
99+
}
100+
]
101+
}
+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"resource_group_region": {
6+
"type": "String"
7+
},
8+
"LM_Company_name": {
9+
"type": "String"
10+
},
11+
"LM_Access_Id": {
12+
"type": "String"
13+
},
14+
"LM_Access_Key": {
15+
"type": "String"
16+
},
17+
"enableActivityLogs": {
18+
"type": "String",
19+
"allowedValues": [
20+
"Yes",
21+
"No"
22+
],
23+
"metadata": {
24+
"description": "Enable Activity logs to be sent to the event hub that will get created in this deployment itself"
25+
},
26+
"defaultValue": "Yes"
27+
}
28+
},
29+
"variables": {
30+
"templateBaseUri": "https://raw.githubusercontent.com/logicmonitor/lm-logs-azure/master/arm-template-deployment/",
31+
"deploymentResourceGroupName": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''),'-group')]",
32+
"eventhubNamespace": "[concat('lm-logs','-',parameters('LM_Company_name'), '-', replace(parameters('resource_group_region'),' ',''))]",
33+
"eventhubLogsName": "log-hub",
34+
"subscriptionId": "[subscription().subscriptionId]",
35+
"eventHubAuthorizationRuleId": "[concat('/subscriptions/', variables('subscriptionId'), '/resourceGroups/', variables('deploymentResourceGroupName'), '/providers/Microsoft.EventHub/namespaces/', variables('eventhubNamespace'), '/authorizationRules/RootManageSharedAccessKey')]"
36+
},
37+
"resources": [
38+
{
39+
"type": "Microsoft.Resources/resourceGroups",
40+
"apiVersion": "2018-05-01",
41+
"location": "[parameters('resource_group_region')]",
42+
"name": "[variables('deploymentResourceGroupName')]",
43+
"properties": {}
44+
},
45+
{
46+
"apiVersion": "2017-05-10",
47+
"name": "linkedTemplatedeployment",
48+
"type": "Microsoft.Resources/deployments",
49+
"resourceGroup": "[variables('deploymentResourceGroupName')]",
50+
"comments": "Deploy resources within the group",
51+
"properties": {
52+
"mode": "Incremental",
53+
"templateLink": {
54+
"uri": "[concat(variables('templateBaseUri'), 'deployResourcesInRG.json')]",
55+
"contentVersion": "1.0.0.0"
56+
},
57+
"parameters": {
58+
"azure_region": {
59+
"value": "[parameters('resource_group_region')]"
60+
},
61+
"LM_Company_name": {
62+
"value": "[parameters('LM_Company_name')]"
63+
},
64+
"LM_Access_Id": {
65+
"value": "[parameters('LM_Access_Id')]"
66+
},
67+
"LM_Access_Key": {
68+
"value": "[parameters('LM_Access_Key')]"
69+
}
70+
}
71+
},
72+
"dependsOn": [
73+
"[resourceId('Microsoft.Resources/resourceGroups/', variables('deploymentResourceGroupName'))]"
74+
]
75+
},
76+
{
77+
"condition": "[equals(parameters('enableActivityLogs'), 'Yes')]",
78+
"type": "Microsoft.Insights/diagnosticSettings",
79+
"apiVersion": "2017-05-01-preview",
80+
"name": "[variables('deploymentResourceGroupName')]",
81+
"properties": {
82+
"eventHubAuthorizationRuleId": "[variables('eventHubAuthorizationRuleId')]",
83+
"eventHubName": "[variables('eventhubLogsName')]",
84+
"logs": [
85+
{
86+
"category": "Administrative",
87+
"enabled": true
88+
},
89+
{
90+
"category": "Security",
91+
"enabled": true
92+
},
93+
{
94+
"category": "ServiceHealth",
95+
"enabled": true
96+
},
97+
{
98+
"category": "Alert",
99+
"enabled": true
100+
},
101+
{
102+
"category": "Recommendation",
103+
"enabled": true
104+
},
105+
{
106+
"category": "Policy",
107+
"enabled": true
108+
},
109+
{
110+
"category": "Autoscale",
111+
"enabled": true
112+
},
113+
{
114+
"category": "ResourceHealth",
115+
"enabled": true
116+
}
117+
]
118+
},
119+
"dependsOn": [
120+
"[resourceId('Microsoft.Resources/resourceGroups/', variables('deploymentResourceGroupName'))]",
121+
"linkedTemplatedeployment"
122+
]
123+
}
124+
],
125+
"outputs": {}
126+
}

0 commit comments

Comments
 (0)