Open nmesika-te opened 1 month ago
Here's the code I used to reproduce the issue (and a similar issue with internet gateways which was apparently reported for the go-sdk as well.
https://github.com/nmesika-te/aws-sdk-test/blob/main/src/main/java/org/example/Main.java#L24
Hi @nmesika-te,
Thank you for reporting this issue. I am able to reproduce this scenario, where I get a NULL
value for EC2's DescribeNetworkInterfaces
[interfaceType()](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/ec2/model/NetworkInterface.html#interfaceType()) call for nat_gateway
.
These enumeration constants are generated from service model shared by EC2 service team. I will submit an internal ticket to the service team for further investigation and fix.
Also, since this something that has to be fixed at service level, I will transfer this to our Shared SDK repo for further tracking purpose.
Regards, Chaitanya
V1454285308
Describe the bug
When issuing an ec2::DescribeNetworkInterfaces, the returned NetworkInterfaceType is a string that the sdk can convert to an Enum using an internal map. However, the value returned by the API for Nat Gateway does not match the value in the map. The result is that the Enum value returned does not correctly reflect the type of the interface (an "unknown to sdk" Enum value is returned)
Here are the returned values from
services/ec2/src/main/resources/codegen-resources/service-2.json:46316
:Note that
natGateway
is camel cased while the others use underscores. Following is the the XML response from the AWS API for a specific interface. Note the last line<interfaceType>nat_gateway</interfaceType>
Expected Behavior
The Network Interface Type should resolve to NAT_GATEWAY.
Current Behavior
The Network Interface Type resolves to UNKNOWN_TO_SDK_VERSION
Reproduction Steps
Response is:
Indicating that the string internally stored by the SDK is
nat_gateway
and the convertion to Enum fails. This is due to the incorrect string defined here:Possible Solution
Update
services/ec2/src/main/resources/codegen-resources/service-2.json:46316 to replace
"natGateway"with
"nat_gateway"`.Additional Information/Context
No response
AWS Java SDK version used
2.26.18
JDK version used
openjdk version "17.0.9" 2023-10-17
Operating System and version
Linux 5.10.219-208.866.amzn2.x86_64 aws/aws-sdk-java-v2#1 SMP Tue Jun 18 14:00:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux