Skip to content

Commit bfd9a0a

Browse files
authored
Add RecordSet support for route53 controller (#31)
**Issue**: aws-controllers-k8s/community#1545 **Description of changes**: Adds support for RecordSets in Route53 and corresponding E2E tests. This includes support for all record types and routing policies. Some previous conversations for how to implement this were discussed here: - https://kubernetes.slack.com/archives/C0402D8JJS1/p1694054604699869 - https://kubernetes.slack.com/archives/C0402D8JJS1/p1695030078194489 Changes made to following files/directories (other changes are all code-gen'ed): - generator.yaml - pkg/resource/record_set/hooks.go - templates/hooks/record_set/ - test/e2e/ Generator results: ``` make build-controller SERVICE=route53 building ack-generate ... ok. ==== building route53-controller ==== Copying common custom resource definitions into route53 Building Kubernetes API objects for route53 Generating deepcopy code for route53 Generating custom resource definitions for route53 Building service controller for route53 Generating RBAC manifests for route53 Running gofmt against generated code for route53 Updating additional GitHub repository maintenance files ==== building route53-controller release artifacts ==== Building release artifacts for route53-v0.0.8 Generating common custom resource definitions Generating custom resource definitions for route53 Generating RBAC manifests for route53 ``` E2E results: ``` [gw1] [ 25%] PASSED tests/test_hosted_zone.py::TestHostedZone::test_create_delete_private [gw0] [ 50%] PASSED tests/test_hosted_zone.py::TestHostedZone::test_create_delete_public [gw2] [ 75%] PASSED tests/test_hosted_zone.py::TestHostedZone::test_crud_tags [gw4] [100%] PASSED tests/test_record_set.py::TestRecordSet::test_crud_simple_record ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 92a9e8b commit bfd9a0a

36 files changed

+5224
-89
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-09-14T23:39:01Z"
3-
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
2+
build_date: "2023-11-08T12:14:15Z"
3+
build_hash: 5237888d7dc7edb63fc1b36da5c49e3f258cc45d
44
go_version: go1.21.0
5-
version: v0.27.1
6-
api_directory_checksum: 2f681761d3417cd3c65709b6dc71d9853bdf0481
5+
version: v0.27.1-4-g5237888
6+
api_directory_checksum: 5a419e4b3bdc623d981b9ee5d0ef847bd4dc0bba
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: e4f89494b4e355fb756095b55c95050a23efa0b3
10+
file_checksum: 3120a47920b44a81bac54b6e49261a4592315002
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ignore:
22
field_paths:
3+
- ChangeResourceRecordSetsOutput.ChangeInfo.Comment
34
- CreateHostedZoneInput.CallerReference
45
operations: null
56
resource_names:
@@ -17,12 +18,130 @@ ignore:
1718
shape_names: null
1819
model_name: route53
1920
operations:
21+
ChangeResourceRecordSets:
22+
operation_type:
23+
- Create
24+
- Delete
25+
resource_name:
26+
RecordSet
27+
ListResourceRecordSets:
28+
operation_type:
29+
- List
30+
resource_name:
31+
RecordSet
2032
CreateHostedZone:
2133
output_wrapper_field_path: HostedZone
2234
GetHostedZone:
2335
output_wrapper_field_path: HostedZone
2436
prefix_config: {}
2537
resources:
38+
RecordSet:
39+
exceptions:
40+
terminal_codes:
41+
- InvalidChangeBatch
42+
- InvalidInput
43+
- NoSuchHostedZone
44+
- NoSuchHealthCheck
45+
fields:
46+
AliasTarget:
47+
from:
48+
operation: ChangeResourceRecordSets
49+
path: ChangeBatch.Changes.ResourceRecordSet.AliasTarget
50+
# This field cannot be ignored, but values for this will be overriden and should not be used
51+
ChangeBatch:
52+
is_required: false
53+
CidrRoutingConfig:
54+
from:
55+
operation: ChangeResourceRecordSets
56+
path: ChangeBatch.Changes.ResourceRecordSet.CidrRoutingConfig
57+
Failover:
58+
from:
59+
operation: ChangeResourceRecordSets
60+
path: ChangeBatch.Changes.ResourceRecordSet.Failover
61+
GeoLocation:
62+
from:
63+
operation: ChangeResourceRecordSets
64+
path: ChangeBatch.Changes.ResourceRecordSet.GeoLocation
65+
HealthCheckId:
66+
from:
67+
operation: ChangeResourceRecordSets
68+
path: ChangeBatch.Changes.ResourceRecordSet.HealthCheckId
69+
# Changing this value after a CR has been created could result in orphaned record sets
70+
HostedZoneId:
71+
references:
72+
resource: HostedZone
73+
path: Status.ID
74+
is_required: true
75+
is_immutable: true
76+
ID:
77+
is_primary_key: true
78+
documentation: "ID represents the ChangeID that is returned after a successful
79+
ChangeResourceRecordSet request"
80+
MultiValueAnswer:
81+
from:
82+
operation: ChangeResourceRecordSets
83+
path: ChangeBatch.Changes.ResourceRecordSet.MultiValueAnswer
84+
# Changing this value after a CR has been created could result in orphaned record sets.
85+
# Note that the name refers to the subdomain value of a record set and not the fully
86+
# qualified DNS name
87+
Name:
88+
from:
89+
operation: ChangeResourceRecordSets
90+
path: ChangeBatch.Changes.ResourceRecordSet.Name
91+
is_immutable: true
92+
# Changing this value after a CR has been created could result in orphaned record sets
93+
RecordType:
94+
from:
95+
operation: ChangeResourceRecordSets
96+
path: ChangeBatch.Changes.ResourceRecordSet.Type
97+
is_required: true
98+
is_immutable: true
99+
Region:
100+
from:
101+
operation: ChangeResourceRecordSets
102+
path: ChangeBatch.Changes.ResourceRecordSet.Region
103+
ResourceRecords:
104+
from:
105+
operation: ChangeResourceRecordSets
106+
path: ChangeBatch.Changes.ResourceRecordSet.ResourceRecords
107+
# Changing this value after a CR has been created could result in orphaned record sets
108+
SetIdentifier:
109+
from:
110+
operation: ChangeResourceRecordSets
111+
path: ChangeBatch.Changes.ResourceRecordSet.SetIdentifier
112+
is_immutable: true
113+
Status:
114+
print:
115+
name: STATUS
116+
TTL:
117+
from:
118+
operation: ChangeResourceRecordSets
119+
path: ChangeBatch.Changes.ResourceRecordSet.TTL
120+
Weight:
121+
from:
122+
operation: ChangeResourceRecordSets
123+
path: ChangeBatch.Changes.ResourceRecordSet.Weight
124+
hooks:
125+
sdk_create_post_build_request:
126+
template_path: hooks/record_set/sdk_create_post_build_request.go.tpl
127+
sdk_delete_post_build_request:
128+
template_path: hooks/record_set/sdk_delete_post_build_request.go.tpl
129+
sdk_read_many_post_build_request:
130+
template_path: hooks/record_set/sdk_read_many_post_build_request.go.tpl
131+
sdk_read_many_pre_set_output:
132+
template_path: hooks/record_set/sdk_read_many_pre_set_output.go.tpl
133+
sdk_read_many_post_set_output:
134+
template_path: hooks/record_set/sdk_read_many_post_set_output.go.tpl
135+
list_operation:
136+
match_fields:
137+
- HostedZoneId
138+
- Name
139+
- SetIdentifier
140+
# This resource does not have tags
141+
tags:
142+
ignore: true
143+
update_operation:
144+
custom_method_name: customUpdateRecordSet
26145
HostedZone:
27146
exceptions:
28147
terminal_codes:
@@ -50,7 +169,6 @@ resources:
50169
template_path: hooks/hosted_zone/sdk_file_end.go.tpl
51170
ensure_tags:
52171
template_path: hooks/hosted_zone/sdk_ensure_tags.go.tpl
53-
54172
tags:
55173
ignore: true
56174
update_operation:

0 commit comments

Comments
 (0)