-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag.bicep
More file actions
178 lines (145 loc) · 4.8 KB
/
tag.bicep
File metadata and controls
178 lines (145 loc) · 4.8 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import * as _tagType from 'private/types/tag.bicep'
import * as _tagVar from 'private/variables/tag.bicep'
import * as _tagFunction from 'private/functions/tag.bicep'
/* ----------------------------------------
🤠 Bicep# - Public variables 🤠
------------------------------------------- */
@description('''
Criticality. An individual value matches the `criticality` type.
''')
@export()
var criticalities = _tagVar.criticalities
@description('''
Environment. An individual value matches the `env` type.
''')
@export()
var envs = _tagVar.envs
@export()
@description('''
Production status, in production or not'. An individual value matches the `productionstatus` type.
''')
var productionStatuses = _tagVar.productionStatuses
/* ----------------------------------------
😎 Bicep# - Public types 😎
------------------------------------------- */
@description('''
Tag collection.
''')
@export()
type collection = _tagType.collection
@description('''
Tag collection for common enterprise values. Use `createEnterpriseCollection()` in order to initialize an object.
''')
@export()
type collectionEnterprise = _tagType.collectionEnterprise
@description('''
Tag collection for common DevOps Services values. Use `createDevOpsServicesCollection()` in order to initialize an object.
''')
@export()
type collectionDevOpsServices = _tagType.collectionDevOpsServices
@description('''
Tag collection for common ServiceNow values. Use `createServiceNowCollection()` in order to initialize an object.
''')
@export()
type collectionServiceNow = _tagType.collectionServiceNow
@export()
@description('''
Hyperlink to a valid ServiceNow CI.
''')
type cmdbLink = _tagType.cmdbLink
@export()
@description('''
Link of a valid ServiceNow CI id.
''')
type cmdbId = _tagType.cmdbId
@export()
@description('Valid contact.')
type contact = _tagType.contact
@export()
@description('Valid costcenter, all digits.')
type costcenter = _tagType.costcenter
@export()
@description('Criticality. Low, Medium or High.')
type criticality = _tagType.criticality
@export()
@description('Environment')
type env = _tagType.env
@export()
@description('Production status, in production or not.')
type productionStatus = _tagType.productionStatus
@export()
@description('Valid project activity code, all digits.')
type projectActivity = _tagType.projectActivity
@export()
@description('Valid project code, all digits.')
type projectCode = _tagType.projectCode
@export()
@description('Valid security contact.')
type securityContact = _tagType.securityContact
@export()
@description('Azure DevOps team name.')
type adoTeam = _tagType.adoTeam
@export()
@description('''
Azure DevOps project name. Please use `readEnvironmentVariable(_devOpsServices.variables.systemteamProject, 'unknown')` in a bicepparam file to fill this value.
''')
type adoProject = _tagType.adoProject
@export()
@description('''
Azure DevOps pipeline. Please use `readEnvironmentVariable(_devOpsServices.variables.buildDefinitionName, 'unknown')` in a bicepparam file to fill this value.
''')
type adoPipeline = _tagType.adoPipeline
@export()
@description('''
Azure DevOps repository name or ServiceNow CMDB business application name.
In case of the Azure DevOps repository name, please use `readEnvironmentVariable(_devOpsServices.variables.buildRepositoryName, 'unknown')` in a bicepparam file to fill this value.
''')
type application = _tagType.application
/* ----------------------------------------
💪 Bicep# - Public functions 💪
------------------------------------------- */
@description('''
Creates a tag collection with common properties for enterprises.
''')
@export()
func createEnterpriseCollection(
contact contact,
securityContact securityContact,
costcenter costcenter,
criticality criticality,
productionStatus productionStatus,
projectActivity projectActivity,
projectCode projectCode
) collectionEnterprise => {
contact: contact
securitycontact: securityContact
costcenter: costcenter
criticality: criticality
productionstatus: productionStatus
projectactivity: projectActivity
projectcode: projectCode
}
@description('''
Creates a tag collection with common properties for DevOps Services.
''')
@export()
func createDevOpsServicesCollection(
adoTeam adoTeam,
adoProject adoProject,
adoPipeline adoPipeline,
application application
) collectionDevOpsServices => {
ado_team: adoTeam
ado_project: adoProject
ado_pipeline: adoPipeline
application: application
}
@description('''
Creates a tag collection with common properties for ServiceNow.
Note: For the cmdblink tag, it will use the cmdbId function parameter and convert it to the correct cmdblink.
''')
@export()
func createServiceNowCollection(cmdbId cmdbId, serviceNowInstanceName string) collectionServiceNow => {
cmdbLink: _tagFunction.buildCmdblink(cmdbId, serviceNowInstanceName)
cmdbId: cmdbId
}