Skip to content

Commit c90d50e

Browse files
Add ElasticIPAddress CRD (#39)
Issue #, if available: aws-controllers-k8s/community#1218 Description of changes: Creates the `ElasticIPAddress` custom resource, from `AllocateAddress` and `DeallocateAddress`. This API uses either `AllocationID` or `PublicIP` as the identifier depending on whether the domain is set to `"vpc"` (for EC2-VPC) or otherwise (for EC2-Classic), respectively. For the adoption, I have chosen to set `AllocationID` as the primary key for now, since EC2-VPC is the recommended method for managing resources in EC2. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent aaafa24 commit c90d50e

30 files changed

+2226
-10
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2022-03-14T23:35:32Z"
2+
build_date: "2022-03-15T18:06:47Z"
33
build_hash: 00cd850c16117752abe18558326a508436565b1a
44
go_version: go1.17.8
55
version: v0.17.2
6-
api_directory_checksum: 45311575b1cf56326ccad9a2caea143fc104b630
6+
api_directory_checksum: 380fda39b038b24d5cb78d2680fdfd8f3ac42607
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.42.0
99
generator_config_info:
10-
file_checksum: b588c7e44229d7db3737b17b76a68708c71e5b68
10+
file_checksum: 8f2761c7fff3c2af0a06aa95685d7a47b8a69345
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/elastic_ip_address.go

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

apis/v1alpha1/generator.yaml

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ignore:
33
- ModifyTransitGateway
44
- ModifyVpcEndpoint
55
field_paths:
6+
- AllocateAddressInput.DryRun
67
- CreateDhcpOptionsInput.DryRun
78
- CreateInternetGatewayInput.DryRun
89
- CreateRouteInput.DryRun
@@ -17,6 +18,9 @@ ignore:
1718
- DeleteRouteInput.RouteTableId
1819
# support EC2-VPC only
1920
- DeleteSecurityGroupInput.GroupName
21+
# support EC2-VPC only
22+
- AllocateAddressInput.Domain
23+
- AllocateAddressOutput.Domain
2024
resource_names:
2125
- AccountAttribute
2226
- CapacityReservation
@@ -85,13 +89,24 @@ ignore:
8589
- VpnGateway
8690

8791
operations:
92+
AllocateAddress:
93+
operation_type:
94+
- Create
95+
resource_name: ElasticIPAddress
96+
DescribeAddresses:
97+
operation_type:
98+
- List
99+
resource_name: ElasticIPAddress
100+
ReleaseAddress:
101+
operation_type:
102+
- Delete
103+
resource_name: ElasticIPAddress
88104
CreateVpcEndpoint:
89105
output_wrapper_field_path: VpcEndpoint
90106
DeleteVpcEndpoints:
91107
operation_type:
92108
- Delete
93109
resource_name: VpcEndpoint
94-
95110
resources:
96111
DhcpOptions:
97112
fields:
@@ -131,6 +146,47 @@ resources:
131146
template_path: hooks/route_table/sdk_file_end.go.tpl
132147
update_operation:
133148
custom_method_name: customUpdateRouteTable
149+
ElasticIPAddress:
150+
exceptions:
151+
terminal_codes:
152+
- IdempotentParameterMismatch
153+
- InvalidAction
154+
- InvalidCharacter
155+
- InvalidClientTokenId
156+
- InvalidPaginationToken
157+
- InvalidParameter
158+
- InvalidParameterCombination
159+
- InvalidParameterValue
160+
- InvalidQueryParameter
161+
- MalformedQueryString
162+
- MissingAction
163+
- MissingAuthenticationToken
164+
- MissingParameter
165+
- UnknownParameter
166+
- UnsupportedInstanceAttribute
167+
- UnsupportedOperation
168+
- UnsupportedProtocol
169+
- ValidationError
170+
fields:
171+
AllocationId:
172+
is_primary_key: true
173+
print:
174+
name: ALLOCATION-ID
175+
PublicIp:
176+
print:
177+
name: PUBLIC-IP
178+
list_operation:
179+
match_fields:
180+
- AllocationId
181+
hooks:
182+
sdk_create_post_build_request:
183+
template_path: hooks/elastic_ip_address/sdk_create_post_build_request.go.tpl
184+
sdk_delete_post_build_request:
185+
template_path: hooks/elastic_ip_address/sdk_delete_post_build_request.go.tpl
186+
sdk_read_many_pre_build_request:
187+
template_path: hooks/elastic_ip_address/sdk_read_many_pre_build_request.go.tpl
188+
sdk_read_many_post_build_request:
189+
template_path: hooks/elastic_ip_address/sdk_read_many_post_build_request.go.tpl
134190
SecurityGroup:
135191
fields:
136192
# support EC2-VPC only
@@ -216,5 +272,4 @@ resources:
216272
- InvalidServiceName
217273
hooks:
218274
sdk_delete_post_build_request:
219-
template_path: hooks/vpc_endpoint/sdk_delete_post_build_request.go.tpl
220-
275+
template_path: hooks/vpc_endpoint/sdk_delete_post_build_request.go.tpl

apis/v1alpha1/types.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)