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
// DedicatedHostStatus defines the observed state of a dynamically allocated dedicated host
424
+
// associated with an AWSMachine. This struct is used to track the ID of the dedicated host.
425
+
// +kubebuilder:validation:MinProperties=1
426
+
typeDedicatedHostStatusstruct {
427
+
// id tracks the dynamically allocated dedicated host ID.
428
+
// This field is populated when allocationStrategy is Dynamic (with or without DynamicHostAllocation).
429
+
// When omitted, this indicates that the dedicated host has not yet been allocated, or allocation is in progress.
430
+
// The value must start with "h-" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f).
431
+
// The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format.
432
+
// Must be either 10 or 19 characters in length.
433
+
// +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="id must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
434
+
// +kubebuilder:validation:MinLength=10
435
+
// +kubebuilder:validation:MaxLength=19
436
+
// +optional
437
+
ID*string`json:"id,omitempty"`
410
438
}
411
439
412
440
// MarketType describes the market type of an EC2 Instance
@@ -454,21 +482,77 @@ type HostAffinity string
454
482
455
483
const (
456
484
// HostAffinityAnyAvailable lets the platform select any available dedicated host.
// DedicatedHost represents the configuration for the usage of dedicated host.
506
+
// +kubebuilder:validation:XValidation:rule="self.allocationStrategy == 'UserProvided' ? has(self.id) : !has(self.id)",message="id is required when allocationStrategy is UserProvided, and forbidden otherwise"
507
+
// +kubebuilder:validation:XValidation:rule="has(self.dynamicHostAllocation) ? self.allocationStrategy == 'Dynamic' : true",message="dynamicHostAllocation is only allowed when allocationStrategy is Dynamic"
508
+
// +union
464
509
typeDedicatedHoststruct {
510
+
// allocationStrategy specifies if the dedicated host will be provided by the admin through the id field or if the host will be dynamically allocated.
511
+
// Valid values are UserProvided and Dynamic.
512
+
// When omitted, the value defaults to "UserProvided", which requires the id field to be set.
513
+
// When allocationStrategy is set to UserProvided, an ID of the dedicated host to assign must be provided.
514
+
// When allocationStrategy is set to Dynamic, a dedicated host will be allocated and used to assign instances.
515
+
// When allocationStrategy is set to Dynamic, and dynamicHostAllocation is configured, a dedicated host will be allocated and the tags in dynamicHostAllocation will be assigned to that host.
// id identifies the AWS Dedicated Host on which the instance must run.
466
522
// The value must start with "h-" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f).
467
523
// The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format.
468
524
// Must be either 10 or 19 characters in length.
469
-
// +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="hostID must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
525
+
// This field is required when allocationStrategy is UserProvided, and forbidden otherwise.
526
+
// When omitted with allocationStrategy set to Dynamic, the platform will dynamically allocate a dedicated host.
527
+
// +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="id must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
470
528
// +kubebuilder:validation:MinLength=10
471
529
// +kubebuilder:validation:MaxLength=19
472
-
// +required
530
+
// +optional
531
+
// +unionMember=UserProvided
473
532
IDstring`json:"id,omitempty"`
533
+
534
+
// dynamicHostAllocation specifies tags to apply to a dynamically allocated dedicated host.
535
+
// This field is only allowed when allocationStrategy is Dynamic, and is mutually exclusive with id.
536
+
// When specified, a dedicated host will be allocated with the provided tags applied.
537
+
// When omitted (and allocationStrategy is Dynamic), a dedicated host will be allocated without any additional tags.
0 commit comments