/
pipeline_patch_manifest_stage_resource.go
106 lines (103 loc) · 2.45 KB
/
pipeline_patch_manifest_stage_resource.go
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
package provider
import (
"github.com/hashicorp/terraform/helper/schema"
)
func pipelinePatchManifestStageResource() *schema.Resource {
newPatchManifestStageInterface := func() stage {
return newPatchManifestStage()
}
return &schema.Resource{
Create: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageCreate(d, m, newPatchManifestStageInterface)
},
Read: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageRead(d, m, newPatchManifestStageInterface)
},
Update: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageUpdate(d, m, newPatchManifestStageInterface)
},
Delete: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageDelete(d, m, newPatchManifestStageInterface)
},
Importer: &schema.ResourceImporter{
State: resourcePipelineImporter,
},
Schema: stageResource(map[string]*schema.Schema{
"account": {
Type: schema.TypeString,
Description: "",
Required: true,
},
"app": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"cloud_provider": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"cluster": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"criteria": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"kind": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"location": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"manifest_name": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"mode": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
"options": {
Type: schema.TypeList,
Description: "",
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"merge_strategy": {
Type: schema.TypeString,
Required: true,
},
"record": {
Type: schema.TypeBool,
Optional: true,
},
},
},
},
"patch_body": {
Type: schema.TypeList,
Description: "",
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"source": {
Type: schema.TypeString,
Description: "",
Optional: true,
},
}),
}
}