Skip to content

Commit

Permalink
Add support for connection key columns and recompile plugin with Stea…
Browse files Browse the repository at this point in the history
…mpipe plugin SDK v5.10.0(#2133)


Co-authored-by: misraved <[email protected]>
  • Loading branch information
kaidaguerre and misraved authored Apr 19, 2024
1 parent df91aee commit 72bb146
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 97 deletions.
15 changes: 15 additions & 0 deletions aws/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func Plugin(ctx context.Context) *plugin.Plugin {
DefaultIgnoreConfig: &plugin.IgnoreConfig{
ShouldIgnoreErrorFunc: shouldIgnoreErrorPluginDefault(),
},
ConnectionKeyColumns: []plugin.ConnectionKeyColumn{
{
Name: "account_id",
Hydrate: accountIdForConnection,
},
},
ConnectionConfigSchema: &plugin.ConnectionConfigSchema{
NewInstance: ConfigInstance,
},
Expand Down Expand Up @@ -556,3 +562,12 @@ func Plugin(ctx context.Context) *plugin.Plugin {

return p
}

func accountIdForConnection(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (any, error) {
commonColumnData, err := getCommonColumnsMemoized(ctx, d, h)
if err != nil {
return nil, err
}

return commonColumnData.(*awsCommonColumnData).AccountId, nil
}
72 changes: 41 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/turbot/steampipe-plugin-aws

go 1.21
go 1.21.0

toolchain go1.21.3

require (
github.com/aws/aws-sdk-go v1.51.19
Expand Down Expand Up @@ -128,23 +130,31 @@ require (
github.com/aws/smithy-go v1.20.2
github.com/gocarina/gocsv v0.0.0-20201208093247-67c824bc04d4
github.com/goccy/go-yaml v1.11.3
github.com/golang/protobuf v1.5.3
github.com/golang/protobuf v1.5.4
github.com/hashicorp/go-hclog v1.6.2
github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529
github.com/turbot/go-kit v0.9.0
github.com/turbot/steampipe-plugin-sdk/v5 v5.9.0
github.com/turbot/go-kit v0.10.0-rc.0
github.com/turbot/steampipe-plugin-sdk/v5 v5.10.0
golang.org/x/sync v0.6.0
golang.org/x/text v0.14.0
)

require golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect

require (
cloud.google.com/go v0.111.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
)

require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/allegro/bigcache/v3 v3.1.0 // indirect
Expand Down Expand Up @@ -180,12 +190,12 @@ require (
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
Expand All @@ -194,7 +204,7 @@ require (
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/hcl/v2 v2.20.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -219,29 +229,29 @@ require (
github.com/stevenle/topsort v0.2.0 // indirect
github.com/tkrajina/go-reflector v0.5.6 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/sdk v1.23.1 // indirect
go.opentelemetry.io/otel/sdk/metric v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.149.0 // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 72bb146

Please sign in to comment.