@pulumi/harness 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +2 -2
  2. package/platform/delegatetoken.d.ts +44 -21
  3. package/platform/delegatetoken.js +23 -0
  4. package/platform/delegatetoken.js.map +1 -1
  5. package/platform/gcpConnector.d.ts +12 -0
  6. package/platform/gcpConnector.js +2 -0
  7. package/platform/gcpConnector.js.map +1 -1
  8. package/platform/getDelegatetoken.d.ts +69 -0
  9. package/platform/getDelegatetoken.js +6 -0
  10. package/platform/getDelegatetoken.js.map +1 -1
  11. package/platform/getGcpConnector.d.ts +4 -0
  12. package/platform/getGcpConnector.js.map +1 -1
  13. package/platform/getGitxWebhook.d.ts +100 -0
  14. package/platform/getGitxWebhook.js +30 -0
  15. package/platform/getGitxWebhook.js.map +1 -0
  16. package/platform/getOverrides.d.ts +42 -0
  17. package/platform/getOverrides.js +22 -0
  18. package/platform/getOverrides.js.map +1 -0
  19. package/platform/getPolicy.d.ts +4 -8
  20. package/platform/getPolicy.js +1 -4
  21. package/platform/getPolicy.js.map +1 -1
  22. package/platform/gitConnector.d.ts +12 -0
  23. package/platform/gitConnector.js +2 -0
  24. package/platform/gitConnector.js.map +1 -1
  25. package/platform/gitxWebhook.d.ts +179 -0
  26. package/platform/gitxWebhook.js +99 -0
  27. package/platform/gitxWebhook.js.map +1 -0
  28. package/platform/index.d.ts +12 -0
  29. package/platform/index.js +21 -5
  30. package/platform/index.js.map +1 -1
  31. package/platform/overrides.d.ts +182 -0
  32. package/platform/overrides.js +77 -0
  33. package/platform/overrides.js.map +1 -0
  34. package/platform/policy.d.ts +120 -0
  35. package/platform/policy.js +20 -0
  36. package/platform/policy.js.map +1 -1
  37. package/platform/template.d.ts +5 -1160
  38. package/platform/template.js +5 -1160
  39. package/platform/template.js.map +1 -1
  40. package/types/input.d.ts +112 -0
  41. package/types/output.d.ts +116 -0
@@ -8,1168 +8,13 @@ const utilities = require("../utilities");
8
8
  /**
9
9
  * Resource for creating a Template. Description field is deprecated
10
10
  *
11
- * ## Remote Pipeline template
11
+ * ## Import
12
12
  *
13
- * resource "harness.platform.Template" "pipelineTemplateRemote" {
14
- * identifier = "identifier"
15
- * orgId = harness_platform_project.test.org_id
16
- * projectId = harness_platform_project.test.id
17
- * name = "name"
18
- * comments = "comments"
19
- * version = "ab"
20
- * isStable = true
21
- * gitDetails {
22
- * branchName = "main"
23
- * commitMessage = "Commit"
24
- * filePath = "filePath"
25
- * connectorRef = "account.connector_ref"
26
- * storeType = "REMOTE"
27
- * repoName = "repoName"
28
- * }
29
- * templateYaml = <<-EOT
30
- * template:
31
- * name: "name"
32
- * identifier: "identifier"
33
- * versionLabel: "ab"
34
- * type: Pipeline
35
- * projectIdentifier: ${harness_platform_project.test.id}
36
- * orgIdentifier: ${harness_platform_project.test.org_id}
37
- * tags: {}
38
- * spec:
39
- * stages:
40
- * - stage:
41
- * identifier: dvvdvd
42
- * name: dvvdvd
43
- * description: ""
44
- * type: Deployment
45
- * spec:
46
- * deploymentType: Kubernetes
47
- * service:
48
- * serviceRef: <+input>
49
- * serviceInputs: <+input>
50
- * environment:
51
- * environmentRef: <+input>
52
- * deployToAll: false
53
- * environmentInputs: <+input>
54
- * serviceOverrideInputs: <+input>
55
- * infrastructureDefinitions: <+input>
56
- * execution:
57
- * steps:
58
- * - step:
59
- * name: Rollout Deployment
60
- * identifier: rolloutDeployment
61
- * type: K8sRollingDeploy
62
- * timeout: 10m
63
- * spec:
64
- * skipDryRun: false
65
- * pruningEnabled: false
66
- * rollbackSteps:
67
- * - step:
68
- * name: Rollback Rollout Deployment
69
- * identifier: rollbackRolloutDeployment
70
- * type: K8sRollingRollback
71
- * timeout: 10m
72
- * spec:
73
- * pruningEnabled: false
74
- * tags: {}
75
- * failureStrategies:
76
- * - onFailure:
77
- * errors:
78
- * - AllErrors
79
- * action:
80
- * type: StageRollback
13
+ * Import account level template
81
14
  *
82
- * EOT
83
- * }
84
- *
85
- * ## Remote Pipeline template to create new branch from existing base branch
86
- *
87
- * resource "harness.platform.Template" "pipelineTemplateRemote" {
88
- * identifier = "identifier"
89
- * orgId = harness_platform_project.test.org_id
90
- * projectId = harness_platform_project.test.id
91
- * name = "name"
92
- * comments = "comments"
93
- * version = "ab"
94
- * isStable = true
95
- * gitDetails {
96
- * branchName = "newBranch"
97
- * commitMessage = "Commit"
98
- * filePath = "filePath"
99
- * connectorRef = "account.connector_ref"
100
- * storeType = "REMOTE"
101
- * repoName = "repoName"
102
- * baseBranch = "main"
103
- * }
104
- * templateYaml = <<-EOT
105
- * template:
106
- * name: "name"
107
- * identifier: "identifier"
108
- * versionLabel: "ab"
109
- * type: Pipeline
110
- * projectIdentifier: ${harness_platform_project.test.id}
111
- * orgIdentifier: ${harness_platform_project.test.org_id}
112
- * tags: {}
113
- * spec:
114
- * stages:
115
- * - stage:
116
- * identifier: dvvdvd
117
- * name: dvvdvd
118
- * description: ""
119
- * type: Deployment
120
- * spec:
121
- * deploymentType: Kubernetes
122
- * service:
123
- * serviceRef: <+input>
124
- * serviceInputs: <+input>
125
- * environment:
126
- * environmentRef: <+input>
127
- * deployToAll: false
128
- * environmentInputs: <+input>
129
- * serviceOverrideInputs: <+input>
130
- * infrastructureDefinitions: <+input>
131
- * execution:
132
- * steps:
133
- * - step:
134
- * name: Rollout Deployment
135
- * identifier: rolloutDeployment
136
- * type: K8sRollingDeploy
137
- * timeout: 10m
138
- * spec:
139
- * skipDryRun: false
140
- * pruningEnabled: false
141
- * rollbackSteps:
142
- * - step:
143
- * name: Rollback Rollout Deployment
144
- * identifier: rollbackRolloutDeployment
145
- * type: K8sRollingRollback
146
- * timeout: 10m
147
- * spec:
148
- * pruningEnabled: false
149
- * tags: {}
150
- * failureStrategies:
151
- * - onFailure:
152
- * errors:
153
- * - AllErrors
154
- * action:
155
- * type: StageRollback
156
- *
157
- * EOT
158
- * }
159
- *
160
- * ## Inline Pipeline template
161
- *
162
- * resource "harness.platform.Template" "pipelineTemplateInline" {
163
- * identifier = "identifier"
164
- * orgId = harness_platform_project.test.org_id
165
- * projectId = harness_platform_project.test.id
166
- * name = "name"
167
- * comments = "comments"
168
- * version = "ab"
169
- * isStable = true
170
- * templateYaml = <<-EOT
171
- * template:
172
- * name: "name"
173
- * identifier: "identifier"
174
- * versionLabel: "ab"
175
- * type: Pipeline
176
- * projectIdentifier: ${harness_platform_project.test.id}
177
- * orgIdentifier: ${harness_platform_project.test.org_id}
178
- * tags: {}
179
- * spec:
180
- * stages:
181
- * - stage:
182
- * identifier: dvvdvd
183
- * name: dvvdvd
184
- * description: ""
185
- * type: Deployment
186
- * spec:
187
- * deploymentType: Kubernetes
188
- * service:
189
- * serviceRef: <+input>
190
- * serviceInputs: <+input>
191
- * environment:
192
- * environmentRef: <+input>
193
- * deployToAll: false
194
- * environmentInputs: <+input>
195
- * serviceOverrideInputs: <+input>
196
- * infrastructureDefinitions: <+input>
197
- * execution:
198
- * steps:
199
- * - step:
200
- * name: Rollout Deployment
201
- * identifier: rolloutDeployment
202
- * type: K8sRollingDeploy
203
- * timeout: 10m
204
- * spec:
205
- * skipDryRun: false
206
- * pruningEnabled: false
207
- * rollbackSteps:
208
- * - step:
209
- * name: Rollback Rollout Deployment
210
- * identifier: rollbackRolloutDeployment
211
- * type: K8sRollingRollback
212
- * timeout: 10m
213
- * spec:
214
- * pruningEnabled: false
215
- * tags: {}
216
- * failureStrategies:
217
- * - onFailure:
218
- * errors:
219
- * - AllErrors
220
- * action:
221
- * type: StageRollback
222
- *
223
- * EOT
224
- * }
225
- *
226
- * ## Inline Step template
227
- *
228
- * resource "harness.platform.Template" "stepTemplateInline" {
229
- * identifier = "identifier"
230
- * orgId = harness_platform_project.test.org_id
231
- * projectId = harness_platform_project.test.id
232
- * name = "name"
233
- * comments = "comments"
234
- * version = "ab"
235
- * isStable = true
236
- * templateYaml = <<-EOT
237
- * template:
238
- * name: "name"
239
- * identifier: "identifier"
240
- * versionLabel: "ab"
241
- * type: Step
242
- * projectIdentifier: ${harness_platform_project.test.id}
243
- * orgIdentifier: ${harness_platform_project.test.org_id}
244
- * tags: {}
245
- * spec:
246
- * timeout: 10m
247
- * type: ShellScript
248
- * spec:
249
- * shell: Bash
250
- * onDelegate: true
251
- * source:
252
- * type: Inline
253
- * spec:
254
- * script: <+input>
255
- * environmentVariables: []
256
- * outputVariables: []
257
- *
258
- * EOT
259
- * }
260
- *
261
- * ## Remote Step template
262
- *
263
- * resource "harness.platform.Template" "stepTemplateRemote" {
264
- * identifier = "identifier"
265
- * orgId = harness_platform_project.test.org_id
266
- * projectId = harness_platform_project.test.id
267
- * name = "name"
268
- * comments = "comments"
269
- * version = "ab"
270
- * isStable = true
271
- * gitDetails {
272
- * branchName = "main"
273
- * commitMessage = "Commit"
274
- * filePath = "filePath"
275
- * connectorRef = "account.connector_ref"
276
- * storeType = "REMOTE"
277
- * repoName = "repoName"
278
- * }
279
- * templateYaml = <<-EOT
280
- * template:
281
- * name: "name"
282
- * identifier: "identifier"
283
- * versionLabel: "ab"
284
- * type: Step
285
- * projectIdentifier: ${harness_platform_project.test.id}
286
- * orgIdentifier: ${harness_platform_project.test.org_id}
287
- * tags: {}
288
- * spec:
289
- * timeout: 10m
290
- * type: ShellScript
291
- * spec:
292
- * shell: Bash
293
- * onDelegate: true
294
- * source:
295
- * type: Inline
296
- * spec:
297
- * script: <+input>
298
- * environmentVariables: []
299
- * outputVariables: []
300
- *
301
- * EOT
302
- * }
303
- *
304
- * ## Remote Step template to create new branch from existing branch
305
- *
306
- * resource "harness.platform.Template" "stepTemplateRemote" {
307
- * identifier = "identifier"
308
- * orgId = harness_platform_project.test.org_id
309
- * projectId = harness_platform_project.test.id
310
- * name = "name"
311
- * comments = "comments"
312
- * version = "ab"
313
- * isStable = true
314
- * gitDetails {
315
- * branchName = "newBranch"
316
- * commitMessage = "Commit"
317
- * filePath = "filePath"
318
- * connectorRef = "account.connector_ref"
319
- * storeType = "REMOTE"
320
- * repoName = "repoName"
321
- * baseBranch = "main"
322
- * }
323
- * templateYaml = <<-EOT
324
- * template:
325
- * name: "name"
326
- * identifier: "identifier"
327
- * versionLabel: "ab"
328
- * type: Step
329
- * projectIdentifier: ${harness_platform_project.test.id}
330
- * orgIdentifier: ${harness_platform_project.test.org_id}
331
- * tags: {}
332
- * spec:
333
- * timeout: 10m
334
- * type: ShellScript
335
- * spec:
336
- * shell: Bash
337
- * onDelegate: true
338
- * source:
339
- * type: Inline
340
- * spec:
341
- * script: <+input>
342
- * environmentVariables: []
343
- * outputVariables: []
344
- *
345
- * EOT
346
- * }
347
- *
348
- * ## Inline Stage template
349
- *
350
- * resource "harness.platform.Template" "stageTemplateInline" {
351
- * identifier = "identifier"
352
- * orgId = harness_platform_project.test.org_id
353
- * projectId = harness_platform_project.test.id
354
- * name = "name"
355
- * comments = "comments"
356
- * version = "ab"
357
- * isStable = true
358
- * templateYaml = <<-EOT
359
- * template:
360
- * name: "name"
361
- * identifier: "identifier"
362
- * versionLabel: "ab"
363
- * type: Stage
364
- * projectIdentifier: ${harness_platform_project.test.id}
365
- * orgIdentifier: ${harness_platform_project.test.org_id}
366
- * tags: {}
367
- * spec:
368
- * type: Deployment
369
- * spec:
370
- * deploymentType: Kubernetes
371
- * service:
372
- * serviceRef: <+input>
373
- * serviceInputs: <+input>
374
- * environment:
375
- * environmentRef: <+input>
376
- * deployToAll: false
377
- * environmentInputs: <+input>
378
- * infrastructureDefinitions: <+input>
379
- * execution:
380
- * steps:
381
- * - step:
382
- * type: ShellScript
383
- * name: Shell Script_1
384
- * identifier: ShellScript_1
385
- * spec:
386
- * shell: Bash
387
- * onDelegate: true
388
- * source:
389
- * type: Inline
390
- * spec:
391
- * script: <+input>
392
- * environmentVariables: []
393
- * outputVariables: []
394
- * timeout: <+input>
395
- * rollbackSteps: []
396
- * failureStrategies:
397
- * - onFailure:
398
- * errors:
399
- * - AllErrors
400
- * action:
401
- * type: StageRollback
402
- *
403
- * EOT
404
- * }
405
- *
406
- * ## Remote Stage template
407
- *
408
- * resource "harness.platform.Template" "stageTemplateRemote" {
409
- * identifier = "identifier"
410
- * orgId = harness_platform_project.test.org_id
411
- * projectId = harness_platform_project.test.id
412
- * name = "name"
413
- * comments = "comments"
414
- * version = "ab"
415
- * isStable = true
416
- * gitDetails {
417
- * branchName = "main"
418
- * commitMessage = "Commit"
419
- * filePath = "filePath"
420
- * connectorRef = "account.connector_ref"
421
- * storeType = "REMOTE"
422
- * repoName = "repoName"
423
- * }
424
- * templateYaml = <<-EOT
425
- * template:
426
- * name: "name"
427
- * identifier: "identifier"
428
- * versionLabel: "ab"
429
- * type: Stage
430
- * projectIdentifier: ${harness_platform_project.test.id}
431
- * orgIdentifier: ${harness_platform_project.test.org_id}
432
- * tags: {}
433
- * spec:
434
- * type: Deployment
435
- * spec:
436
- * deploymentType: Kubernetes
437
- * service:
438
- * serviceRef: <+input>
439
- * serviceInputs: <+input>
440
- * environment:
441
- * environmentRef: <+input>
442
- * deployToAll: false
443
- * environmentInputs: <+input>
444
- * infrastructureDefinitions: <+input>
445
- * execution:
446
- * steps:
447
- * - step:
448
- * type: ShellScript
449
- * name: Shell Script_1
450
- * identifier: ShellScript_1
451
- * spec:
452
- * shell: Bash
453
- * onDelegate: true
454
- * source:
455
- * type: Inline
456
- * spec:
457
- * script: <+input>
458
- * environmentVariables: []
459
- * outputVariables: []
460
- * timeout: <+input>
461
- * rollbackSteps: []
462
- * failureStrategies:
463
- * - onFailure:
464
- * errors:
465
- * - AllErrors
466
- * action:
467
- * type: StageRollback
468
- *
469
- * EOT
470
- * }
471
- *
472
- * ## Remote Stage template to create new branch from existing branch
473
- *
474
- * resource "harness.platform.Template" "stageTemplateRemote" {
475
- * identifier = "identifier"
476
- * orgId = harness_platform_project.test.org_id
477
- * projectId = harness_platform_project.test.id
478
- * name = "name"
479
- * comments = "comments"
480
- * version = "ab"
481
- * isStable = true
482
- * gitDetails {
483
- * branchName = "newBranch"
484
- * commitMessage = "Commit"
485
- * filePath = "filePath"
486
- * connectorRef = "account.connector_ref"
487
- * storeType = "REMOTE"
488
- * repoName = "repoName"
489
- * baseBranch = "main"
490
- * }
491
- * templateYaml = <<-EOT
492
- * template:
493
- * name: "name"
494
- * identifier: "identifier"
495
- * versionLabel: "ab"
496
- * type: Stage
497
- * projectIdentifier: ${harness_platform_project.test.id}
498
- * orgIdentifier: ${harness_platform_project.test.org_id}
499
- * tags: {}
500
- * spec:
501
- * type: Deployment
502
- * spec:
503
- * deploymentType: Kubernetes
504
- * service:
505
- * serviceRef: <+input>
506
- * serviceInputs: <+input>
507
- * environment:
508
- * environmentRef: <+input>
509
- * deployToAll: false
510
- * environmentInputs: <+input>
511
- * infrastructureDefinitions: <+input>
512
- * execution:
513
- * steps:
514
- * - step:
515
- * type: ShellScript
516
- * name: Shell Script_1
517
- * identifier: ShellScript_1
518
- * spec:
519
- * shell: Bash
520
- * onDelegate: true
521
- * source:
522
- * type: Inline
523
- * spec:
524
- * script: <+input>
525
- * environmentVariables: []
526
- * outputVariables: []
527
- * timeout: <+input>
528
- * rollbackSteps: []
529
- * failureStrategies:
530
- * - onFailure:
531
- * errors:
532
- * - AllErrors
533
- * action:
534
- * type: StageRollback
535
- *
536
- * EOT
537
- * }
538
- *
539
- * ## Inline StepGroup template
540
- *
541
- * resource "harness.platform.Template" "stepgroupTemplateInline" {
542
- * identifier = "identifier"
543
- * orgId = harness_platform_project.test.org_id
544
- * projectId = harness_platform_project.test.id
545
- * name = "name"
546
- * comments = "comments"
547
- * version = "ab"
548
- * isStable = true
549
- * templateYaml = <<-EOT
550
- * template:
551
- * name: "name"
552
- * identifier: "identifier"
553
- * versionLabel: "ab"
554
- * type: StepGroup
555
- * projectIdentifier: ${harness_platform_project.test.id}
556
- * orgIdentifier: ${harness_platform_project.test.org_id}
557
- * tags: {}
558
- * spec:
559
- * stageType: Deployment
560
- * steps:
561
- * - step:
562
- * type: ShellScript
563
- * name: Shell Script_1
564
- * identifier: ShellScript_1
565
- * spec:
566
- * shell: Bash
567
- * onDelegate: true
568
- * source:
569
- * type: Inline
570
- * spec:
571
- * script: <+input>
572
- * environmentVariables: []
573
- * outputVariables: []
574
- * timeout: 10m
575
- *
576
- * EOT
577
- * }
578
- *
579
- * ## Remote StepGroup template
580
- *
581
- * resource "harness.platform.Template" "stepgroupTemplateRemote" {
582
- * identifier = "identifier"
583
- * orgId = harness_platform_project.test.org_id
584
- * projectId = harness_platform_project.test.id
585
- * name = "name"
586
- * comments = "comments"
587
- * version = "ab"
588
- * isStable = true
589
- * gitDetails {
590
- * branchName = "main"
591
- * commitMessage = "Commit"
592
- * filePath = "filePath"
593
- * connectorRef = "account.connector_ref"
594
- * storeType = "REMOTE"
595
- * repoName = "repoName"
596
- * }
597
- * templateYaml = <<-EOT
598
- * template:
599
- * name: "name"
600
- * identifier: "identifier"
601
- * versionLabel: "ab"
602
- * type: StepGroup
603
- * projectIdentifier: ${harness_platform_project.test.id}
604
- * orgIdentifier: ${harness_platform_project.test.org_id}
605
- * tags: {}
606
- * spec:
607
- * stageType: Deployment
608
- * steps:
609
- * - step:
610
- * type: ShellScript
611
- * name: Shell Script_1
612
- * identifier: ShellScript_1
613
- * spec:
614
- * shell: Bash
615
- * onDelegate: true
616
- * source:
617
- * type: Inline
618
- * spec:
619
- * script: <+input>
620
- * environmentVariables: []
621
- * outputVariables: []
622
- * timeout: 10m
623
- *
624
- * EOT
625
- * }
626
- *
627
- * ## Remote StepGroup template to create new branch from existing branch
628
- *
629
- * resource "harness.platform.Template" "stepgroupTemplateRemote" {
630
- * identifier = "identifier"
631
- * orgId = harness_platform_project.test.org_id
632
- * projectId = harness_platform_project.test.id
633
- * name = "name"
634
- * comments = "comments"
635
- * version = "ab"
636
- * isStable = true
637
- * gitDetails {
638
- * branchName = "newBranch"
639
- * commitMessage = "Commit"
640
- * filePath = "filePath"
641
- * connectorRef = "account.connector_ref"
642
- * storeType = "REMOTE"
643
- * repoName = "repoName"
644
- * baseBranch = "main"
645
- * }
646
- * templateYaml = <<-EOT
647
- * template:
648
- * name: "name"
649
- * identifier: "identifier"
650
- * versionLabel: "ab"
651
- * type: StepGroup
652
- * projectIdentifier: ${harness_platform_project.test.id}
653
- * orgIdentifier: ${harness_platform_project.test.org_id}
654
- * tags: {}
655
- * spec:
656
- * stageType: Deployment
657
- * steps:
658
- * - step:
659
- * type: ShellScript
660
- * name: Shell Script_1
661
- * identifier: ShellScript_1
662
- * spec:
663
- * shell: Bash
664
- * onDelegate: true
665
- * source:
666
- * type: Inline
667
- * spec:
668
- * script: <+input>
669
- * environmentVariables: []
670
- * outputVariables: []
671
- * timeout: 10m
672
- *
673
- * EOT
674
- * }
675
- *
676
- * ## Inline Monitered Service template
677
- *
678
- * resource "harness.platform.Template" "moniteredServiceTemplateInline" {
679
- * identifier = "identifier"
680
- * orgId = harness_platform_project.test.org_id
681
- * projectId = harness_platform_project.test.id
682
- * name = "name"
683
- * comments = "comments"
684
- * version = "ab"
685
- * isStable = true
686
- * templateYaml = <<-EOT
687
- * template:
688
- * name: "name"
689
- * identifier: "identifier"
690
- * versionLabel: "ab"
691
- * type: MonitoredService
692
- * projectIdentifier: ${harness_platform_project.test.id}
693
- * orgIdentifier: ${harness_platform_project.test.org_id}
694
- * tags: {}
695
- * spec:
696
- * serviceRef: <+input>
697
- * environmentRef: <+input>
698
- * type: Application
699
- * sources:
700
- * changeSources:
701
- * - name: Harness CD Next Gen
702
- * identifier: harnessCdNextGen
703
- * type: HarnessCDNextGen
704
- * enabled: true
705
- * category: Deployment
706
- * spec: {}
707
- * healthSources:
708
- * - name: health
709
- * identifier: health
710
- * type: AppDynamics
711
- * spec:
712
- * applicationName: <+input>
713
- * tierName: <+input>
714
- * metricData:
715
- * Errors: true
716
- * Performance: true
717
- * metricDefinitions: []
718
- * feature: Application Monitoring
719
- * connectorRef: <+input>
720
- * metricPacks:
721
- * - identifier: Errors
722
- * - identifier: Performance
723
- *
724
- * EOT
725
- * }
726
- *
727
- * ## Artifact Source template
728
- *
729
- * resource "harness.platform.Template" "artifactSourceTemplate" {
730
- * identifier = "identifier"
731
- * orgId = harness_platform_project.test.org_id
732
- * projectId = harness_platform_project.test.id
733
- * name = "name"
734
- * comments = "comments"
735
- * version = "ab"
736
- * isStable = true
737
- * templateYaml = <<-EOT
738
- * template:
739
- * name: "name"
740
- * identifier: "identifier"
741
- * versionLabel: "ab"
742
- * type: ArtifactSource
743
- * projectIdentifier: ${harness_platform_project.test.id}
744
- * orgIdentifier: ${harness_platform_project.test.org_id}
745
- * tags: {}
746
- * spec:
747
- * type: DockerRegistry
748
- * spec:
749
- * imagePath: library/nginx
750
- * tag: <+input>
751
- * connectorRef: account.Harness_DockerHub
752
- *
753
- * EOT
754
- * }
755
- *
756
- * ## Deployment template
757
- *
758
- * resource "harness.platform.Template" "deploymentTemplate" {
759
- * identifier = "identifier"
760
- * orgId = harness_platform_project.test.org_id
761
- * projectId = harness_platform_project.test.id
762
- * name = "name"
763
- * comments = "comments"
764
- * version = "ab"
765
- * isStable = true
766
- * templateYaml = <<-EOT
767
- * template:
768
- * name: "name"
769
- * identifier: "identifier"
770
- * versionLabel: "ab"
771
- * type: CustomDeployment
772
- * projectIdentifier: ${harness_platform_project.test.id}
773
- * orgIdentifier: ${harness_platform_project.test.org_id}
774
- * tags: {}
775
- * spec:
776
- * infrastructure:
777
- * variables:
778
- * - name: kubeConnector
779
- * type: Connector
780
- * value: <+input>
781
- * description: ""
782
- * fetchInstancesScript:
783
- * store:
784
- * type: Inline
785
- * spec:
786
- * content: |
787
- * #
788
- * # Script is expected to query Infrastructure and dump json
789
- * # in $INSTANCE_OUTPUT_PATH file path
790
- * #
791
- * # Harness is expected to initialize ${INSTANCE_OUTPUT_PATH}
792
- * # environment variable - a random unique file path on delegate,
793
- * # so script execution can save the result.
794
- * #
795
- * /opt/harness-delegate/client-tools/kubectl/v1.19.2/kubectl get pods --namespace=harness-delegate-ng -o json > $INSTANCE_OUTPUT_PATH
796
- * instanceAttributes:
797
- * - name: instancename
798
- * jsonPath: metadata.name
799
- * description: ""
800
- * instancesListPath: items
801
- * execution:
802
- * stepTemplateRefs: []
803
- *
804
- * EOT
805
- * }
806
- *
807
- * ## Secrets Manager template
808
- *
809
- * resource "harness.platform.Template" "secretsManagerTemplate" {
810
- * identifier = "identifier"
811
- * orgId = harness_platform_project.test.org_id
812
- * projectId = harness_platform_project.test.id
813
- * name = "name"
814
- * comments = "comments"
815
- * version = "ab"
816
- * isStable = true
817
- * templateYaml = <<-EOT
818
- * template:
819
- * name: "name"
820
- * identifier: "identifier"
821
- * versionLabel: "ab"
822
- * type: SecretManager
823
- * projectIdentifier: ${harness_platform_project.test.id}
824
- * orgIdentifier: ${harness_platform_project.test.org_id}
825
- * tags: {}
826
- * spec:
827
- * executionTarget: {}
828
- * shell: Bash
829
- * onDelegate: true
830
- * source:
831
- * spec:
832
- * script: |-
833
- * curl -o secret.json -X GET https://example.com/<+secretManager.environmentVariables.enginename>/<+secretManager.environmentVariables.path> -H 'X-Vault-Token: <+secrets.getValue("vaultTokenOne")>'
834
- * secret=$(jq -r '.data."<+secretManager.environmentVariables.key>"' secret.json)
835
- * type: Inline
836
- * environmentVariables:
837
- * - name: enginename
838
- * type: String
839
- * value: <+input>
840
- * - name: path
841
- * type: String
842
- * value: <+input>
843
- * - name: key
844
- * type: String
845
- * value: <+input>
846
- *
847
- * EOT
848
- * }
849
- *
850
- * ### Creating Multiple Versions of a Template
851
- * ##Stable version of the Template
852
- * resource "harness.platform.Template" "templateV1" {
853
- * identifier = "temp"
854
- * orgId = harness_platform_project.test.org_id
855
- * name = "temp"
856
- * comments = "comments"
857
- * version = "v1"
858
- * isStable = true
859
- * forceDelete = true
860
- * templateYaml = <<-EOT
861
- * template:
862
- * name: "temp"
863
- * identifier: "temp"
864
- * versionLabel: v1
865
- * type: Pipeline
866
- * orgIdentifier: ${harness_platform_organization.test.id}
867
- * tags: {}
868
- * spec:
869
- * stages:
870
- * - stage:
871
- * name: dvvdvd
872
- * identifier: dvvdvd
873
- * description: ""
874
- * type: Deployment
875
- * spec:
876
- * deploymentType: Kubernetes
877
- * service:
878
- * serviceRef: <+input>
879
- * serviceInputs: <+input>
880
- * environment:
881
- * environmentRef: <+input>
882
- * deployToAll: false
883
- * environmentInputs: <+input>
884
- * serviceOverrideInputs: <+input>
885
- * infrastructureDefinitions: <+input>
886
- * execution:
887
- * steps:
888
- * - step:
889
- * name: Rollout Deployment
890
- * identifier: rolloutDeployment
891
- * type: K8sRollingDeploy
892
- * timeout: 10m
893
- * spec:
894
- * skipDryRun: false
895
- * pruningEnabled: false
896
- * rollbackSteps:
897
- * - step:
898
- * name: Rollback Rollout Deployment
899
- * identifier: rollbackRolloutDeployment
900
- * type: K8sRollingRollback
901
- * timeout: 10m
902
- * spec:
903
- * pruningEnabled: false
904
- * tags: {}
905
- * failureStrategies:
906
- * - onFailure:
907
- * errors:
908
- * - AllErrors
909
- * action:
910
- * type: StageRollback
911
- *
912
- * EOT
913
- * }
914
- *
915
- * ##Unstable version of the Template
916
- * resource "harness.platform.Template" "templateV2" {
917
- * identifier = "temp"
918
- * orgId = harness_platform_organization.test.id
919
- * name = "temp"
920
- * comments = "comments"
921
- * version = "v2"
922
- * isStable = false
923
- * forceDelete = true
924
- * templateYaml = <<-EOT
925
- * template:
926
- * name: "temp"
927
- * identifier: "temp"
928
- * versionLabel: v2
929
- * type: Pipeline
930
- * orgIdentifier: ${harness_platform_organization.test.id}
931
- * tags: {}
932
- * spec:
933
- * stages:
934
- * - stage:
935
- * name: dvvdvd
936
- * identifier: dvvdvd
937
- * description: ""
938
- * type: Deployment
939
- * spec:
940
- * deploymentType: Kubernetes
941
- * service:
942
- * serviceRef: <+input>
943
- * serviceInputs: <+input>
944
- * environment:
945
- * environmentRef: <+input>
946
- * deployToAll: false
947
- * environmentInputs: <+input>
948
- * serviceOverrideInputs: <+input>
949
- * infrastructureDefinitions: <+input>
950
- * execution:
951
- * steps:
952
- * - step:
953
- * name: Rollout Deployment
954
- * identifier: rolloutDeployment
955
- * type: K8sRollingDeploy
956
- * timeout: 10m
957
- * spec:
958
- * skipDryRun: false
959
- * pruningEnabled: false
960
- * rollbackSteps:
961
- * - step:
962
- * name: Rollback Rollout Deployment
963
- * identifier: rollbackRolloutDeployment
964
- * type: K8sRollingRollback
965
- * timeout: 10m
966
- * spec:
967
- * pruningEnabled: false
968
- * tags: {}
969
- * failureStrategies:
970
- * - onFailure:
971
- * errors:
972
- * - AllErrors
973
- * action:
974
- * type: StageRollback
975
- * EOT
976
- * }
977
- *
978
- * ##Updating the Stable Version of the Template from v1 to v2.
979
- * resource "harness.platform.Template" "templateV2" {
980
- * identifier = "temp"
981
- * orgId = harness_platform_organization.test.id
982
- * name = "temp"
983
- * comments = "comments"
984
- * version = "v2"
985
- * isStable = true
986
- * forceDelete = true
987
- * templateYaml = <<-EOT
988
- * template:
989
- * name: "temp"
990
- * identifier: "temp"
991
- * versionLabel: v2
992
- * type: Pipeline
993
- * orgIdentifier: ${harness_platform_organization.test.id}
994
- * tags: {}
995
- * spec:
996
- * stages:
997
- * - stage:
998
- * name: dvvdvd
999
- * identifier: dvvdvd
1000
- * description: ""
1001
- * type: Deployment
1002
- * spec:
1003
- * deploymentType: Kubernetes
1004
- * service:
1005
- * serviceRef: <+input>
1006
- * serviceInputs: <+input>
1007
- * environment:
1008
- * environmentRef: <+input>
1009
- * deployToAll: false
1010
- * environmentInputs: <+input>
1011
- * serviceOverrideInputs: <+input>
1012
- * infrastructureDefinitions: <+input>
1013
- * execution:
1014
- * steps:
1015
- * - step:
1016
- * name: Rollout Deployment
1017
- * identifier: rolloutDeployment
1018
- * type: K8sRollingDeploy
1019
- * timeout: 10m
1020
- * spec:
1021
- * skipDryRun: false
1022
- * pruningEnabled: false
1023
- * rollbackSteps:
1024
- * - step:
1025
- * name: Rollback Rollout Deployment
1026
- * identifier: rollbackRolloutDeployment
1027
- * type: K8sRollingRollback
1028
- * timeout: 10m
1029
- * spec:
1030
- * pruningEnabled: false
1031
- * tags: {}
1032
- * failureStrategies:
1033
- * - onFailure:
1034
- * errors:
1035
- * - AllErrors
1036
- * action:
1037
- * type: StageRollback
1038
- * EOT
1039
- * }
1040
- *
1041
- * resource "harness.platform.Template" "templateV1" {
1042
- * identifier = "temp"
1043
- * orgId = harness_platform_organization.test.id
1044
- * name = "temp"
1045
- * comments = "comments"
1046
- * version = "v1"
1047
- * isStable = false
1048
- * forceDelete = true
1049
- * templateYaml = <<-EOT
1050
- * template:
1051
- * name: "temp"
1052
- * identifier: "temp"
1053
- * versionLabel: v1
1054
- * type: Pipeline
1055
- * orgIdentifier: ${harness_platform_organization.test.id}
1056
- * tags: {}
1057
- * spec:
1058
- * stages:
1059
- * - stage:
1060
- * name: dvvdvd
1061
- * identifier: dvvdvd
1062
- * description: ""
1063
- * type: Deployment
1064
- * spec:
1065
- * deploymentType: Kubernetes
1066
- * service:
1067
- * serviceRef: <+input>
1068
- * serviceInputs: <+input>
1069
- * environment:
1070
- * environmentRef: <+input>
1071
- * deployToAll: false
1072
- * environmentInputs: <+input>
1073
- * serviceOverrideInputs: <+input>
1074
- * infrastructureDefinitions: <+input>
1075
- * execution:
1076
- * steps:
1077
- * - step:
1078
- * name: Rollout Deployment
1079
- * identifier: rolloutDeployment
1080
- * type: K8sRollingDeploy
1081
- * timeout: 10m
1082
- * spec:
1083
- * skipDryRun: false
1084
- * pruningEnabled: false
1085
- * rollbackSteps:
1086
- * - step:
1087
- * name: Rollback Rollout Deployment
1088
- * identifier: rollbackRolloutDeployment
1089
- * type: K8sRollingRollback
1090
- * timeout: 10m
1091
- * spec:
1092
- * pruningEnabled: false
1093
- * tags: {}
1094
- * failureStrategies:
1095
- * - onFailure:
1096
- * errors:
1097
- * - AllErrors
1098
- * action:
1099
- * type: StageRollback
1100
- *
1101
- * EOT
1102
- *
1103
- * dependsOn = [time_sleep.wait_10_seconds]
1104
- * }
1105
- *
1106
- * resource "timeSleep" "wait10Seconds" {
1107
- * dependsOn = [harness_platform_template.test2]
1108
- * destroyDuration = "10s"
1109
- * }
1110
- *
1111
- * ##Importing Account Level Templates
1112
- * resource "harness.platform.Template" "test" {
1113
- * identifier = "accounttemplate"
1114
- * name = "accounttemplate"
1115
- * version = "v2"
1116
- * isStable = false
1117
- * importFromGit = true
1118
- * gitImportDetails {
1119
- * branchName = "main"
1120
- * filePath = ".harness/accounttemplate.yaml"
1121
- * connectorRef = "account.DoNotDeleteGithub"
1122
- * repoName = "open-repo"
1123
- * }
1124
- * templateImportRequest {
1125
- * templateName = "accounttemplate"
1126
- * templateVersion = "v2"
1127
- * templateDescription = ""
1128
- * }
1129
- * }
1130
- *
1131
- * ##Importing Org Level Templates
1132
- * resource "harness.platform.Template" "test" {
1133
- * identifier = "orgtemplate"
1134
- * name = "orgtemplate"
1135
- * orgId = "org"
1136
- * version = "v2"
1137
- * isStable = false
1138
- * importFromGit = true
1139
- * gitImportDetails {
1140
- * branchName = "main"
1141
- * filePath = ".harness/orgtemplate.yaml"
1142
- * connectorRef = "account.DoNotDeleteGithub"
1143
- * repoName = "open-repo"
1144
- * }
1145
- * templateImportRequest {
1146
- * templateName = "orgtemplate"
1147
- * templateVersion = "v2"
1148
- * templateDescription = ""
1149
- * }
1150
- * }
1151
- *
1152
- * ##Importing Project Level Templates
1153
- * resource "harness.platform.Template" "test" {
1154
- * identifier = "projecttemplate"
1155
- * name = "projecttemplate"
1156
- * orgId = "org"
1157
- * projectId = "project"
1158
- * version = "v2"
1159
- * isStable = false
1160
- * importFromGit = true
1161
- * gitImportDetails {
1162
- * branchName = "main"
1163
- * filePath = ".harness/projecttemplate.yaml"
1164
- * connectorRef = "account.DoNotDeleteGithub"
1165
- * repoName = "open-repo"
1166
- * }
1167
- * templateImportRequest {
1168
- * templateName = "projecttemplate"
1169
- * templateVersion = "v2"
1170
- * templateDescription = ""
1171
- * }
1172
- * }
15
+ * ```sh
16
+ * $ pulumi import harness:platform/template:Template example <template_id>
17
+ * ```
1173
18
  *
1174
19
  * Import org level template
1175
20
  *