Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 5659b72

Browse files
committed
refactor: moved schema definition for project deployment target trigger resources
1 parent 1106a48 commit 5659b72

File tree

2 files changed

+47
-39
lines changed

2 files changed

+47
-39
lines changed

octopusdeploy/resource_project_deployment_target_trigger.go

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,8 @@ func resourceProjectDeploymentTargetTrigger() *schema.Resource {
1616
DeleteContext: resourceProjectDeploymentTargetTriggerDelete,
1717
Importer: getImporter(),
1818
ReadContext: resourceProjectDeploymentTargetTriggerRead,
19+
Schema: getProjectDeploymentTargetTriggerSchema(),
1920
UpdateContext: resourceProjectDeploymentTargetTriggerUpdate,
20-
21-
Schema: map[string]*schema.Schema{
22-
"name": getNameSchema(true),
23-
"project_id": {
24-
Description: "The ID of the project to attach the trigger.",
25-
Required: true,
26-
Type: schema.TypeString,
27-
},
28-
"should_redeploy": {
29-
Default: false,
30-
Description: "Enable to re-deploy to the deployment targets even if they are already up-to-date with the current deployment.",
31-
Optional: true,
32-
Type: schema.TypeBool,
33-
},
34-
"event_groups": {
35-
Description: "Apply event group filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
36-
Elem: &schema.Schema{Type: schema.TypeString},
37-
Optional: true,
38-
Type: schema.TypeList,
39-
},
40-
"event_categories": {
41-
Description: "Apply event category filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
42-
Elem: &schema.Schema{Type: schema.TypeString},
43-
Optional: true,
44-
Type: schema.TypeList,
45-
},
46-
"roles": {
47-
Description: "Apply event role filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
48-
Elem: &schema.Schema{Type: schema.TypeString},
49-
Optional: true,
50-
Type: schema.TypeList,
51-
},
52-
"environment_ids": {
53-
Description: "Apply environment id filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
54-
Elem: &schema.Schema{Type: schema.TypeString},
55-
Optional: true,
56-
Type: schema.TypeList,
57-
},
58-
},
5921
}
6022
}
6123

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package octopusdeploy
2+
3+
import (
4+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
5+
)
6+
7+
func getProjectDeploymentTargetTriggerSchema() map[string]*schema.Schema {
8+
return map[string]*schema.Schema{
9+
"name": getNameSchema(true),
10+
"project_id": {
11+
Description: "The ID of the project to attach the trigger.",
12+
Required: true,
13+
Type: schema.TypeString,
14+
},
15+
"should_redeploy": {
16+
Default: false,
17+
Description: "Enable to re-deploy to the deployment targets even if they are already up-to-date with the current deployment.",
18+
Optional: true,
19+
Type: schema.TypeBool,
20+
},
21+
"event_groups": {
22+
Description: "Apply event group filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
23+
Elem: &schema.Schema{Type: schema.TypeString},
24+
Optional: true,
25+
Type: schema.TypeList,
26+
},
27+
"event_categories": {
28+
Description: "Apply event category filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
29+
Elem: &schema.Schema{Type: schema.TypeString},
30+
Optional: true,
31+
Type: schema.TypeList,
32+
},
33+
"roles": {
34+
Description: "Apply event role filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
35+
Elem: &schema.Schema{Type: schema.TypeString},
36+
Optional: true,
37+
Type: schema.TypeList,
38+
},
39+
"environment_ids": {
40+
Description: "Apply environment id filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.",
41+
Elem: &schema.Schema{Type: schema.TypeString},
42+
Optional: true,
43+
Type: schema.TypeList,
44+
},
45+
}
46+
}

0 commit comments

Comments
 (0)