diff --git a/internal/fwserver/server_listresource.go b/internal/fwserver/server_listresource.go index 0acff71c1..74301d39c 100644 --- a/internal/fwserver/server_listresource.go +++ b/internal/fwserver/server_listresource.go @@ -29,6 +29,10 @@ type ListRequest struct { // Resource field in the ListResult struct. IncludeResource bool + // Limit specifies the maximum number of results that Terraform is + // expecting. + Limit int64 + ResourceSchema fwschema.Schema ResourceIdentitySchema fwschema.Schema } @@ -91,6 +95,7 @@ func (s *Server) ListResource(ctx context.Context, fwReq *ListRequest, fwStream req := list.ListRequest{ Config: *fwReq.Config, IncludeResource: fwReq.IncludeResource, + Limit: fwReq.Limit, ResourceSchema: fwReq.ResourceSchema, ResourceIdentitySchema: fwReq.ResourceIdentitySchema, } diff --git a/internal/proto5server/server_listresource.go b/internal/proto5server/server_listresource.go index af85693c4..4c630448e 100644 --- a/internal/proto5server/server_listresource.go +++ b/internal/proto5server/server_listresource.go @@ -65,6 +65,7 @@ func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov5.ListResou ResourceSchema: resourceSchema, ResourceIdentitySchema: identitySchema, IncludeResource: protoReq.IncludeResource, + Limit: protoReq.Limit, } stream := &fwserver.ListResultsStream{} diff --git a/internal/proto6server/server_listresource.go b/internal/proto6server/server_listresource.go index 5a5bf0b4c..8b3352366 100644 --- a/internal/proto6server/server_listresource.go +++ b/internal/proto6server/server_listresource.go @@ -65,6 +65,7 @@ func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov6.ListResou ResourceSchema: resourceSchema, ResourceIdentitySchema: identitySchema, IncludeResource: protoReq.IncludeResource, + Limit: protoReq.Limit, } stream := &fwserver.ListResultsStream{} diff --git a/list/list_resource.go b/list/list_resource.go index 75fdbca07..27843833b 100644 --- a/list/list_resource.go +++ b/list/list_resource.go @@ -99,6 +99,10 @@ type ListRequest struct { // [ListResult.Resource] field. IncludeResource bool + // Limit specifies the maximum number of results that Terraform is + // expecting. + Limit int64 + ResourceSchema fwschema.Schema ResourceIdentitySchema fwschema.Schema }