-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueprint_schema.json
512 lines (512 loc) · 18.6 KB
/
blueprint_schema.json
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
{
"$schema": "https://json-schema.org/draft-04/schema",
"title": "Schematics_Blueprint_v1",
"id$": "Schematics_Blueprint_v1",
"properties": {
"name": {
"type": "string",
"description": "Name of blueprint template for identification purposes. \n Blueprint docs: https://cloud.ibm.com/docs/schematics?topic=schematics-blueprint-templates"
},
"schema_version": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"description": "Version of blueprint template schema in SemVer format"
},
"type": {
"type": "string",
"enum": [
"blueprint"
],
"description": "Identifier for the schema type. Set to 'blueprint'"
},
"description": {
"type": "string",
"description": "User description of the blueprint template"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"description": "Tags to be attached to provisioned resources. An array of comma separated strings"
},
"inputs": {
"items": {
"$ref": "#/$defs/Input"
},
"type": "array",
"description": "Template inputs that must be specified. \n https://cloud.ibm.com/docs/schematics?topic=schematics-bp-template-schema-yaml#bp-inputs"
},
"settings": {
"items": {
"$ref": "#/$defs/Setting"
},
"type": "array",
"description": "Settings to be applied to all modules in the template \n Spec: https://cloud.ibm.com/docs/schematics?topic=schematics-bp-template-schema-yaml#bp-settings"
},
"outputs": {
"items": {
"$ref": "#/$defs/Output"
},
"type": "array",
"description": "Outputs that will be returned by Blueprints. \n Spec:https://cloud.ibm.com/docs/schematics?topic=schematics-bp-template-schema-yaml#bp-outputs"
},
"modules": {
"items": {
"$ref": "#/$defs/Module"
},
"type": "array",
"description": "List of blueprint module definitions \n Using modules docs: https://cloud.ibm.com/docs/schematics?topic=schematics-blueprint-terraform \n Spec: https://cloud.ibm.com/docs/schematics?topic=schematics-bp-template-schema-yaml#bp-modules-schema"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"type",
"schema_version",
"description",
"inputs",
"modules"
],
"$defs": {
"Source": {
"properties": {
"source_type": {
"enum": [
"github",
"catalog",
"gitlab"
],
"description": "Source library, one of catalog, gitlab or github. Followed by 'git' or 'catalog' key fields. \n Follow with the git keyword for Git repos that require a git_url. \n Follow with catalog keyword to define catalog specification. "
},
"git": {
"$ref": "#/$defs/Git",
"description": "Git source definition. Mutually exclusive with the catalog definition."
},
"catalog": {
"$ref": "#/$defs/Catalog",
"description": "Catalog source definition. Mutually exclusive with the git definition."
}
},
"additionalProperties": false,
"required": [
"source_type"
]
},
"Catalog": {
"properties": {
"catalog_name": {
"type": "string"
},
"offering_name": {
"type": "string"
},
"offering_version": {
"type": "string"
},
"offering_kind": {
"type": "string"
},
"catalog_id": {
"type": "string"
},
"offering_id": {
"type": "string"
},
"offering_version_id": {
"type": "string"
},
"offering_repo_url": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"catalog_name"
]
},
"ModuleInput": {
"properties": {
"name": {
"type": "string",
"description": "Name of variable to be passed to terraform. Must match a variable name in the modules' Terraform config"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
],
"pattern": "^((\\$(((module)\\.[A-Za-z\\d_-]+\\.(outputs))|(blueprint))\\.[A-Za-z\\d_-]+$)|([^\\$].*)|(^$))",
"description": "Input value, sourced from the template inputs as $blueprint.<input_name>, another module as $module.<module_name>.outputs.<output_name>, or a specified value in HCL format."
},
"type": {
"type": "string",
"pattern": "^(string)|(number)|(bool)|(list)|(map)",
"description": "Any valid HCL type, as a single or multi-line string. YAML multi-line entry supported using literal (pipe) or folded (>) formatting "
},
"description": {
"type": "string"
},
"sensitive": {
"type": "boolean"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"value"
]
},
"ModuleOutput": {
"properties": {
"name": {
"type": "string",
"description": "Named output of Terraform module"
},
"description": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name"
]
},
"ModuleSetting": {
"properties": {
"name": {
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"value"
]
},
"Git": {
"properties": {
"git_repo_url": {
"type": "string",
"pattern": "(\\w+://)(.+@)*([\\w\\d\\.]+)/*(.*)",
"description": "URL of the Git repo containing the Terraform module"
},
"git_token": {
"type": "string"
},
"git_release": {
"type": "string",
"description": "Release in SemVer format. Mutually exclusive with git_branch. Omit to get latest release",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
},
"git_branch": {
"type": "string",
"description": "Git branch for module source. Mutually exclusive with git_release. Omit to get latest release"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"git_repo_url"
],
"anyOf": [
{
"oneOf": [
{
"required": [
"git_release"
]
},
{
"required": [
"git_branch"
]
}
]
},
{
"not": {
"anyOf": [
{
"required": [
"git_release"
]
},
{
"required": [
"git_branch"
]
}
]
}
}
]
},
"Input": {
"properties": {
"name": {
"type": "string",
"description": "Input to the template. Specify the value keyword to define a constant to be used as the input. Omit the value keyword to source the value from the user inputs"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "If specified, contains a value to define a constant to be used as the input. Omit the value keyword to source from user inputs",
"pattern": "([^\\$].*)"
},
"type": {
"type": "string",
"pattern": "^(string)|(number)|(bool)|(list)|(map)|(null)",
"description": "Any valid HCL type, as a single or multi-line string. YAML multi-line entry is supported using literal (pipe) or folded (>) formatting "
},
"description": {
"type": "string"
},
"sensitive": {
"type": "boolean",
"enum": [
true,
false
],
"description": "Sensitive input value that should be masked in any output."
},
"immutable": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"default": {
"type": "boolean"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name"
]
},
"Module": {
"properties": {
"name": {
"type": "string",
"description": "Identifier for module used within the template to create references. "
},
"module_type": {
"type": "string",
"enum": [
"terraform"
],
"description": "Type of automation code. Only terraform is supported at present"
},
"source": {
"$ref": "#/$defs/Source",
"description": "Source repository definition for automation module. Followed by 'source_type'"
},
"tags": {
"type": "string",
"description": "User tags to be applied to resources provisioned by the module"
},
"injectors": {
"items": {
"$ref": "#/$defs/Injector"
},
"type": "array",
"description": "Inject Terraform provider definition for non-root modules \n Spec: https://cloud.ibm.com/docs/schematics?topic=schematics-bp-template-schema-yaml#bp-modules-injector \n Docs: https://cloud.ibm.com/docs/schematics?topic=schematics-blueprint-terraform#bp-provider-injection"
},
"inputs": {
"items": {
"$ref": "#/$defs/ModuleInput"
},
"type": "array",
"description": "List of inputs to be passed to the Terraform module, as name/value pairs"
},
"settings": {
"items": {
"$ref": "#/$defs/ModuleSetting"
},
"type": "array",
"description": "List of settings to be applied to this module, e.g TF_VERSION. See documentation for a list of supported options"
},
"outputs": {
"items": {
"$ref": "#/$defs/ModuleOutput"
},
"type": "array",
"description": "Named outputs returned by the Terraform module"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"module_type",
"name",
"source",
"inputs"
]
},
"Output": {
"properties": {
"name": {
"type": "string",
"description": "Name of output to return"
},
"value": {
"type": "string",
"pattern": "^(\\$module)\\.[A-za-z0-9]*\\.(outputs)\\.[A-za-z0-9]*.$",
"description": "Reference to the named output of a module in the format \n \"$module.<module_name>.outputs.<output_name>\""
},
"description": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"value"
]
},
"Setting": {
"properties": {
"name": {
"type": "string",
"description": "See documentation for a list of supported settings"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"value"
]
},
"Injector": {
"properties": {
"tft_git_url": {
"type": "string",
"pattern": "(\\w+://)(.+@)*([\\w\\d\\.]+)/*(.*)",
"description": "Git repo containing injection template files. \n Normally https://github.com/Cloud-Schematics/tf-templates"
},
"tft_git_token": {
"type": "string"
},
"tft_prefix": {
"type": "string"
},
"injection_type": {
"type": "string",
"enum": [
"override",
"inject"
],
"description": "Injector type, one of inject or override"
},
"tft_name": {
"type": "string",
"enum": [
"ibm",
"kubernetes"
],
"description": "Injector template name, one of ibm or kubernetes"
},
"tft_parameters": {
"items": {
"$ref": "#/$defs/TFTParameter"
},
"type": "array",
"description": "Input parameters to configure the injector template. See template repo for details"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"tft_git_url",
"injection_type",
"tft_name",
"tft_parameters"
]
},
"TFTParameter": {
"properties": {
"name": {
"type": "string",
"description": "Name value pair. Only static values allowed, defined as strings"
},
"value": {
"oneOf": [
{
"type": "string"
}
],
"description": "Only static values allowed, defined as a string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"value"
]
}
}
}