You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource(vpc_firewall_rules): support new api changes
Pulled in the Go SDK changes from
oxidecomputer/oxide.go#304 which contained
changes to the VPC firewall rules APIs.
Updated the `oxide_vpc_firewall_rules` resource to account for these
changes.
Copy file name to clipboardExpand all lines: .changelog/0.13.0.toml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[[breaking]]
2
-
title = ""
3
-
description = ""
2
+
title = "`oxide_vpc_firewall_rules`"
3
+
description = "Updated the schema for the `protocols` attribute to allow for more control over ICMP traffic. [#474](https://github.com/oxidecomputer/terraform-provider-oxide/pull/474)"
-`hosts` (Set) If present, the sources (if incoming) or destinations (if outgoing) this rule applies to. (see [below for nested schema](#nestedatt--hosts))
89
-
-`protocols` (Array of Strings) If present, the networking protocols this rule applies to. Possible values are: TCP, UDP and ICMP.
134
+
-`protocols` (Set) If present, the networking protocols this rule applies to. (see [below for nested schema](#nestedatt--protocols))
90
135
-`ports` (Array of Strings) If present, the destination ports this rule applies to. Can be a mix of single ports (e.g., `"443"`) and port ranges (e.g., `"30000-32768"`).
91
136
92
137
<aid="nestedatt--hosts"></a>
@@ -103,6 +148,19 @@ Required:
103
148
- For type ip: IP address
104
149
- For type ip_net: IPv4 or IPv6 subnet
105
150
151
+
<aid="nestedatt--protocols"></a>
152
+
153
+
### Nested Schema for `protocols`
154
+
155
+
Required:
156
+
157
+
-`type` (String) The protocol type. Must be one of `tcp`, `udp`, or `icmp`.
158
+
159
+
Optional:
160
+
161
+
-`icmp_type` (Number) ICMP type (e.g., 0 for Echo Reply). Only valid when `type` is `icmp`.
162
+
-`icmp_code` (String) ICMP code (e.g., 0) or range (e.g., 1-3). Omit to filter all traffic of the specified `icmp_type`. Only valid when type is `icmp` and `icmp_type` is provided.
Description: "If present, the networking protocols this rule applies to. Possible values are: TCP, UDP and ICMP.",
198
+
"protocols": schema.SetNestedAttribute{
199
+
Description: "The protocols in a firewall rule's filter.",
193
200
Optional: true,
194
-
ElementType: types.StringType,
201
+
NestedObject: schema.NestedAttributeObject{
202
+
Attributes: map[string]schema.Attribute{
203
+
"type": schema.StringAttribute{
204
+
Required: true,
205
+
Description: "The protocol type. Must be one of `tcp`, `udp`, or `icmp`.",
206
+
Validators: []validator.String{
207
+
stringvalidator.OneOf(
208
+
string(oxide.VpcFirewallRuleProtocolTypeTcp),
209
+
string(oxide.VpcFirewallRuleProtocolTypeUdp),
210
+
string(oxide.VpcFirewallRuleProtocolTypeIcmp),
211
+
),
212
+
},
213
+
},
214
+
"icmp_type": schema.Int32Attribute{
215
+
Optional: true,
216
+
Description: "ICMP type. Only valid when type is `icmp`.",
217
+
Validators: []validator.Int32{
218
+
int32validator.Between(0, 255),
219
+
},
220
+
},
221
+
"icmp_code": schema.StringAttribute{
222
+
Optional: true,
223
+
Description: "ICMP code (e.g., 0) or range (e.g., 1-3). Omit to filter all traffic of the specified `icmp_type`. Only valid when type is `icmp` and `icmp_type` is provided.",
0 commit comments