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

Matrix queries (e.g. multi-region) should take matrix quals into account for get calls #78

Closed
e-gineer opened this issue Mar 28, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@e-gineer
Copy link
Contributor

Multi-region matrix queries do not work with Get calls? (They do work with List calls.)

~/src/steampipe-plugin-aws $ steampipe query
Welcome to Steampipe v0.3.3
For more information, type .help
> 
> select vpc_id, region from aws_vpc
+--------------+-----------+
| vpc_id       | region    |
+--------------+-----------+
| vpc-a7025cc0 | us-east-1 |
| vpc-82fc47e7 | us-east-1 |
| vpc-abb765ce | us-west-2 |
| vpc-87389aef | eu-west-2 |
| vpc-3cd69054 | us-east-2 |
| vpc-7032c619 | us-east-2 |
| vpc-af92a1d4 | us-east-1 |
| vpc-12947a7b | eu-west-2 |
| vpc-6f2d5c09 | eu-west-1 |
| vpc-0434cd61 | us-west-1 |
| vpc-fb848d9e | eu-west-1 |
+--------------+-----------+
> 
> select vpc_id, region from aws_vpc where region = 'us-east-1'
+--------------+-----------+
| vpc_id       | region    |
+--------------+-----------+
| vpc-af92a1d4 | us-east-1 |
| vpc-a7025cc0 | us-east-1 |
| vpc-82fc47e7 | us-east-1 |
+--------------+-----------+
> 
> select vpc_id, region from aws_vpc where region = 'us-east-1' and vpc_id = 'vpc-82fc47e7'
Error: 5 list calls returned errors:
 InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 575ca40e-28ef-4dc6-8e03-572edef07b1a
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: fc14008d-abca-4393-a72f-381246aa7285
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 4b8a6bf1-3b90-499f-8eb9-f30079b4b1e7
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 13ddf844-a3b9-40ec-b992-19c7c999d114
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 6af99985-3e22-474f-b9ac-ba39d8d0de58
> 
> select vpc_id, region from aws_vpc where vpc_id = 'vpc-82fc47e7'
Error: 5 list calls returned errors:
 InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 212b7bac-ac27-47ac-9803-05c8d4d5e3a9
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 575569b8-084a-462d-9d11-11f0a81f49b6
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 1cefe18c-d980-4e87-9fab-ede8295d27de
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: fa71d5e4-fc1b-444e-87c5-0b9ce339a066
InvalidVpcID.NotFound: The vpc ID 'vpc-82fc47e7' does not exist
	status code: 400, request id: 08b97a09-cd51-4864-877b-687329d0b5a6
> 
> 
@e-gineer e-gineer added the bug Something isn't working label Mar 28, 2021
@kaidaguerre
Copy link
Contributor

kaidaguerre commented Mar 29, 2021

this is actually a plugin issue - the aws_vpc table does not have the correct NOT FOUND error mapped
It has:

		ShouldIgnoreError: isNotFoundError([]string{"NotFoundException"}),

however we are getting the not found error InvalidVpcID.NotFound

I have raised a plugin issue for this
turbot/steampipe-plugin-aws#265

@kaidaguerre
Copy link
Contributor

after plugin patch:

after plugin patch:
> select vpc_id, region from aws_vpc
+-----------------------+-----------+
| vpc_id                | region    |
+-----------------------+-----------+
| vpc-05c3c5299169085b3 | us-east-1 |
| vpc-0f737fb94b08cd0aa | us-east-1 |
| vpc-50db6f28          | us-west-2 |
| vpc-0aac7d637bb372d77 | us-west-2 |
| vpc-03f482a1b7d24d6ed | us-west-2 |
+-----------------------+-----------+
> select vpc_id, region from aws_vpc where vpc_id='vpc-05c3c5299169085b3'
+-----------------------+-----------+
| vpc_id                | region    |
+-----------------------+-----------+
| vpc-05c3c5299169085b3 | us-east-1 |
+-----------------------+-----------+
> 

@kaidaguerre kaidaguerre reopened this Mar 30, 2021
@kaidaguerre kaidaguerre changed the title Matrix queries (e.g. multi-region) should work with quals on the region in get calls Matrix queries (e.g. multi-region) should take matrix quals into account for get calls Mar 30, 2021
@kaidaguerre
Copy link
Contributor

for list calls, we take quals into account and if a region is specified only call list in that region.

However this optimisation was missing for get calls - add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants