File tree 6 files changed +464
-0
lines changed
examples/resources/terrakube_webhook
6 files changed +464
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ # generated by https://github.com/hashicorp/terraform-plugin-docs
3
+ page_title : " terrakube_webhook Resource - terrakube"
4
+ subcategory : " "
5
+ description : |-
6
+
7
+ ---
8
+
9
+ # terrakube_webhook (Resource)
10
+
11
+
12
+
13
+ ## Example Usage
14
+
15
+ ``` terraform
16
+ resource "terrakube_webhook" "webhook" {
17
+ organization_id = data.terrakube_organization.org.id
18
+ path = ["/terraform/.*.tf"]
19
+ branch = ["feat", "fix"]
20
+ template_id = data.terrakube_template.template.id
21
+ workspace_id = data.terrakube_workspace_vcs.workspace.id
22
+ }
23
+ ```
24
+
25
+ <!-- schema generated by tfplugindocs -->
26
+ ## Schema
27
+
28
+ ### Required
29
+
30
+ - ` organization_id ` (String) Terrakube organization id
31
+ - ` workspace_id ` (String) Terrakube workspace id
32
+
33
+ ### Optional
34
+
35
+ - ` branch ` (List of String) A list of branches that trigger a run.
36
+ - ` event ` (String) The event type that triggers a run, currently only ` PUSH ` is supported.
37
+ - ` path ` (List of String) The file paths in regex that trigger a run.
38
+ - ` remote_hook_id ` (String) The remote hook ID.
39
+ - ` template_id ` (String) The template id to use for the run.
40
+
41
+ ### Read-Only
42
+
43
+ - ` id ` (String) Webhook ID
44
+
45
+ ## Import
46
+
47
+ Import is supported using the following syntax:
48
+
49
+ ``` shell
50
+ # Webhook can be import with organization_id,workspace_id,id
51
+ terraform import terrakube_webhook.example 00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000
52
+ ```
Original file line number Diff line number Diff line change
1
+ # Webhook can be import with organization_id,workspace_id,id
2
+ terraform import terrakube_webhook.example 00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000
Original file line number Diff line number Diff line change
1
+ resource "terrakube_webhook" "webhook" {
2
+ organization_id = data. terrakube_organization . org . id
3
+ path = [" /terraform/.*.tf" ]
4
+ branch = [" feat" , " fix" ]
5
+ template_id = data. terrakube_template . template . id
6
+ workspace_id = data. terrakube_workspace_vcs . workspace . id
7
+ }
Original file line number Diff line number Diff line change @@ -112,3 +112,12 @@ type ModuleEntity struct {
112
112
Vcs * VcsEntity `jsonapi:"relation,vcs,omitempty"`
113
113
Ssh * SshEntity `jsonapi:"relation,ssh,omitempty"`
114
114
}
115
+
116
+ type WebhookEntity struct {
117
+ ID string `jsonapi:"primary,webhook"`
118
+ Path string `jsonapi:"attr,path"`
119
+ Branch string `jsonapi:"attr,branch"`
120
+ TemplateId string `jsonapi:"attr,templateId"`
121
+ RemoteHookdId string `jsonapi:"attr,remoteHookId"`
122
+ Event string `jsonapi:"attr,event"`
123
+ }
Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ func (p *TerrakubeProvider) Resources(ctx context.Context) []func() resource.Res
180
180
NewWorkspaceTagResource ,
181
181
NewWorkspaceVariableResource ,
182
182
NewWorkspaceVcsResource ,
183
+ NewWebhookResource ,
183
184
NewVcsResource ,
184
185
}
185
186
}
You can’t perform that action at this time.
0 commit comments