Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in return type of state method of Aws::EC2::Instance #2812

Closed
sangamcse opened this issue Jan 4, 2023 · 7 comments
Closed

Change in return type of state method of Aws::EC2::Instance #2812

sangamcse opened this issue Jan 4, 2023 · 7 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@sangamcse
Copy link

sangamcse commented Jan 4, 2023

Describe the bug

There has been a sudden change in Aws::EC2::Instance.new('instance_id').state. Doc, as well as the previous response to the API call, was the Aws::EC2::Types::InstanceState format and suddenly it is giving a Hash response.

Expected Behavior

[1] pry(main)> i = Aws::EC2::Instance.new('instance_id')
[2] pry(main)> i.state
=> #<struct Aws::EC2::Types::InstanceState code=16, name="running">

Current Behavior

[1] pry(main)> i = Aws::EC2::Instance.new('instance_id')
[2] pry(main)> i.state
=> {:code=>16, :name=>"running"}

Reproduction Steps

[1] pry(main)> i = Aws::EC2::Instance.new('instance_id')
[2] pry(main)> i.state

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

gem 'aws-sdk-resources', '2.11.363'

Environment details (Version of Ruby, OS environment)

ruby 2.6.3p62
Rails 6.0.5
macOS 13.0.1

@sangamcse sangamcse added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 4, 2023
@mullermp
Copy link
Contributor

mullermp commented Jan 4, 2023

aws-sdk-resources 2.11.363 is from 2019. Are you saying you updated to that version recently and saw the change in type? Or the type changed in the same version?

@sangamcse
Copy link
Author

We have not done any updation recently and using this version since 2019. We saw change on response without doing any version change

@mullermp
Copy link
Contributor

mullermp commented Jan 4, 2023

That's odd. Did your Jmespath gem version change by chance?

@sangamcse
Copy link
Author

Yes, that was changed to 1.6.1 from 1.4.0 recently

@mullermp
Copy link
Contributor

mullermp commented Jan 4, 2023

I can confirm with the latest V3 version and JMESPath that this is not an issue.

[7] pry(Aws)> JMESPath::VERSION
=> "1.6.2"
[8] pry(Aws)> Aws::EC2::Instance.new('i-123').state
[Aws::EC2::Client 200 0.455222 0 retries] describe_instances(instance_ids:["i-123"])  
=> #<struct Aws::EC2::Types::InstanceState code=80, name="stopped">

The issue was introduced in jmespath 1.5.0 only for Ruby SDK V2 - related comment: jmespath/jmespath.rb#51 (comment). We had previously confirmed that V3 and jmespath are backwards compatible after the change.

V2 is deprecated even before we made this change to jmespath. We do not release new versions of v2.

I think you should pin your jmespath version to 1.4.0, or upgrade to V3 of the SDK. V2 to V3 upgrade is mostly backwards compatible and can in most cases be done by changing dependencies and a few config options.

@mullermp mullermp closed this as completed Jan 4, 2023
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

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.

@sangamcse
Copy link
Author

Thank you for the detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants