-
Notifications
You must be signed in to change notification settings - Fork 92
/
schema_datasource.go
111 lines (108 loc) · 3.36 KB
/
schema_datasource.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
107
108
109
110
111
package firewall
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
var dataSourceRuleSchema = map[string]*schema.Schema{
"label": {
Type: schema.TypeString,
Description: `Used to identify this rule. For display purposes only.`,
Computed: true,
},
"action": {
Type: schema.TypeString,
Description: "Controls whether traffic is accepted or dropped by this rule. Overrides the Firewall’s " +
"inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule.",
Computed: true,
},
"ports": {
Type: schema.TypeString,
Description: `A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91").`,
Computed: true,
},
"protocol": {
Type: schema.TypeString,
Description: "The network protocol this rule controls.",
Computed: true,
},
"ipv4": {
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "A list of IP addresses, CIDR blocks, or 0.0.0.0/0 (to allow all) this rule applies to.",
Computed: true,
},
"ipv6": {
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "A list of IPv6 addresses or networks this rule applies to.",
Computed: true,
},
}
var dataSourceSchema = map[string]*schema.Schema{
"id": {
Type: schema.TypeInt,
Description: "The unique ID assigned to this Firewall.",
Required: true,
},
"label": {
Type: schema.TypeString,
Description: "The label for the Firewall. For display purposes only. If no label is provided, a " +
"default will be assigned.",
Computed: true,
},
"tags": {
Type: schema.TypeSet,
Description: "An array of tags applied to this object. Tags are for organizational purposes only.",
Elem: &schema.Schema{Type: schema.TypeString},
Computed: true,
Set: schema.HashString,
},
"disabled": {
Type: schema.TypeBool,
Description: "If true, the Firewall is inactive.",
Computed: true,
},
"inbound": {
Type: schema.TypeList,
Elem: dataSourceFirewallRules(),
Description: "A firewall rule that specifies what inbound network traffic is allowed.",
Computed: true,
},
"inbound_policy": {
Type: schema.TypeString,
Description: "The default behavior for inbound traffic. This setting can be overridden by updating " +
"the inbound.action property for an individual Firewall Rule.",
Computed: true,
},
"outbound": {
Type: schema.TypeList,
Elem: dataSourceFirewallRules(),
Description: "A firewall rule that specifies what outbound network traffic is allowed.",
Computed: true,
},
"outbound_policy": {
Type: schema.TypeString,
Description: "The default behavior for outbound traffic. This setting can be overridden by updating " +
"the outbound.action property for an individual Firewall Rule.",
Computed: true,
},
"linodes": {
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeInt},
Description: "The IDs of Linodes to apply this firewall to.",
Computed: true,
Set: schema.HashInt,
},
"devices": {
Type: schema.TypeList,
Elem: resourceFirewallDevice(),
Description: "The devices associated with this firewall.",
Computed: true,
},
"status": {
Type: schema.TypeString,
Description: "The status of the firewall.",
Computed: true,
},
}