Skip to content

Commit 0acfd55

Browse files
authored
Handle not found errors better in aws_kinesis_consumer and aws_lightsail_instance tables and fix various integration test failures (#2408)
* Fix typo integration test failure * Added comment to the code
1 parent 1002c1e commit 0acfd55

File tree

8 files changed

+19
-6
lines changed

8 files changed

+19
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
null
1+
[]

aws/table_aws_kinesis_consumer.go

+10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package aws
22

33
import (
44
"context"
5+
"errors"
56

67
"github.com/aws/aws-sdk-go-v2/aws"
78
"github.com/aws/aws-sdk-go-v2/service/kinesis"
89
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
10+
"github.com/aws/smithy-go"
911

1012
kinesisv1 "github.com/aws/aws-sdk-go/service/kinesis"
1113

@@ -141,6 +143,14 @@ func listKinesisConsumers(ctx context.Context, d *plugin.QueryData, h *plugin.Hy
141143

142144
output, err := paginator.NextPage(ctx)
143145
if err != nil {
146+
// In the case of parent hydrate the ignore config seems to not work for the child table. So we need to handle it manually.
147+
// Steampipe SDK issue ref: https://github.com/turbot/steampipe-plugin-sdk/issues/544
148+
var ae smithy.APIError
149+
if errors.As(err, &ae) {
150+
if ae.ErrorCode() == "ResourceNotFoundException" {
151+
return nil, nil
152+
}
153+
}
144154
plugin.Logger(ctx).Error("aws_kinesis_consumer.listKinesisConsumers", "api_error", err)
145155
return nil, err
146156
}

aws/table_aws_lightsail_instance.go

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func tableAwsLightsailInstance(_ context.Context) *plugin.Table {
3131
List: &plugin.ListConfig{
3232
Hydrate: listLightsailInstances,
3333
Tags: map[string]string{"service": "lightsail", "action": "GetInstances"},
34+
IgnoreConfig: &plugin.IgnoreConfig{
35+
ShouldIgnoreErrorFunc: shouldIgnoreErrors([]string{"NotFoundException"}),
36+
},
3437
},
3538
HydrateConfig: []plugin.HydrateConfig{
3639
{

0 commit comments

Comments
 (0)