Skip to content

Commit 6624d09

Browse files
authored
Add support for ManagedPrefixLists in EC2 controller (#295)
Issue #, if available: aws-controllers-k8s/community#2665 Description of changes: Added support for ManagedPrefixLists. This was validated with a KIND local cluster, and here are the results: - Controller logs ``` $ kubectl -n ack-system logs ack-ec2-controller-6f9ff4897-nxlpb | grep prefix {"level":"info","ts":"2025-10-28T10:56:18.991Z","msg":"Starting EventSource","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList","source":"kind source: *v1alpha1.ManagedPrefixList"} {"level":"info","ts":"2025-10-28T10:56:19.193Z","msg":"Starting Controller","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList"} {"level":"info","ts":"2025-10-28T10:56:19.193Z","msg":"Starting workers","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList","worker count":1} ``` - ManagedPrefixList status ``` $ kubectl get ManagedPrefixLists NAME ID NAME STATE VERSION ack-managed-prefix-list pl-0e02e7c2410655ae5 ack-final-test-11184 create-complete 1 apiVersion: ec2.services.k8s.aws/v1alpha1 kind: ManagedPrefixList metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"ec2.services.k8s.aws/v1alpha1","kind":"ManagedPrefixList","metadata":{"annotations":{},"name":"ack-managed-prefix-list","namespace":"default"},"spec":{"addressFamily":"IPv4","entries":[{"cidr":"10.250.0.0/24","description":"ACK Created - Network 1"},{"cidr":"10.250.1.0/24","description":"ACK Created - Network 2"},{"cidr":"10.250.2.0/24","description":"ACK Created - Network 3"}],"maxEntries":10,"prefixListName":"ack-final-test-11184","tags":[{"key":"Environment","value":"production"},{"key":"ManagedBy","value":"ACK-Controller"},{"key":"Purpose","value":"Demo"}]}} creationTimestamp: "2025-10-28T10:54:38Z" finalizers: - finalizers.ec2.services.k8s.aws/ManagedPrefixList generation: 1 name: ack-managed-prefix-list namespace: default resourceVersion: "3836" uid: 16681e81-40cd-4137-ad0f-ff06ed0ec060 spec: addressFamily: IPv4 entries: - cidr: 10.250.0.0/24 description: ACK Created - Network 1 - cidr: 10.250.1.0/24 description: ACK Created - Network 2 - cidr: 10.250.2.0/24 description: ACK Created - Network 3 maxEntries: 10 prefixListName: ack-final-test-11184 tags: - key: ManagedBy value: ACK-Controller - key: Purpose value: Demo status: ackResourceMetadata: ownerAccountID: "258057316678" region: us-west-2 conditions: - lastTransitionTime: "2025-10-28T10:56:20Z" message: Resource synced successfully reason: "" status: "True" type: ACK.ResourceSynced ownerID: "258057316678" prefixListARN: arn:aws:ec2:us-west-2:258057316678:prefix-list/pl-0e02e7c2410655ae5 prefixListID: pl-0e02e7c2410655ae5 state: create-complete version: 1 ``` - ManagedPrefixList created in AWS <img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/69f52395-cac6-4a62-95b4-477ccdd84b19" /> - ManagedPrefixList updated <img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/11c14d81-c685-4e95-a908-87615519e54b" /> - ManagedPrefixList deleted <img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/009a7225-67f9-448a-a047-a475156cdd97" /> --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent acecb3a commit 6624d09

34 files changed

+3470
-75
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-11-29T03:24:03Z"
3-
build_hash: 23c7074fa310ad1ccb38946775397c203b49f024
2+
build_date: "2025-12-02T10:05:09Z"
3+
build_hash: 06bffb95177cf873ee1b1a1c6f93cb30380c1e36
44
go_version: go1.25.4
5-
version: v0.56.0
6-
api_directory_checksum: 5a5c93e3d4865ea08d8a47b2500551112ea831b9
5+
version: v0.56.0-2-g06bffb9
6+
api_directory_checksum: 367f0bfdcd7ddb142c0b59b0ad45288f08abebeb
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 220d17205c72ce425824ef99e0a79fbfc7c63ef2
10+
file_checksum: 664b812d2759abe8ef7a3279fe4761ae9aae009b
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ ignore:
113113
- CreateLaunchTemplateInput.ClientToken
114114
- CreateLaunchTemplateInput.TagSpecifications
115115
- CreateLaunchTemplateVersionInput.LaunchTemplateData.TagSpecifications
116+
- CreateManagedPrefixListInput.ClientToken
117+
- CreateManagedPrefixListInput.TagSpecifications
118+
- CreateManagedPrefixListInput.DryRun
116119
- CreateLaunchTemplateVersionOutput.LaunchTemplateVersion.DefaultVersion
117120
resource_names:
118121
- CapacityReservationBySplitting
@@ -150,7 +153,7 @@ ignore:
150153
- LocalGatewayRouteTableVpcAssociation
151154
- LocalGatewayRouteTableVirtualInterfaceGroupAssociation
152155
- LocalGatewayRoute
153-
- ManagedPrefixList
156+
#- ManagedPrefixList
154157
#- NatGateway
155158
- NetworkAclEntry
156159
#- NetworkAcl
@@ -230,6 +233,8 @@ operations:
230233
resource_name: LaunchTemplate
231234
DescribeLaunchTemplates:
232235
custom_check_required_fields_missing_method: checkForMissingRequiredFields
236+
DescribeManagedPrefixLists:
237+
custom_check_required_fields_missing_method: checkForMissingRequiredFields
233238
CreateNatGateway:
234239
output_wrapper_field_path: NatGateway
235240
CreateNetworkAcl:
@@ -612,6 +617,83 @@ resources:
612617
template_path: hooks/nat_gateway/sdk_file_end.go.tpl
613618
update_operation:
614619
custom_method_name: customUpdateNATGateway
620+
ManagedPrefixList:
621+
exceptions:
622+
terminal_codes:
623+
- InvalidParameterValue
624+
- PrefixListMaxEntriesExceeded
625+
renames:
626+
operations:
627+
CreateManagedPrefixList:
628+
input_fields:
629+
PrefixListName: Name
630+
output_fields:
631+
PrefixListId: ID
632+
DescribeManagedPrefixLists:
633+
input_fields:
634+
PrefixListIds: ID
635+
output_fields:
636+
PrefixListId: ID
637+
PrefixListName: Name
638+
ModifyManagedPrefixList:
639+
input_fields:
640+
PrefixListId: ID
641+
PrefixListName: Name
642+
output_fields:
643+
PrefixListId: ID
644+
DeleteManagedPrefixList:
645+
input_fields:
646+
PrefixListId: ID
647+
fields:
648+
ID:
649+
is_primary_key: true
650+
is_read_only: true
651+
print:
652+
path: Status.ID
653+
name: ID
654+
Name: {}
655+
State:
656+
is_read_only: true
657+
print:
658+
path: Status.State
659+
name: STATE
660+
Version:
661+
is_read_only: true
662+
print:
663+
path: Status.Version
664+
name: VERSION
665+
PrefixListARN:
666+
is_arn: true
667+
Entries:
668+
custom_field:
669+
list_of: AddPrefixListEntry
670+
compare:
671+
is_ignored: false
672+
Tags:
673+
from:
674+
operation: CreateTags
675+
path: Tags
676+
synced:
677+
when:
678+
- path: Status.State
679+
in:
680+
- create-complete
681+
- create-failed
682+
- modify-complete
683+
- modify-failed
684+
- restore-complete
685+
- restore-failed
686+
- delete-complete
687+
- delete-failed
688+
hooks:
689+
sdk_create_post_build_request:
690+
template_path: hooks/managed_prefix_list/sdk_create_post_build_request.go.tpl
691+
sdk_read_many_post_build_request:
692+
template_path: hooks/managed_prefix_list/sdk_read_many_post_build_request.go.tpl
693+
sdk_read_many_post_set_output:
694+
template_path: hooks/managed_prefix_list/sdk_read_many_post_set_output.go.tpl
695+
update_operation:
696+
custom_method_name: customUpdateManagedPrefixList
615697
RouteTable:
616698
fields:
617699
# RouteStatuses as Route to ensure

apis/v1alpha1/managed_prefix_list.go

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)