aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
68 stars 13 forks source link

Missing AttachmentStatus Available For Internet Gateways #586

Open tlm opened 10 months ago

tlm commented 10 months ago

Describe the bug

The InternetGatewayAttachment struct here https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ec2/types#InternetGatewayAttachment has an State field for the status that reports "available".

However in the provided enums here https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ec2/types#AttachmentStatus there is no enum for "available".

It would be nice to get a strongly typed enum from the API to rely on for checking the value.

Expected Behavior

A typed enum for the value returned from the AWS api.

Current Behavior

No enum currently provided.

Reproduction Steps

N/A

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

v1.111.0 of github.com/aws/aws-sdk-go-v2/service/ec2/types

Compiler and Version used

1.20.0

Operating System and version

darwin

RanVaknin commented 10 months ago

Hi @tlm ,

Im not sure where you see that available is in fact a valid enum type for AttachmentStatus.

The EC2 docs only specify the 4 types (that are currently correctly modeled).

If you are able to make requests with sending available as a valid state, meaning there's service side behavior that supports it, this will be a feature request for the EC2 service team, not the SDK team.

If you didn't know, all the SDKs are code generated from the model of each AWS service. If the upstream model doesn't contain that information, then the SDK wont have that information either.

I suggest you use the AWS console to open a support ticket and ask to raise this as a feature request to the service team.

I'm going to leave this issue open in case you need to clarify something or have additional question, but as it stands, this ticket is not actionable from the SDK team's perspective. Otherwise feel free to close this.

Thanks, Ran~

tlm commented 10 months ago

Thanks @RanVaknin,

The docs you linked to actually state the problem perfectly.

The current state of the attachment. For an internet gateway, the state is available when attached to a VPC; otherwise, this value is not returned.

and then:

Valid Values: attaching | attached | detaching | detached

Both the statements in the docs are in contradiction to one another.

What we see being returned from the API is available. But unlike the rest of the state fields in the package this field is not modeled anyway. It's trivial to make the enum on the consuming side but would be nice to have a strong type to rely on from the library like all the other state/status fields.

RanVaknin commented 10 months ago

Hi @tlm

Thanks for the clarification. I totally agree with you, but as I mentioned this needs to be modeled correctly to be reflected in the SDKs. Usually with bigger modeling issues we cut a ticket to service team but this is an involved and strenuous process. Since the workaround is straightforward (specifying the string "available") I don't think it's something that we can prioritize at the moment.

Im going to move this to the cross SDK repo, if it gains engagement (+1 upvotes / comments) we can prioritize this effort.

Thanks again for your help. All the best, Ran~

ashishdhingra commented 3 months ago

P124948296

ashishdhingra commented 3 months ago

@tlm I have opened an internal ticket with the service team. Would post any updates here as I get them, and would close this issue once it is in the service team's backlog.

ashishdhingra commented 2 months ago

Service team is investigating the issue.