Repository: turbot/steampipe-plugin-aws (language: go)

Issue:
The `aws_kms_key_rotation` table throws `AccessDeniedException` despite the `ignore_error_codes` configuration in the connection config
**Describe the bug**
While querying the table `aws_kms_key_rotation`, I am encountering the error `AccessDeniedException`. This is expected as a resource-based policy is blocking me from making the `ListKeyRotations` API call.

However, I want to ignore these errors by configuring `ignore_error_codes` in the connection config as follows:

```hcl
connection "aws" {
  plugin = "aws"
  regions = ["*"]
  ignore_error_codes = ["AccessDeniedException"]
  # other configurations...
}
```

Despite the `ignore_error_codes` configuration, the table is still throwing the error.

**Steampipe version (`steampipe -v`)**
Example: v0.23.3

**Plugin version (`steampipe plugin list`)**
Example: v0.144.0

**To reproduce**
- You should have a KMS key in your environment with a resource-based policy applied to restrict users from making the `ListKeyRotations` API call.
- Create a connection with a user that is restricted from making the API call.
- Add `ignore_error_codes = ["AccessDeniedException"]` to the connection configuration.
- Run the query `select * from aws_kms_key_rotation`.

**Expected behavior**
The query should not ignore the error if I am configuring the `ignore_error_codes` for my connection.

**Additional context**
N/A


Discussion / hints:

Fix patch:
diff --git a/aws/table_aws_kms_key_rotation.go b/aws/table_aws_kms_key_rotation.go
index 860364599..f636e7a52 100644
--- a/aws/table_aws_kms_key_rotation.go
+++ b/aws/table_aws_kms_key_rotation.go
@@ -2,15 +2,18 @@ package aws
 
 import (
 	"context"
+	"errors"
 	"strings"
 	"time"
 
 	"github.com/aws/aws-sdk-go-v2/aws"
 	"github.com/aws/aws-sdk-go-v2/service/kms"
 	"github.com/aws/aws-sdk-go-v2/service/kms/types"
+	"github.com/aws/smithy-go"
 
 	kmsv1 "github.com/aws/aws-sdk-go/service/kms"
 
+	"github.com/turbot/go-kit/helpers"
 	"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"
 	"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
 	"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"
@@ -138,6 +141,15 @@ func listKmsKeyRotations(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd
 
 		output, err := paginator.NextPage(ctx)
 		if err != nil {
+			// In the case of parent hydrate the ignore config seems to not work for the child table. So we need to handle it manually.
+			// Steampipe SDK issue ref: https://github.com/turbot/steampipe-plugin-sdk/issues/544
+			ignoreCodes := GetConfig(d.Connection).IgnoreErrorCodes
+			var ae smithy.APIError
+			if errors.As(err, &ae) {
+				if helpers.StringSliceContains(ignoreCodes, ae.ErrorCode()){
+					return nil, nil
+				}
+			}
 			plugin.Logger(ctx).Error("aws_kms_key_rotation.listKmsKeyRotations", "api_error", err)
 			return nil, err
 		}


Test patch: