Skip to content

Commit 5414fc2

Browse files
authored
Update functionality for Subnet settings (#101)
Issue #, if available: aws-controllers-k8s/community#1203 Description of changes: Updates `Subnet.Spec` fields, hooks, templates, and tests to align with `Subnet > Edit subnet settings` console functionality By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 550df47 commit 5414fc2

File tree

14 files changed

+411
-108
lines changed

14 files changed

+411
-108
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-09-30T18:33:33Z"
3-
build_hash: 6e2ffbc3b16a30ac59be6719918c601c2c864064
2+
build_date: "2022-10-05T16:31:59Z"
3+
build_hash: 5ee0ac052c54f008dff50f6f5ebb73f2cf3a0bd7
44
go_version: go1.18.1
5-
version: v0.20.1-3-g6e2ffbc
6-
api_directory_checksum: 127aa0f51fbcdde596b8f42f93bcdf3b6dee8488
5+
version: v0.20.1-4-g5ee0ac0
6+
api_directory_checksum: 1c3549b0567c7f33a4a331c980a5c460154c32e0
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 100888fa9c8d854c46c386442c6e7e06e34940cf
10+
file_checksum: 8797fe03195c58e4386f043a7a3d76d0c33c69e6
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,26 @@ resources:
410410
custom_method_name: customUpdateSecurityGroup
411411
Subnet:
412412
fields:
413+
# code-generator infers fields into
414+
# Status based on whether or not the fields
415+
# can be edited in the Create input shape.
416+
# However, these fields can now be edited after
417+
# after implementing custom hook code; therefore,
418+
# relocate fields from Status to Spec.
419+
AssignIpv6AddressOnCreation:
420+
type: bool
421+
CustomerOwnedIpv4Pool:
422+
type: string
423+
EnableDns64:
424+
type: bool
425+
EnableResourceNameDnsARecord:
426+
type: bool
427+
EnableResourceNameDnsAAAARecord:
428+
type: bool
429+
HostnameType:
430+
type: string
431+
MapPublicIpOnLaunch:
432+
type: bool
413433
RouteTables:
414434
custom_field:
415435
list_of: String
@@ -427,6 +447,7 @@ resources:
427447
exceptions:
428448
terminal_codes:
429449
- InvalidParameterValue
450+
- InvalidCustomerOwnedIpv4PoolID.Malformed
430451
hooks:
431452
sdk_create_post_build_request:
432453
template_path: hooks/subnet/sdk_create_post_build_request.go.tpl

apis/v1alpha1/subnet.go

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

apis/v1alpha1/types.go

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

apis/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/ec2.services.k8s.aws_subnets.yaml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ spec:
3636
description: "SubnetSpec defines the desired state of Subnet. \n Describes
3737
a subnet."
3838
properties:
39+
assignIPv6AddressOnCreation:
40+
type: boolean
3941
availabilityZone:
4042
description: "The Availability Zone or Local Zone for the subnet.
4143
\n Default: Amazon Web Services selects one for you. If you create
@@ -58,6 +60,16 @@ spec:
5860
we modify it to 100.68.0.0/18. \n This parameter is not supported
5961
for an IPv6 only subnet."
6062
type: string
63+
customerOwnedIPv4Pool:
64+
type: string
65+
enableDNS64:
66+
type: boolean
67+
enableResourceNameDNSAAAARecord:
68+
type: boolean
69+
enableResourceNameDNSARecord:
70+
type: boolean
71+
hostnameType:
72+
type: string
6173
ipv6CIDRBlock:
6274
description: "The IPv6 network range for the subnet, in CIDR notation.
6375
The subnet size must use a /64 prefix length. \n This parameter
@@ -66,6 +78,8 @@ spec:
6678
ipv6Native:
6779
description: Indicates whether to create an IPv6 only subnet.
6880
type: boolean
81+
mapPublicIPOnLaunch:
82+
type: boolean
6983
outpostARN:
7084
description: The Amazon Resource Name (ARN) of the Outpost. If you
7185
specify an Outpost ARN, you must also specify the Availability Zone
@@ -152,11 +166,6 @@ spec:
152166
- ownerAccountID
153167
- region
154168
type: object
155-
assignIPv6AddressOnCreation:
156-
description: Indicates whether a network interface created in this
157-
subnet (including a network interface created by RunInstances) receives
158-
an IPv6 address.
159-
type: boolean
160169
availableIPAddressCount:
161170
description: The number of unused private IPv4 addresses in the subnet.
162171
The IPv4 addresses for any stopped instances are considered unavailable.
@@ -195,20 +204,11 @@ spec:
195204
- type
196205
type: object
197206
type: array
198-
customerOwnedIPv4Pool:
199-
description: The customer-owned IPv4 address pool associated with
200-
the subnet.
201-
type: string
202207
defaultForAZ:
203208
description: Indicates whether this is the default subnet for the
204209
Availability Zone.
205210
type: boolean
206-
enableDNS64:
207-
description: Indicates whether DNS queries made to the Amazon-provided
208-
DNS Resolver in this subnet should return synthetic IPv6 addresses
209-
for IPv4-only destinations.
210-
type: boolean
211-
enableLniAtDeviceIndex:
211+
enableLNIAtDeviceIndex:
212212
description: Indicates the device position for local network interfaces
213213
in this subnet. For example, 1 indicates local network interfaces
214214
in this subnet are the secondary network interface (eth1).
@@ -240,10 +240,6 @@ spec:
240240
subnet (including a network interface created by RunInstances) receives
241241
a customer-owned IPv4 address.
242242
type: boolean
243-
mapPublicIPOnLaunch:
244-
description: Indicates whether instances launched in this subnet receive
245-
a public IPv4 address.
246-
type: boolean
247243
ownerID:
248244
description: The ID of the Amazon Web Services account that owns the
249245
subnet.

generator.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,26 @@ resources:
410410
custom_method_name: customUpdateSecurityGroup
411411
Subnet:
412412
fields:
413+
# code-generator infers fields into
414+
# Status based on whether or not the fields
415+
# can be edited in the Create input shape.
416+
# However, these fields can now be edited after
417+
# after implementing custom hook code; therefore,
418+
# relocate fields from Status to Spec.
419+
AssignIpv6AddressOnCreation:
420+
type: bool
421+
CustomerOwnedIpv4Pool:
422+
type: string
423+
EnableDns64:
424+
type: bool
425+
EnableResourceNameDnsARecord:
426+
type: bool
427+
EnableResourceNameDnsAAAARecord:
428+
type: bool
429+
HostnameType:
430+
type: string
431+
MapPublicIpOnLaunch:
432+
type: bool
413433
RouteTables:
414434
custom_field:
415435
list_of: String
@@ -427,6 +447,7 @@ resources:
427447
exceptions:
428448
terminal_codes:
429449
- InvalidParameterValue
450+
- InvalidCustomerOwnedIpv4PoolID.Malformed
430451
hooks:
431452
sdk_create_post_build_request:
432453
template_path: hooks/subnet/sdk_create_post_build_request.go.tpl

0 commit comments

Comments
 (0)