-
Notifications
You must be signed in to change notification settings - Fork 112
/
zz_safetyrule_types.go
executable file
·181 lines (137 loc) · 8.19 KB
/
zz_safetyrule_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
/*
Copyright 2022 Upbound Inc.
*/
// 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 RuleConfigObservation struct {
// Logical negation of the rule.
Inverted *bool `json:"inverted,omitempty" tf:"inverted,omitempty"`
// Number of controls that must be set when you specify an ATLEAST type rule.
Threshold *float64 `json:"threshold,omitempty" tf:"threshold,omitempty"`
// Rule type. Valid values are ATLEAST, AND, and OR.
Type *string `json:"type,omitempty" tf:"type,omitempty"`
}
type RuleConfigParameters struct {
// Logical negation of the rule.
// +kubebuilder:validation:Required
Inverted *bool `json:"inverted" tf:"inverted,omitempty"`
// Number of controls that must be set when you specify an ATLEAST type rule.
// +kubebuilder:validation:Required
Threshold *float64 `json:"threshold" tf:"threshold,omitempty"`
// Rule type. Valid values are ATLEAST, AND, and OR.
// +kubebuilder:validation:Required
Type *string `json:"type" tf:"type,omitempty"`
}
type SafetyRuleObservation struct {
// ARN of the safety rule.
Arn *string `json:"arn,omitempty" tf:"arn,omitempty"`
// Routing controls that are part of transactions that are evaluated to determine if a request to change a routing control state is allowed.
AssertedControls []*string `json:"assertedControls,omitempty" tf:"asserted_controls,omitempty"`
// ARN of the control panel in which this safety rule will reside.
ControlPanelArn *string `json:"controlPanelArn,omitempty" tf:"control_panel_arn,omitempty"`
// Gating controls for the new gating rule. That is, routing controls that are evaluated by the rule configuration that you specify.
GatingControls []*string `json:"gatingControls,omitempty" tf:"gating_controls,omitempty"`
ID *string `json:"id,omitempty" tf:"id,omitempty"`
// Name describing the safety rule.
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// Configuration block for safety rule criteria. See below.
RuleConfig []RuleConfigObservation `json:"ruleConfig,omitempty" tf:"rule_config,omitempty"`
// Status of the safety rule. PENDING when it is being created/updated, PENDING_DELETION when it is being deleted, and DEPLOYED otherwise.
Status *string `json:"status,omitempty" tf:"status,omitempty"`
// Routing controls that can only be set or unset if the specified rule_config evaluates to true for the specified gating_controls.
TargetControls []*string `json:"targetControls,omitempty" tf:"target_controls,omitempty"`
// Evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail.
WaitPeriodMs *float64 `json:"waitPeriodMs,omitempty" tf:"wait_period_ms,omitempty"`
}
type SafetyRuleParameters struct {
// Routing controls that are part of transactions that are evaluated to determine if a request to change a routing control state is allowed.
// +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/route53recoverycontrolconfig/v1beta1.RoutingControl
// +crossplane:generate:reference:extractor=github.com/upbound/provider-aws/config/common.TerraformID()
// +kubebuilder:validation:Optional
AssertedControls []*string `json:"assertedControls,omitempty" tf:"asserted_controls,omitempty"`
// References to RoutingControl in route53recoverycontrolconfig to populate assertedControls.
// +kubebuilder:validation:Optional
AssertedControlsRefs []v1.Reference `json:"assertedControlsRefs,omitempty" tf:"-"`
// Selector for a list of RoutingControl in route53recoverycontrolconfig to populate assertedControls.
// +kubebuilder:validation:Optional
AssertedControlsSelector *v1.Selector `json:"assertedControlsSelector,omitempty" tf:"-"`
// ARN of the control panel in which this safety rule will reside.
// +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/route53recoverycontrolconfig/v1beta1.ControlPanel
// +crossplane:generate:reference:extractor=github.com/upbound/provider-aws/config/common.TerraformID()
// +kubebuilder:validation:Optional
ControlPanelArn *string `json:"controlPanelArn,omitempty" tf:"control_panel_arn,omitempty"`
// Reference to a ControlPanel in route53recoverycontrolconfig to populate controlPanelArn.
// +kubebuilder:validation:Optional
ControlPanelArnRef *v1.Reference `json:"controlPanelArnRef,omitempty" tf:"-"`
// Selector for a ControlPanel in route53recoverycontrolconfig to populate controlPanelArn.
// +kubebuilder:validation:Optional
ControlPanelArnSelector *v1.Selector `json:"controlPanelArnSelector,omitempty" tf:"-"`
// Gating controls for the new gating rule. That is, routing controls that are evaluated by the rule configuration that you specify.
// +kubebuilder:validation:Optional
GatingControls []*string `json:"gatingControls,omitempty" tf:"gating_controls,omitempty"`
// Name describing the safety rule.
// +kubebuilder:validation:Optional
Name *string `json:"name,omitempty" tf:"name,omitempty"`
// Region is the region you'd like your resource to be created in.
// +upjet:crd:field:TFTag=-
// +kubebuilder:validation:Required
Region *string `json:"region" tf:"-"`
// Configuration block for safety rule criteria. See below.
// +kubebuilder:validation:Optional
RuleConfig []RuleConfigParameters `json:"ruleConfig,omitempty" tf:"rule_config,omitempty"`
// Routing controls that can only be set or unset if the specified rule_config evaluates to true for the specified gating_controls.
// +kubebuilder:validation:Optional
TargetControls []*string `json:"targetControls,omitempty" tf:"target_controls,omitempty"`
// Evaluation period, in milliseconds (ms), during which any request against the target routing controls will fail.
// +kubebuilder:validation:Optional
WaitPeriodMs *float64 `json:"waitPeriodMs,omitempty" tf:"wait_period_ms,omitempty"`
}
// SafetyRuleSpec defines the desired state of SafetyRule
type SafetyRuleSpec struct {
v1.ResourceSpec `json:",inline"`
ForProvider SafetyRuleParameters `json:"forProvider"`
}
// SafetyRuleStatus defines the observed state of SafetyRule.
type SafetyRuleStatus struct {
v1.ResourceStatus `json:",inline"`
AtProvider SafetyRuleObservation `json:"atProvider,omitempty"`
}
// +kubebuilder:object:root=true
// SafetyRule is the Schema for the SafetyRules API. Provides an AWS Route 53 Recovery Control Config Safety Rule
// +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,aws}
type SafetyRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter"
// +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.ruleConfig)",message="ruleConfig is a required parameter"
// +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.waitPeriodMs)",message="waitPeriodMs is a required parameter"
Spec SafetyRuleSpec `json:"spec"`
Status SafetyRuleStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// SafetyRuleList contains a list of SafetyRules
type SafetyRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SafetyRule `json:"items"`
}
// Repository type metadata.
var (
SafetyRule_Kind = "SafetyRule"
SafetyRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: SafetyRule_Kind}.String()
SafetyRule_KindAPIVersion = SafetyRule_Kind + "." + CRDGroupVersion.String()
SafetyRule_GroupVersionKind = CRDGroupVersion.WithKind(SafetyRule_Kind)
)
func init() {
SchemeBuilder.Register(&SafetyRule{}, &SafetyRuleList{})
}