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

upgrade aws-sdk-go-v2/service/ssm to latest to gather 'ssm list-inventory-entries' #1880

Closed
7adityaraj opened this issue Aug 22, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@7adityaraj
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Currently, we are using ssm sdk version 1.35.1 ( https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ssm@v1.35.1) whereas the latest is 1.37.2 (https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/ssm@v1.37.2)

We believe that the recent version will allow us to explore more details on inventory details like, 'InstanceDetailedInformation' is not present in 1.35.1 as it shows in response.

Error: operation error SSM: GetInventory, https response error StatusCode: 400, RequestID: ac7b65c2-c644-4191-82fd-7789e06669d2, InvalidResultAttributeException: Result type name AWS:InstanceDetailedInformation is not supported. Supported type names are: AWS:InstanceInformation, AWS:PatchSummary. Default result type name is AWS:InstanceInformation. (SQLSTATE HV000)

The aws cli cmds does provide with correct response.

aws ssm list-inventory-entries --instance-id i-00xyxxyzxyz --type-name AWS:InstanceDetailedInformation
--
{ 
  "TypeName": "AWS:InstanceDetailedInformation", "InstanceId": "i-0023112313cevwss", "SchemaVersion": "1.0", "CaptureTime": 
 "2023-08-22T15:01:28Z", "Entries": [ { "CPUCores": "1", "CPUHyperThreadEnabled": "true", "CPUModel": "Intel(R) Xeon(R) CPU 
 E5-2686 v4 @ 2.30GHz", "CPUSockets": "1", "CPUSpeedMHz": "2300", "CPUs": "2", "KernelVersion": "5.10.186- 179.751.amzn2.x86_64", "OSServicePack": "" } ] 
}

Describe the solution you'd like
A clear and concise description of what you want to happen.

Upgrade to ssm sdk version to latest

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

turbobot community slack > https://turbot-community.slack.com/archives/C01UECB59A7/p1692732645439359

@7adityaraj 7adityaraj added the enhancement New feature or request label Aug 22, 2023
@ParthaI
Copy link
Contributor

ParthaI commented Aug 29, 2023

@7adityaraj, Thank you for bringing up this issue. I delved into the problem further but unfortunately couldn't reproduce the issue. I have a couple of follow-up questions, could you kindly review them?

I ran the AWS CLI command with version (aws-cli/2.13.0 Python/3.11.4 Darwin/22.3.0 source/arm64 prompt/off) got the following error

Command: aws ec2 describe-instances --profile zero-intg-test --instance-id i-0cf3eb1f54441e384 --type-name AWS:InstanceDetailedInformation


usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

Unknown options: --type-name, AWS:InstanceDetailedInformation

With the service package v1.37.5 getting the following error.

Query: select * from aws_zero_intg_test.aws_ssm_inventory where type_name = 'AWS:InstanceDetailedInformation'

Error: operation error SSM: GetInventory, https response error StatusCode: 400, RequestID: 56ef4608-1019-447d-9aea-5f08078b6d56, InvalidResultAttributeException: Result type name AWS:InstanceDetailedInformation is not supported. Supported type names are: AWS:InstanceInformation, AWS:PatchSummary. Default result type name is AWS:InstanceInformation. (SQLSTATE HV000)

+----+-----------+--------------+----------------+---------+--------+-------+-----------+--------+------------+------+
| id | type_name | capture_time | schema_version | content | schema | title | partition | region | account_id | _ctx |
+----+-----------+--------------+----------------+---------+--------+-------+-----------+--------+------------+------+
+----+-----------+--------------+----------------+---------+--------+-------+-----------+--------+------------+------+

Could you please provide more details? This will greatly assist us in further investigating the matter.

@cbruno10
Copy link
Contributor

Hi @7adityaraj , if you're still seeing this issue, please feel free to re-open this issue and if you could have a look at @ParthaI 's questions above, we can investigate more. Thanks!

@cbruno10 cbruno10 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
@7adityaraj
Copy link
Author

Hi @ParthaI @cbruno10 ,

Apologies for the delay.

About the steampipe cmd:

select
*
from
  aws_ssm_inventory as v,
  aws_ec2_instance as i,
  jsonb_array_elements(content) as c
where
  v.id = i.instance_id
  and v.type_name = 'AWS:InstanceDetailedInformation'
  and i.instance_state = 'running';

however I ended up getting the following error -

Error: operation error SSM: GetInventory, https response error StatusCode: 400, RequestID: ac7b65c2-c644-4191-82fd-7789e06669d2, InvalidResultAttributeException: Result type name AWS:InstanceDetailedInformation is not supported. Supported type names are: AWS:InstanceInformation, AWS:PatchSummary. Default result type name is AWS:InstanceInformation. (SQLSTATE HV000)

@ParthaI about the aws cli cmd, i have v2 installed but my cmd is aws ssm whereas you have been trying aws ec2

aws ssm list-inventory-entries --instance-id i-00xyxxyzxyz --type-name AWS:InstanceDetailedInformation

Hope this helps to trace the issue.

cc: @misraved

@cbruno10 cbruno10 reopened this Sep 15, 2023
@bigdatasourav
Copy link
Contributor

bigdatasourav commented Nov 6, 2023

Hey @7adityaraj, I have tried the above with the latest version - ssm@v1.42.0 but getting the same error-

select
*
from
  aws_ssm_inventory as v,
  aws_ec2_instance as i,
  jsonb_array_elements(content) as c
where
  v.id = i.instance_id
  and v.type_name = 'AWS:InstanceDetailedInformation'
  and i.instance_state = 'running';
  
 Error: operation error SSM: GetInventory, https response error StatusCode: 400, RequestID: e0554ba5-2479-4a3b-ab7d-4a0deebf88f5, InvalidResultAttributeException: Result type name AWS:InstanceDetailedInformation is not supported. Supported type names are: AWS:InstanceInformation, AWS:PatchSummary. Default result type name is AWS:InstanceInformation.

It looks like InstanceDetailedInformation is yet to be supported in the API.

We're closing this issue for now and will revisit it once API support becomes available. Please feel free to reopen the issue if you have any new information or contributions to share.

@bigdatasourav bigdatasourav closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@bigdatasourav
Copy link
Contributor

Raise an SDK issue to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants