Skip to content

Commit 78d7430

Browse files
committed
docs: add support for description in lb schema
1 parent 91449ab commit 78d7430

File tree

8 files changed

+311
-198
lines changed

8 files changed

+311
-198
lines changed

internal/services/lb/acls_data_source.go

Lines changed: 63 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,93 +27,112 @@ func DataSourceACLs() *schema.Resource {
2727
Description: "ACLs with a name like it are listed.",
2828
},
2929
"acls": {
30-
Type: schema.TypeList,
31-
Computed: true,
30+
Type: schema.TypeList,
31+
Computed: true,
32+
Description: "ACLs that are listed.",
3233
Elem: &schema.Resource{
3334
Schema: map[string]*schema.Schema{
3435
"id": {
35-
Computed: true,
36-
Type: schema.TypeString,
36+
Computed: true,
37+
Description: "UUID of the ACL.",
38+
Type: schema.TypeString,
3739
},
3840
"name": {
39-
Computed: true,
40-
Type: schema.TypeString,
41+
Computed: true,
42+
Description: "Name of the ACL.",
43+
Type: schema.TypeString,
4144
},
4245
"frontend_id": {
43-
Computed: true,
44-
Type: schema.TypeString,
46+
Computed: true,
47+
Description: "ID of the frontend to use for the ACL.",
48+
Type: schema.TypeString,
4549
},
4650
"index": {
47-
Computed: true,
48-
Type: schema.TypeInt,
51+
Computed: true,
52+
Description: "Priority of this ACL (ACLs are applied in ascending order, 0 is the first ACL executed).",
53+
Type: schema.TypeInt,
4954
},
5055
"description": {
51-
Computed: true,
52-
Type: schema.TypeString,
56+
Computed: true,
57+
Description: "ACL description.",
58+
Type: schema.TypeString,
5359
},
5460
"match": {
55-
Type: schema.TypeList,
56-
Computed: true,
61+
Type: schema.TypeList,
62+
Description: "ACL Match configuration.",
63+
Computed: true,
5764
Elem: &schema.Resource{
5865
Schema: map[string]*schema.Schema{
5966
"ip_subnet": {
60-
Computed: true,
61-
Type: schema.TypeList,
67+
Computed: true,
68+
Description: "List of IPs or CIDR v4/v6 addresses to filter for from the client side.",
69+
Type: schema.TypeList,
6270
Elem: &schema.Schema{
6371
Type: schema.TypeString,
6472
},
6573
},
6674
"http_filter": {
67-
Type: schema.TypeString,
68-
Computed: true,
75+
Type: schema.TypeString,
76+
Description: "type of HTTP filter to match. Extracts the request's URL path, which starts at the first slash and ends before the question mark (without the host part). Defines where to filter for the http_filter_value. Only supported for HTTP backends.",
77+
Computed: true,
6978
},
7079
"http_filter_value": {
71-
Computed: true,
72-
Type: schema.TypeList,
80+
Computed: true,
81+
Description: "List of values to filter for",
82+
Type: schema.TypeList,
7383
Elem: &schema.Schema{
7484
Type: schema.TypeString,
7585
},
7686
},
7787
"http_filter_option": {
78-
Type: schema.TypeString,
79-
Computed: true,
88+
Type: schema.TypeString,
89+
Description: "Name of the HTTP header to filter on if `http_header_match` was selected in `http_filter`.",
90+
Computed: true,
8091
},
8192
"invert": {
82-
Computed: true,
83-
Type: schema.TypeBool,
93+
Computed: true,
94+
Description: "Defines whether to invert the match condition. If set to `true`, the ACL carries out its action when the condition DOES NOT match",
95+
Type: schema.TypeBool,
8496
},
8597
"ips_edge_services": {
86-
Computed: true,
87-
Type: schema.TypeBool,
98+
Computed: true,
99+
Description: "Defines whether Edge Services IPs should be matched",
100+
Type: schema.TypeBool,
88101
},
89102
},
90103
},
91104
},
92105
"action": {
93-
Type: schema.TypeList,
94-
Computed: true,
106+
Type: schema.TypeList,
107+
Description: "Action to take when incoming traffic matches an ACL filter.",
108+
Computed: true,
95109
Elem: &schema.Resource{
96110
Schema: map[string]*schema.Schema{
97111
"type": {
98-
Type: schema.TypeString,
99-
Computed: true,
112+
Type: schema.TypeString,
113+
Description: "type: action to take when incoming traffic matches an ACL filter. (allow/deny)",
114+
Computed: true,
100115
},
101116
"redirect": {
102-
Type: schema.TypeList,
103-
Computed: true,
117+
Type: schema.TypeList,
118+
Description: "redirection parameters when using an ACL with a `redirect` action.",
119+
Computed: true,
104120
Elem: &schema.Resource{
105121
Schema: map[string]*schema.Schema{
106122
"type": {
107-
Type: schema.TypeString,
108-
Computed: true,
123+
Type: schema.TypeString,
124+
Description: "Value can be location or scheme",
125+
Computed: true,
109126
},
110127
"target": {
111-
Type: schema.TypeString,
112-
Computed: true,
128+
Type: schema.TypeString,
129+
Description: "redirect target. For a location redirect, you can use a URL e.g. `https://scaleway.com`. Using a scheme name (e.g. `https`, `http`, `ftp`, `git`) will replace the request's original scheme. This can be useful to implement HTTP to HTTPS redirects. Valid placeholders that can be used in a `location` redirect to preserve parts of the original request in the redirection URL are {{host}}, {{query}}, {{path}} and {{scheme}}.",
130+
Computed: true,
113131
},
114132
"code": {
115-
Type: schema.TypeInt,
116-
Computed: true,
133+
Type: schema.TypeInt,
134+
Description: "HTTP redirect code to use. Valid values are 301, 302, 303, 307 and 308. Default value is 302.",
135+
Computed: true,
117136
},
118137
},
119138
},
@@ -122,12 +141,14 @@ func DataSourceACLs() *schema.Resource {
122141
},
123142
},
124143
"created_at": {
125-
Computed: true,
126-
Type: schema.TypeString,
144+
Computed: true,
145+
Description: "Timestamp when the ACL was created (RFC3339)",
146+
Type: schema.TypeString,
127147
},
128148
"update_at": {
129-
Computed: true,
130-
Type: schema.TypeString,
149+
Computed: true,
150+
Description: "Timestamp when the ACL was updated (RFC3339)",
151+
Type: schema.TypeString,
131152
},
132153
},
133154
},

internal/services/lb/backend.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func ResourceBackend() *schema.Resource {
168168
},
169169
"health_check_tcp": {
170170
Type: schema.TypeList,
171+
Description: "TCP Health check",
171172
MaxItems: 1,
172173
ConflictsWith: []string{"health_check_http", "health_check_https"},
173174
Optional: true,
@@ -178,6 +179,7 @@ func ResourceBackend() *schema.Resource {
178179
},
179180
"health_check_http": {
180181
Type: schema.TypeList,
182+
Description: "HTTP Health check",
181183
MaxItems: 1,
182184
ConflictsWith: []string{"health_check_tcp", "health_check_https"},
183185
Optional: true,
@@ -210,6 +212,7 @@ func ResourceBackend() *schema.Resource {
210212
},
211213
"health_check_https": {
212214
Type: schema.TypeList,
215+
Description: "HTTPS Health check",
213216
MaxItems: 1,
214217
ConflictsWith: []string{"health_check_tcp", "health_check_http"},
215218
Optional: true,

0 commit comments

Comments
 (0)