Skip to content

Commit aa747d9

Browse files
authored
Generate Instance CRD (#55)
Issue #, if available: aws-controllers-k8s/community#1196 Description of changes: * Instance Controller create/delete functionality with smoke test By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 1fcd9e0 commit aa747d9

29 files changed

+7770
-411
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: "2022-05-10T23:41:20Z"
3-
build_hash: c651d2bb60694df1f7a5dad823258472a1a6fc8a
2+
build_date: "2022-06-02T15:43:18Z"
3+
build_hash: f65a1edc5cee4768ee4fd34b9932799d50c56240
44
go_version: go1.18.1
5-
version: v0.18.4-12-gc651d2b
6-
api_directory_checksum: 1d50f8d633cac0c132fe1f1fb8dad566a20c44db
5+
version: v0.18.4-14-gf65a1ed-dirty
6+
api_directory_checksum: 1d5df6d5b0ea731e73f922da612e643a28ff8ea1
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.42.0
99
generator_config_info:
10-
file_checksum: 0dadc8ea417c3f3bacb05c27d0988207733d4e0f
10+
file_checksum: 89addadb5e22cf16b15db6de95c333a0b53f2a68
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ ignore:
2323
# support EC2-VPC only
2424
- AllocateAddressInput.Domain
2525
- AllocateAddressOutput.Domain
26+
- Instance.ClientToken
27+
- InstanceNetworkInterfaceSpecification.Groups
28+
- RunInstancesInput.AdditionalInfo
29+
- RunInstancesInput.ClientToken
30+
- RunInstancesInput.DryRun
31+
- RunInstancesInput.TagSpecifications
32+
- TerminateInstancesInput.DryRun
2633
resource_names:
2734
- AccountAttribute
2835
- CapacityReservation
@@ -38,7 +45,7 @@ ignore:
3845
- Fleet
3946
- FpgaImage
4047
- Image
41-
- Instance
48+
#- Instance
4249
- InstanceEventWindow
4350
- InstanceExportTask
4451
#- InternetGateway
@@ -111,12 +118,58 @@ operations:
111118
operation_type:
112119
- Delete
113120
resource_name: VpcEndpoint
121+
RunInstances:
122+
#ouput shape: Reservation
123+
output_wrapper_field_path: Instances
124+
operation_type:
125+
- Create
126+
resource_name: Instance
127+
override_values:
128+
# Hard-code MaxCount and MinCount to 1 so the Reservation
129+
# response can only contain a single instance. This
130+
# instance will be managed by the Instance controller.
131+
# Although RunInstances can handle creating multiple
132+
# instances at once (returning them in a single Reservation),
133+
# a Reservation controller does not align with the declarative state model
134+
# in Kubernetes because users would not be able to update the underlying instances.
135+
MaxCount: 1
136+
MinCount: 1
137+
DescribeInstances:
138+
#output shape: DescribeInstancesOutput
139+
output_wrapper_field_path: Reservations.Instances
140+
operation_type:
141+
- List
142+
resource_name: Instance
143+
TerminateInstances:
144+
operation_type:
145+
- Delete
146+
resource_name: Instance
114147
resources:
115148
DhcpOptions:
116149
fields:
117150
DHCPConfigurations.Values:
118151
set:
119152
- from: AttributeValue.Value
153+
Instance:
154+
fields:
155+
HibernationOptions:
156+
late_initialize: {}
157+
MaxCount:
158+
is_required: false
159+
MinCount:
160+
is_required: false
161+
SecurityGroups:
162+
set:
163+
- from: GroupName
164+
Tags:
165+
from:
166+
operation: CreateTags
167+
path: Tags
168+
hooks:
169+
sdk_create_post_build_request:
170+
template_path: hooks/instance/sdk_create_post_build_request.go.tpl
171+
sdk_delete_post_build_request:
172+
template_path: hooks/instance/sdk_delete_post_build_request.go.tpl
120173
ElasticIPAddress:
121174
exceptions:
122175
terminal_codes:

apis/v1alpha1/instance.go

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