Skip to content

Commit d037f58

Browse files
authored
feat(VPCEndpointService): add custom resource and allowedPrincipals functionality (#172)
Related to: - aws-controllers-k8s/community#1711 Description of changes: This is the continuation of PR #134 (Credit to @ib-ak !). This PR: - Adds the `VPCEndpointService` custom resource from the code-generator - Adds the field `spec.allowedPrincipals` of type `[]string`, which allows the user to specify a list of ARNs to share the VPC Endpoint Service with. Any Principals added to this list will have the VPC Endpoint Service shared with them. This field also ensures that Principals that are removed from the list have the VPC Endpoint Service share removed. - Tests are added for creation/deletion and for adding/deleting Principals to the Allowed List By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d44c830 commit d037f58

36 files changed

+3260
-22
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: "2023-12-21T23:08:47Z"
3-
build_hash: 1f16813c807af6889060b4ce7ded2a69dc027d8c
2+
build_date: "2024-01-03T22:47:06Z"
3+
build_hash: 00e081fb541587f33970ad80c99f2ac02e9c2525
44
go_version: go1.21.5
5-
version: v0.28.0
6-
api_directory_checksum: d452bf19bfd1496aacdc215bf7cc9ea86c55c122
5+
version: v0.28.0-8-g00e081f
6+
api_directory_checksum: 8b27f9e65dbad1f5f825c84d1dbe8fd333baf2a5
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 0ea278e11a33d237e88a1bcdca878656a8ba43f9
10+
file_checksum: 216d65c35dbc73d4eaaa52c2f5c84444abf4a960
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ ignore:
3636
- CreateVpcEndpointInput.DryRun
3737
- CreateVpcEndpointInput.TagSpecifications
3838
- CreateVpcEndpointInput.ClientToken
39+
- CreateVpcEndpointServiceConfigurationInput.ClientToken
40+
- CreateVpcEndpointServiceConfigurationInput.DryRun
41+
- CreateVpcEndpointServiceConfigurationInput.TagSpecifications
3942
- CreateVpcPeeringConnectionInput.DryRun
4043
- CreateVpcPeeringConnectionInput.TagSpecifications
4144
- DeleteRouteInput.DryRun
@@ -130,7 +133,7 @@ ignore:
130133
- VerifiedAccessTrustProvider
131134
- Volume
132135
- VpcEndpointConnectionNotification
133-
- VpcEndpointServiceConfiguration
136+
#- VpcEndpointServiceConfiguration
134137
#- VpcEndpoint
135138
#- Vpc
136139
- VpcCidrBlock
@@ -162,6 +165,18 @@ operations:
162165
operation_type:
163166
- Delete
164167
resource_name: VpcEndpoint
168+
CreateVpcEndpointServiceConfiguration:
169+
output_wrapper_field_path: ServiceConfiguration
170+
DeleteVpcEndpointServiceConfigurations:
171+
operation_type:
172+
- Delete
173+
resource_name: VpcEndpointServiceConfiguration
174+
CreateVpcEndpointServiceConfiguration:
175+
output_wrapper_field_path: ServiceConfiguration
176+
DeleteVpcEndpointServiceConfigurations:
177+
operation_type:
178+
- Delete
179+
resource_name: VpcEndpointServiceConfiguration
165180
CreateFlowLogs:
166181
operation_type:
167182
- Create
@@ -802,6 +817,45 @@ resources:
802817
template_path: hooks/vpc_endpoint/sdk_file_end.go.tpl
803818
update_operation:
804819
custom_method_name: customUpdateVPCEndpoint
820+
VpcEndpointServiceConfiguration:
821+
fields:
822+
AllowedPrincipals:
823+
from:
824+
operation: ModifyVpcEndpointServicePermissions
825+
path: AddAllowedPrincipals
826+
ServiceID:
827+
is_primary_key: true
828+
is_read_only: true
829+
print:
830+
path: Status.serviceID
831+
name: ServiceID
832+
ServiceState:
833+
is_read_only: true
834+
print:
835+
path: Status.serviceState
836+
name: ServiceState
837+
Tags:
838+
from:
839+
operation: CreateTags
840+
path: Tags
841+
compare:
842+
is_ignored: true
843+
synced:
844+
when:
845+
- path: Status.ServiceState
846+
in:
847+
- available
848+
hooks:
849+
delta_pre_compare:
850+
code: compareTags(delta, a, b)
851+
sdk_delete_post_build_request:
852+
template_path: hooks/vpc_endpoint_service_configuration/sdk_delete_post_build_request.go.tpl
853+
sdk_file_end:
854+
template_path: hooks/vpc_endpoint_service_configuration/sdk_file_end.go.tpl
855+
sdk_update_pre_build_request:
856+
template_path: hooks/vpc_endpoint_service_configuration/sdk_update_pre_build_request.go.tpl
857+
sdk_read_many_post_set_output:
858+
template_path: hooks/vpc_endpoint_service_configuration/sdk_read_many_post_set_output.go.tpl
805859
VpcPeeringConnection:
806860
fields:
807861
VpcId:

apis/v1alpha1/types.go

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

apis/v1alpha1/vpc_endpoint_service_configuration.go

Lines changed: 114 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)