-
Notifications
You must be signed in to change notification settings - Fork 59
/
zz_firewall_types.go
executable file
·417 lines (347 loc) · 20.2 KB
/
zz_firewall_types.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
/*
Copyright 2021 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by upjet. DO NOT EDIT.
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
v1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)
type AllowObservation struct {
// An optional list of ports to which this rule applies. This field
// is only applicable for UDP or TCP protocol. Each entry must be
// either an integer or a range. If not specified, this rule
// applies to connections through any port.
// Example inputs include: ["22"], ["80","443"], and
// ["12345-12349"].
Ports []*string `json:"ports,omitempty" tf:"ports,omitempty"`
// The IP protocol to which this rule applies. The protocol type is
// required when creating a firewall rule. This value can either be
// one of the following well known protocol strings (tcp, udp,
// icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"`
}
type AllowParameters struct {
// An optional list of ports to which this rule applies. This field
// is only applicable for UDP or TCP protocol. Each entry must be
// either an integer or a range. If not specified, this rule
// applies to connections through any port.
// Example inputs include: ["22"], ["80","443"], and
// ["12345-12349"].
// +kubebuilder:validation:Optional
Ports []*string `json:"ports,omitempty" tf:"ports,omitempty"`
// The IP protocol to which this rule applies. The protocol type is
// required when creating a firewall rule. This value can either be
// one of the following well known protocol strings (tcp, udp,
// icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
// +kubebuilder:validation:Required
Protocol *string `json:"protocol" tf:"protocol,omitempty"`
}
type DenyObservation struct {
// An optional list of ports to which this rule applies. This field
// is only applicable for UDP or TCP protocol. Each entry must be
// either an integer or a range. If not specified, this rule
// applies to connections through any port.
// Example inputs include: ["22"], ["80","443"], and
// ["12345-12349"].
Ports []*string `json:"ports,omitempty" tf:"ports,omitempty"`
// The IP protocol to which this rule applies. The protocol type is
// required when creating a firewall rule. This value can either be
// one of the following well known protocol strings (tcp, udp,
// icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"`
}
type DenyParameters struct {
// An optional list of ports to which this rule applies. This field
// is only applicable for UDP or TCP protocol. Each entry must be
// either an integer or a range. If not specified, this rule
// applies to connections through any port.
// Example inputs include: ["22"], ["80","443"], and
// ["12345-12349"].
// +kubebuilder:validation:Optional
Ports []*string `json:"ports,omitempty" tf:"ports,omitempty"`
// The IP protocol to which this rule applies. The protocol type is
// required when creating a firewall rule. This value can either be
// one of the following well known protocol strings (tcp, udp,
// icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
// +kubebuilder:validation:Required
Protocol *string `json:"protocol" tf:"protocol,omitempty"`
}
type FirewallLogConfigObservation struct {
// This field denotes whether to include or exclude metadata for firewall logs.
// Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA.
Metadata *string `json:"metadata,omitempty" tf:"metadata,omitempty"`
}
type FirewallLogConfigParameters struct {
// This field denotes whether to include or exclude metadata for firewall logs.
// Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA.
// +kubebuilder:validation:Required
Metadata *string `json:"metadata" tf:"metadata,omitempty"`
}
type FirewallObservation struct {
// The list of ALLOW rules specified by this firewall. Each rule
// specifies a protocol and port-range tuple that describes a permitted
// connection.
// Structure is documented below.
Allow []AllowObservation `json:"allow,omitempty" tf:"allow,omitempty"`
// Creation timestamp in RFC3339 text format.
CreationTimestamp *string `json:"creationTimestamp,omitempty" tf:"creation_timestamp,omitempty"`
// The list of DENY rules specified by this firewall. Each rule specifies
// a protocol and port-range tuple that describes a denied connection.
// Structure is documented below.
Deny []DenyObservation `json:"deny,omitempty" tf:"deny,omitempty"`
// An optional description of this resource. Provide this property when
// you create the resource.
Description *string `json:"description,omitempty" tf:"description,omitempty"`
// If destination ranges are specified, the firewall will apply only to
// traffic that has destination IP address in these ranges. These ranges
// must be expressed in CIDR format. IPv4 or IPv6 ranges are supported.
DestinationRanges []*string `json:"destinationRanges,omitempty" tf:"destination_ranges,omitempty"`
// Direction of traffic to which this firewall applies; default is
// INGRESS. Note: For INGRESS traffic, one of source_ranges,
// source_tags or source_service_accounts is required.
// Possible values are: INGRESS, EGRESS.
Direction *string `json:"direction,omitempty" tf:"direction,omitempty"`
// Denotes whether the firewall rule is disabled, i.e not applied to the
// network it is associated with. When set to true, the firewall rule is
// not enforced and the network behaves as if it did not exist. If this
// is unspecified, the firewall rule will be enabled.
Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"`
// This field denotes whether to enable logging for a particular firewall rule.
// If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config
EnableLogging *bool `json:"enableLogging,omitempty" tf:"enable_logging,omitempty"`
// an identifier for the resource with format projects/{{project}}/global/firewalls/{{name}}
ID *string `json:"id,omitempty" tf:"id,omitempty"`
// This field denotes the logging options for a particular firewall rule.
// If defined, logging is enabled, and logs will be exported to Cloud Logging.
// Structure is documented below.
LogConfig []FirewallLogConfigObservation `json:"logConfig,omitempty" tf:"log_config,omitempty"`
// The name or self_link of the network to attach this firewall to.
Network *string `json:"network,omitempty" tf:"network,omitempty"`
// Priority for this rule. This is an integer between 0 and 65535, both
// inclusive. When not specified, the value assumed is 1000. Relative
// priorities determine precedence of conflicting rules. Lower value of
// priority implies higher precedence (eg, a rule with priority 0 has
// higher precedence than a rule with priority 1). DENY rules take
// precedence over ALLOW rules having equal priority.
Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// The URI of the created resource.
SelfLink *string `json:"selfLink,omitempty" tf:"self_link,omitempty"`
// If source ranges are specified, the firewall will apply only to
// traffic that has source IP address in these ranges. These ranges must
// be expressed in CIDR format. One or both of sourceRanges and
// sourceTags may be set. If both properties are set, the firewall will
// apply to traffic that has source IP address within sourceRanges OR the
// source IP that belongs to a tag listed in the sourceTags property. The
// connection does not need to match both properties for the firewall to
// apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of
// source_ranges, source_tags or source_service_accounts is required.
SourceRanges []*string `json:"sourceRanges,omitempty" tf:"source_ranges,omitempty"`
// If source service accounts are specified, the firewall will apply only
// to traffic originating from an instance with a service account in this
// list. Source service accounts cannot be used to control traffic to an
// instance's external IP address because service accounts are associated
// with an instance, not an IP address. sourceRanges can be set at the
// same time as sourceServiceAccounts. If both are set, the firewall will
// apply to traffic that has source IP address within sourceRanges OR the
// source IP belongs to an instance with service account listed in
// sourceServiceAccount. The connection does not need to match both
// properties for the firewall to apply. sourceServiceAccounts cannot be
// used at the same time as sourceTags or targetTags. For INGRESS traffic,
// one of source_ranges, source_tags or source_service_accounts is required.
SourceServiceAccounts []*string `json:"sourceServiceAccounts,omitempty" tf:"source_service_accounts,omitempty"`
// If source tags are specified, the firewall will apply only to traffic
// with source IP that belongs to a tag listed in source tags. Source
// tags cannot be used to control traffic to an instance's external IP
// address. Because tags are associated with an instance, not an IP
// address. One or both of sourceRanges and sourceTags may be set. If
// both properties are set, the firewall will apply to traffic that has
// source IP address within sourceRanges OR the source IP that belongs to
// a tag listed in the sourceTags property. The connection does not need
// to match both properties for the firewall to apply. For INGRESS traffic,
// one of source_ranges, source_tags or source_service_accounts is required.
SourceTags []*string `json:"sourceTags,omitempty" tf:"source_tags,omitempty"`
// A list of service accounts indicating sets of instances located in the
// network that may make network connections as specified in allowed[].
// targetServiceAccounts cannot be used at the same time as targetTags or
// sourceTags. If neither targetServiceAccounts nor targetTags are
// specified, the firewall rule applies to all instances on the specified
// network.
TargetServiceAccounts []*string `json:"targetServiceAccounts,omitempty" tf:"target_service_accounts,omitempty"`
// A list of instance tags indicating sets of instances located in the
// network that may make network connections as specified in allowed[].
// If no targetTags are specified, the firewall rule applies to all
// instances on the specified network.
TargetTags []*string `json:"targetTags,omitempty" tf:"target_tags,omitempty"`
}
type FirewallParameters struct {
// The list of ALLOW rules specified by this firewall. Each rule
// specifies a protocol and port-range tuple that describes a permitted
// connection.
// Structure is documented below.
// +kubebuilder:validation:Optional
Allow []AllowParameters `json:"allow,omitempty" tf:"allow,omitempty"`
// The list of DENY rules specified by this firewall. Each rule specifies
// a protocol and port-range tuple that describes a denied connection.
// Structure is documented below.
// +kubebuilder:validation:Optional
Deny []DenyParameters `json:"deny,omitempty" tf:"deny,omitempty"`
// An optional description of this resource. Provide this property when
// you create the resource.
// +kubebuilder:validation:Optional
Description *string `json:"description,omitempty" tf:"description,omitempty"`
// If destination ranges are specified, the firewall will apply only to
// traffic that has destination IP address in these ranges. These ranges
// must be expressed in CIDR format. IPv4 or IPv6 ranges are supported.
// +kubebuilder:validation:Optional
DestinationRanges []*string `json:"destinationRanges,omitempty" tf:"destination_ranges,omitempty"`
// Direction of traffic to which this firewall applies; default is
// INGRESS. Note: For INGRESS traffic, one of source_ranges,
// source_tags or source_service_accounts is required.
// Possible values are: INGRESS, EGRESS.
// +kubebuilder:validation:Optional
Direction *string `json:"direction,omitempty" tf:"direction,omitempty"`
// Denotes whether the firewall rule is disabled, i.e not applied to the
// network it is associated with. When set to true, the firewall rule is
// not enforced and the network behaves as if it did not exist. If this
// is unspecified, the firewall rule will be enabled.
// +kubebuilder:validation:Optional
Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"`
// This field denotes whether to enable logging for a particular firewall rule.
// If logging is enabled, logs will be exported to Stackdriver. Deprecated in favor of log_config
// +kubebuilder:validation:Optional
EnableLogging *bool `json:"enableLogging,omitempty" tf:"enable_logging,omitempty"`
// This field denotes the logging options for a particular firewall rule.
// If defined, logging is enabled, and logs will be exported to Cloud Logging.
// Structure is documented below.
// +kubebuilder:validation:Optional
LogConfig []FirewallLogConfigParameters `json:"logConfig,omitempty" tf:"log_config,omitempty"`
// The name or self_link of the network to attach this firewall to.
// +crossplane:generate:reference:type=Network
// +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor()
// +kubebuilder:validation:Optional
Network *string `json:"network,omitempty" tf:"network,omitempty"`
// Reference to a Network to populate network.
// +kubebuilder:validation:Optional
NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"`
// Selector for a Network to populate network.
// +kubebuilder:validation:Optional
NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"`
// Priority for this rule. This is an integer between 0 and 65535, both
// inclusive. When not specified, the value assumed is 1000. Relative
// priorities determine precedence of conflicting rules. Lower value of
// priority implies higher precedence (eg, a rule with priority 0 has
// higher precedence than a rule with priority 1). DENY rules take
// precedence over ALLOW rules having equal priority.
// +kubebuilder:validation:Optional
Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
// +kubebuilder:validation:Optional
Project *string `json:"project,omitempty" tf:"project,omitempty"`
// If source ranges are specified, the firewall will apply only to
// traffic that has source IP address in these ranges. These ranges must
// be expressed in CIDR format. One or both of sourceRanges and
// sourceTags may be set. If both properties are set, the firewall will
// apply to traffic that has source IP address within sourceRanges OR the
// source IP that belongs to a tag listed in the sourceTags property. The
// connection does not need to match both properties for the firewall to
// apply. IPv4 or IPv6 ranges are supported. For INGRESS traffic, one of
// source_ranges, source_tags or source_service_accounts is required.
// +kubebuilder:validation:Optional
SourceRanges []*string `json:"sourceRanges,omitempty" tf:"source_ranges,omitempty"`
// If source service accounts are specified, the firewall will apply only
// to traffic originating from an instance with a service account in this
// list. Source service accounts cannot be used to control traffic to an
// instance's external IP address because service accounts are associated
// with an instance, not an IP address. sourceRanges can be set at the
// same time as sourceServiceAccounts. If both are set, the firewall will
// apply to traffic that has source IP address within sourceRanges OR the
// source IP belongs to an instance with service account listed in
// sourceServiceAccount. The connection does not need to match both
// properties for the firewall to apply. sourceServiceAccounts cannot be
// used at the same time as sourceTags or targetTags. For INGRESS traffic,
// one of source_ranges, source_tags or source_service_accounts is required.
// +kubebuilder:validation:Optional
SourceServiceAccounts []*string `json:"sourceServiceAccounts,omitempty" tf:"source_service_accounts,omitempty"`
// If source tags are specified, the firewall will apply only to traffic
// with source IP that belongs to a tag listed in source tags. Source
// tags cannot be used to control traffic to an instance's external IP
// address. Because tags are associated with an instance, not an IP
// address. One or both of sourceRanges and sourceTags may be set. If
// both properties are set, the firewall will apply to traffic that has
// source IP address within sourceRanges OR the source IP that belongs to
// a tag listed in the sourceTags property. The connection does not need
// to match both properties for the firewall to apply. For INGRESS traffic,
// one of source_ranges, source_tags or source_service_accounts is required.
// +kubebuilder:validation:Optional
SourceTags []*string `json:"sourceTags,omitempty" tf:"source_tags,omitempty"`
// A list of service accounts indicating sets of instances located in the
// network that may make network connections as specified in allowed[].
// targetServiceAccounts cannot be used at the same time as targetTags or
// sourceTags. If neither targetServiceAccounts nor targetTags are
// specified, the firewall rule applies to all instances on the specified
// network.
// +kubebuilder:validation:Optional
TargetServiceAccounts []*string `json:"targetServiceAccounts,omitempty" tf:"target_service_accounts,omitempty"`
// A list of instance tags indicating sets of instances located in the
// network that may make network connections as specified in allowed[].
// If no targetTags are specified, the firewall rule applies to all
// instances on the specified network.
// +kubebuilder:validation:Optional
TargetTags []*string `json:"targetTags,omitempty" tf:"target_tags,omitempty"`
}
// FirewallSpec defines the desired state of Firewall
type FirewallSpec struct {
v1.ResourceSpec `json:",inline"`
ForProvider FirewallParameters `json:"forProvider"`
}
// FirewallStatus defines the observed state of Firewall.
type FirewallStatus struct {
v1.ResourceStatus `json:",inline"`
AtProvider FirewallObservation `json:"atProvider,omitempty"`
}
// +kubebuilder:object:root=true
// Firewall is the Schema for the Firewalls API. Each network has its own firewall controlling access to and from the instances.
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp}
type Firewall struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FirewallSpec `json:"spec"`
Status FirewallStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// FirewallList contains a list of Firewalls
type FirewallList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Firewall `json:"items"`
}
// Repository type metadata.
var (
Firewall_Kind = "Firewall"
Firewall_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Firewall_Kind}.String()
Firewall_KindAPIVersion = Firewall_Kind + "." + CRDGroupVersion.String()
Firewall_GroupVersionKind = CRDGroupVersion.WithKind(Firewall_Kind)
)
func init() {
SchemeBuilder.Register(&Firewall{}, &FirewallList{})
}