@@ -46,6 +46,8 @@ const (
46
46
ZoneTypeAvailabilityZone ZoneType = "availability-zone"
47
47
// ZoneTypeLocalZone defines the AWS zone type in Local Zone infrastructure.
48
48
ZoneTypeLocalZone ZoneType = "local-zone"
49
+ // ZoneTypeWavelengthZone defines the AWS zone type in Wavelength infrastructure.
50
+ ZoneTypeWavelengthZone ZoneType = "wavelength-zone"
49
51
)
50
52
51
53
// NetworkStatus encapsulates AWS networking resources.
@@ -409,6 +411,12 @@ type VPCSpec struct {
409
411
// +optional
410
412
InternetGatewayID * string `json:"internetGatewayId,omitempty"`
411
413
414
+ // CarrierGatewayID is the id of the internet gateway associated with the VPC,
415
+ // for carrier network (Wavelength Zones).
416
+ // +optional
417
+ // +kubebuilder:validation:XValidation:rule="self.startsWith('cagw-')",message="Carrier Gateway ID must start with 'cagw-'"
418
+ CarrierGatewayID * string `json:"carrierGatewayId,omitempty"`
419
+
412
420
// Tags is a collection of tags describing the resource.
413
421
Tags Tags `json:"tags,omitempty"`
414
422
@@ -521,33 +529,36 @@ type SubnetSpec struct {
521
529
522
530
// ZoneType defines the type of the zone where the subnet is created.
523
531
//
524
- // The valid values are availability-zone, and local -zone.
532
+ // The valid values are availability-zone, local-zone, and wavelength -zone.
525
533
//
526
534
// Subnet with zone type availability-zone (regular) is always selected to create cluster
527
535
// resources, like Load Balancers, NAT Gateways, Contol Plane nodes, etc.
528
536
//
529
- // Subnet with zone type local-zone is not eligible to automatically create
537
+ // Subnet with zone type local-zone or wavelength-zone is not eligible to automatically create
530
538
// regular cluster resources.
531
539
//
532
540
// The public subnet in availability-zone or local-zone is associated with regular public
533
541
// route table with default route entry to a Internet Gateway.
534
542
//
543
+ // The public subnet in wavelength-zone is associated with a carrier public
544
+ // route table with default route entry to a Carrier Gateway.
545
+ //
535
546
// The private subnet in the availability-zone is associated with a private route table with
536
547
// the default route entry to a NAT Gateway created in that zone.
537
548
//
538
- // The private subnet in the local-zone is associated with a private route table with
549
+ // The private subnet in the local-zone or wavelength-zone is associated with a private route table with
539
550
// the default route entry re-using the NAT Gateway in the Region (preferred from the
540
551
// parent zone, the zone type availability-zone in the region, or first table available).
541
552
//
542
- // +kubebuilder:validation:Enum=availability-zone;local-zone
553
+ // +kubebuilder:validation:Enum=availability-zone;local-zone;wavelength-zone
543
554
// +optional
544
555
ZoneType * ZoneType `json:"zoneType,omitempty"`
545
556
546
557
// ParentZoneName is the zone name where the current subnet's zone is tied when
547
558
// the zone is a Local Zone.
548
559
//
549
- // The subnets in Local Zone locations consume the ParentZoneName to determine the correct
550
- // private route table to egress traffic to the internet.
560
+ // The subnets in Local Zone or Wavelength Zone locations consume the ParentZoneName
561
+ // to select the correct private route table to egress traffic to the internet.
551
562
//
552
563
// +optional
553
564
ParentZoneName * string `json:"parentZoneName,omitempty"`
@@ -570,7 +581,27 @@ func (s *SubnetSpec) String() string {
570
581
// IsEdge returns the true when the subnet is created in the edge zone,
571
582
// Local Zones.
572
583
func (s * SubnetSpec ) IsEdge () bool {
573
- return s .ZoneType != nil && * s .ZoneType == ZoneTypeLocalZone
584
+ if s .ZoneType == nil {
585
+ return false
586
+ }
587
+ if s .ZoneType .Equal (ZoneTypeLocalZone ) {
588
+ return true
589
+ }
590
+ if s .ZoneType .Equal (ZoneTypeWavelengthZone ) {
591
+ return true
592
+ }
593
+ return false
594
+ }
595
+
596
+ // IsEdgeWavelength returns true only when the subnet is created in Wavelength Zone.
597
+ func (s * SubnetSpec ) IsEdgeWavelength () bool {
598
+ if s .ZoneType == nil {
599
+ return false
600
+ }
601
+ if * s .ZoneType == ZoneTypeWavelengthZone {
602
+ return true
603
+ }
604
+ return false
574
605
}
575
606
576
607
// SetZoneInfo updates the subnets with zone information.
@@ -681,7 +712,7 @@ func (s Subnets) FilterPrivate() (res Subnets) {
681
712
res = append (res , x )
682
713
}
683
714
}
684
- return res
715
+ return
685
716
}
686
717
687
718
// FilterPublic returns a slice containing all subnets marked as public.
@@ -695,7 +726,7 @@ func (s Subnets) FilterPublic() (res Subnets) {
695
726
res = append (res , x )
696
727
}
697
728
}
698
- return res
729
+ return
699
730
}
700
731
701
732
// FilterByZone returns a slice containing all subnets that live in the availability zone specified.
@@ -705,7 +736,7 @@ func (s Subnets) FilterByZone(zone string) (res Subnets) {
705
736
res = append (res , x )
706
737
}
707
738
}
708
- return res
739
+ return
709
740
}
710
741
711
742
// GetUniqueZones returns a slice containing the unique zones of the subnets.
@@ -731,6 +762,19 @@ func (s Subnets) SetZoneInfo(zones []*ec2.AvailabilityZone) error {
731
762
return nil
732
763
}
733
764
765
+ // HasPublicSubnetWavelength returns true when there are subnets in Wavelength zone.
766
+ func (s Subnets ) HasPublicSubnetWavelength () bool {
767
+ for _ , sub := range s {
768
+ if sub .ZoneType == nil {
769
+ return false
770
+ }
771
+ if sub .IsPublic && * sub .ZoneType == ZoneTypeWavelengthZone {
772
+ return true
773
+ }
774
+ }
775
+ return false
776
+ }
777
+
734
778
// CNISpec defines configuration for CNI.
735
779
type CNISpec struct {
736
780
// CNIIngressRules specify rules to apply to control plane and worker node security groups.
@@ -953,3 +997,8 @@ type ZoneType string
953
997
func (z ZoneType ) String () string {
954
998
return string (z )
955
999
}
1000
+
1001
+ // Equal compares two zone types.
1002
+ func (z ZoneType ) Equal (other ZoneType ) bool {
1003
+ return z == other
1004
+ }
0 commit comments