@pulumi/harness 0.2.1 → 0.2.2-alpha.1723460743

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