Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/aws/aws-lambda-go v1.23.0
github.com/cloudquery/cq-provider-sdk v0.8.7
github.com/cloudquery/cq-provider-sdk v0.8.11
github.com/fatih/color v1.13.0
github.com/fsnotify/fsnotify v1.4.9
github.com/golang-migrate/migrate/v4 v4.15.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ
github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cloudquery/cq-provider-sdk v0.8.7 h1:lVduh/Im+WvMBD/BeHbPfBXdaH4CwSrBKyczYm3GQC0=
github.com/cloudquery/cq-provider-sdk v0.8.7/go.mod h1:IHxqY7TOttWhNQhMRqYl1vBo2JS2szLAf5Mhg78MwTQ=
github.com/cloudquery/cq-provider-sdk v0.8.11 h1:uWGd3WjhbOjCnPq2zKbitXF15ATG6XnMItKM2bA2UHM=
github.com/cloudquery/cq-provider-sdk v0.8.11/go.mod h1:IHxqY7TOttWhNQhMRqYl1vBo2JS2szLAf5Mhg78MwTQ=
github.com/cloudquery/faker/v3 v3.7.4 h1:cCcU3r0yHpS0gqKj9rRKAGS0/hY33fBxbqCNFtDD4ec=
github.com/cloudquery/faker/v3 v3.7.4/go.mod h1:1b8WVG9Gh0T2hVo1a8dWeXfu0AhqSB6J/mmJaesqOeo=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand Down
1 change: 1 addition & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ func (c *Client) Fetch(ctx context.Context, request FetchRequest) (res *FetchRes
PartialFetchingEnabled: true,
ParallelFetchingLimit: providerConfig.MaxParallelResourceFetchLimit,
MaxGoroutines: providerConfig.MaxGoroutines,
Timeout: time.Duration(providerConfig.ResourceTimeout) * time.Second,
Metadata: metadata,
})
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions pkg/config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Provider struct {
Configuration []byte
MaxParallelResourceFetchLimit uint64 `hcl:"max_parallel_resource_fetch_limit"`
MaxGoroutines uint64 `hcl:"max_goroutines"`
ResourceTimeout uint64 `hcl:"resource_timeout"`
}

func decodeProviderBlock(block *hcl.Block, ctx *hcl.EvalContext, existingProviders map[string]bool) (*Provider, hcl.Diagnostics) {
Expand Down Expand Up @@ -83,6 +84,10 @@ func decodeProviderBlock(block *hcl.Block, ctx *hcl.EvalContext, existingProvide
valDiags := gohcl.DecodeExpression(attr.Expr, ctx, &provider.MaxGoroutines)
diags = append(diags, valDiags...)
}
if attr, exists := content.Attributes["resource_timeout"]; exists {
valDiags := gohcl.DecodeExpression(attr.Expr, ctx, &provider.ResourceTimeout)
diags = append(diags, valDiags...)
}

for _, block := range content.Blocks {
switch block.Type {
Expand Down Expand Up @@ -128,6 +133,9 @@ var providerBlockSchema = &hcl.BodySchema{
{
Name: "max_goroutines",
},
{
Name: "resource_timeout",
},
},
Blocks: []hcl.BlockHeaderSchema{
// _All_ of these are reserved for future expansion.
Expand Down