generated from ljtill/bicep-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
region.resources.bicep
82 lines (65 loc) · 1.92 KB
/
region.resources.bicep
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
// -------
// Imports
// -------
import * as functions from '../functions/main.bicep'
import * as types from '../types/main.bicep'
// ------
// Scopes
// ------
targetScope = 'resourceGroup'
// ---------
// Resources
// ---------
// Role Assignments
resource assignments 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for (principalId, index) in principalIds: {
name: guid(principalId, 'ApplicationGatewayForContainersConfigurationManager', '${index}')
scope: controller
properties: {
principalId: principalId
roleDefinitionId: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'fbc52c3f-28ad-4303-a892-8a056630b8f1'
)
principalType: 'ServicePrincipal'
}
}
]
// Traffic Controller (AGC)
resource controller 'Microsoft.ServiceNetworking/trafficControllers@2023-11-01' = {
name: functions.getName(metadata.project, 'region', metadata.location, 'trafficController', null)
location: metadata.location
properties: {}
tags: tags
}
// Frontend
resource frontend 'Microsoft.ServiceNetworking/trafficControllers/frontends@2023-11-01' = {
name: functions.getName(metadata.project, 'region', metadata.location, 'frontend', null)
parent: controller
location: metadata.location
properties: {}
}
// Associations
// - Issue: Multiple assocations are not supported by the Microsoft.ServiceNetworking RP.
resource associations 'Microsoft.ServiceNetworking/trafficControllers/associations@2023-11-01' = {
name: functions.getName(metadata.project, 'stamp', metadata.location, 'assocation', null)
parent: controller
location: metadata.location
properties: {
associationType: 'subnets'
subnet: {
id: subnetIds[0]
}
}
}
// ----------
// Parameters
// ----------
param metadata types.metadata
param tags object
param principalIds array
param subnetIds array
// -------
// Outputs
// -------
output domain string = frontend.properties.fqdn