Skip to content

Commit 5b5c0b4

Browse files
Fix: Make "match" field in Route Policy's terms as required (#14402) (#23494)
[upstream:ffbd59a8ad9749e1eefb503808df8ff3f1b42093] Signed-off-by: Modular Magician <[email protected]>
1 parent c7c2606 commit 5b5c0b4

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

.changelog/14402.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unknown: Fix: Make "match" field in Route Policy's terms as required

google/services/compute/resource_compute_router_route_policy.go

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,36 @@ func ResourceComputeRouterRoutePolicy() *schema.Resource {
7777
Description: `List of terms (the order in the list is not important, they are evaluated in order of priority).`,
7878
Elem: &schema.Resource{
7979
Schema: map[string]*schema.Schema{
80+
"match": {
81+
Type: schema.TypeList,
82+
Required: true,
83+
Description: `CEL expression evaluated against a route to determine if this term applies (see Policy Language).`,
84+
MaxItems: 1,
85+
Elem: &schema.Resource{
86+
Schema: map[string]*schema.Schema{
87+
"expression": {
88+
Type: schema.TypeString,
89+
Required: true,
90+
Description: `Textual representation of an expression in Common Expression Language syntax.`,
91+
},
92+
"description": {
93+
Type: schema.TypeString,
94+
Optional: true,
95+
Description: `Description of the expression`,
96+
},
97+
"location": {
98+
Type: schema.TypeString,
99+
Optional: true,
100+
Description: `String indicating the location of the expression for error reporting, e.g. a file name and a position in the file`,
101+
},
102+
"title": {
103+
Type: schema.TypeString,
104+
Optional: true,
105+
Description: `Title for the expression, i.e. a short string describing its purpose.`,
106+
},
107+
},
108+
},
109+
},
80110
"priority": {
81111
Type: schema.TypeInt,
82112
Required: true,
@@ -114,36 +144,6 @@ purpose.`,
114144
},
115145
},
116146
},
117-
"match": {
118-
Type: schema.TypeList,
119-
Optional: true,
120-
Description: `CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes.`,
121-
MaxItems: 1,
122-
Elem: &schema.Resource{
123-
Schema: map[string]*schema.Schema{
124-
"expression": {
125-
Type: schema.TypeString,
126-
Required: true,
127-
Description: `Textual representation of an expression in Common Expression Language syntax.`,
128-
},
129-
"description": {
130-
Type: schema.TypeString,
131-
Optional: true,
132-
Description: `Description of the expression`,
133-
},
134-
"location": {
135-
Type: schema.TypeString,
136-
Optional: true,
137-
Description: `String indicating the location of the expression for error reporting, e.g. a file name and a position in the file`,
138-
},
139-
"title": {
140-
Type: schema.TypeString,
141-
Optional: true,
142-
Description: `Title for the expression, i.e. a short string describing its purpose.`,
143-
},
144-
},
145-
},
146-
},
147147
},
148148
},
149149
},

website/docs/r/compute_router_route_policy.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ The following arguments are supported:
157157
The evaluation priority for this term, which must be between 0 (inclusive) and 231 (exclusive), and unique within the list.
158158

159159
* `match` -
160-
(Optional)
161-
CEL expression evaluated against a route to determine if this term applies (see Policy Language). When not set, the term applies to all routes.
160+
(Required)
161+
CEL expression evaluated against a route to determine if this term applies (see Policy Language).
162162
Structure is [documented below](#nested_terms_terms_match).
163163

164164
* `actions` -

0 commit comments

Comments
 (0)