Skip to content

describeInstanceStatus missing InstanceState in v3.351.x (works in v3.324.11) #3155

@rishubhgarg

Description

@rishubhgarg

Describe the bug

When using the AWS SDK for PHP version 3.351.10, the response from describeInstanceStatus does not include the InstanceState field — even for a running instance. The same API call returns full details including InstanceState when using version 3.324.11.

Notably, this regression occurs even without setting IncludeAllInstances => true, meaning the SDK version itself is changing the parsing or filtering behavior.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

InstanceState should be present in the InstanceStatuses response object — particularly for running instances — as it is part of the documented EC2 API response model for describeInstanceStatus.

Output in 3.324.11 (Correct)
{
  "AvailabilityZone": "eu-west-1b",
  "InstanceId": "i-0e2eb48368d9d066f",
  "InstanceState": {"Code": 16, "Name": "running"},
  "InstanceStatus": {
    "Details": [{"Name": "reachability", "Status": "passed"}],
    "Status": "ok"
  },
  "SystemStatus": {
    "Details": [{"Name": "reachability", "Status": "passed"}],
    "Status": "ok"
  },
  "AttachedEbsStatus": {
    "Details": [{"Name": "reachability", "Status": "passed"}],
    "Status": "ok"
  }
}

Current Behavior

InstanceState is missing in the InstanceStatuses response object even for running instances (even which are running for a while).

Output in 3.351.10 (Buggy)
{
  "AvailabilityZone": "eu-west-1b",
  "InstanceId": "i-0e2eb48368d9d066f"
}

Reproduction Steps

$ec2 = new Aws\Ec2\Ec2Client([
    'version' => 'latest',
    'region'  => 'eu-west-1'
]);

$ret = $ec2->describeInstanceStatus([
    'InstanceIds' => ['i-0e2eb48368d9d066f']
]);

error_log("inst : " . json_encode($ret['InstanceStatuses']));

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.351.10

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP 8.2.21 (cli) (built: Jul 2 2024 12:51:54) (NTS gcc x86_64)

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.potential-regressionMarking this issue as a potential regression to be checked by team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions