aws / aws-sdk

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

Types for DescribeEnvironmentHealthResult inaccurate (client-elastic-beanstalk) #738

Closed Mat-Hartje closed 1 month ago

Mat-Hartje commented 1 month ago

Checkboxes for prior research

Describe the bug

The typescript types for DescribeEnvironmentHealthResult claim that the only valid values for Status are "Green", "Grey", "Red", or "Yellow". However when invoking the function the values returned in practice are values like "Ready"

The API Reference also seems conflicted: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/elastic-beanstalk/command/DescribeEnvironmentHealthCommand/

image image

SDK version number

@aws-sdk/client-elastic-beanstalk@3.569.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.11.1

Reproduction Steps

var envId = 'SOME_HEALTHY_ENV';

var resp = await beanstalk.describeEnvironmentHealth({
  EnvironmentId: envId,
  AttributeNames: ["Status"]
}); 

console.log(resp.Status);
console.log(resp.Status === 'Green'); //would expect this to be true

// tsc error: This comparison appears to be unintentional because the types 'EnvironmentHealth | undefined' and '"Ready"' have no overlap.
//console.log(resp.Status === 'Ready')

Observed Behavior

Status returned is "Ready"

Expected Behavior

Status returned is aligned with EnvironmentHealth type

Possible Solution

Update types and docs to the "Ready, Launching, Updating, Terminating, or Terminated"

Additional Information/Context

No response

RanVaknin commented 1 month ago

Hi @Mat-Hartje ,

Thanks for reporting this issue. This is a known problem with the beanstalk service API model. It was reported before and we have already created an internal bug report with the beanstalk team.

I have reached out to them internally again to try and get this bug fix expedited, but I can't provide any ETA on this fix. If you have access to AWS support via the developer console I highly recommend creating a ticket with AWS support and referencing this existing issue P70125409.

Thanks, Ran~

RanVaknin commented 1 month ago

Closing because the service team is aware of this and is not actionable by the SDK team.

Thanks, Ran~

github-actions[bot] commented 1 month ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.