From ee02daf7c0dba7827614d1310dfc5dbc3871ee6c Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Mon, 25 Nov 2024 14:44:17 -0500 Subject: [PATCH 1/5] APP-15799 - Update gql and regen --- README.md | 4 +++ jupiterone/internal/client/dashboard.graphql | 23 +++++++------ jupiterone/internal/client/generated.go | 34 +++++++++++++++++-- .../internal/client/integration.graphql | 11 +++--- 4 files changed, 54 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 618c32fa..f9e230e6 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,10 @@ scripts/get_current_schema.bash make generate-client ``` +**NOTE**: If you are getting errors like this: `for is only applicable to operations and arguments`, check whether formatting has changed in the gql file in question. If the formatting has changed, you may be running into the issue documented in this thread: https://github.com/Khan/genqlient/issues/149#issuecomment-958150171 + +--- + ### Testing In order to test the provider, you can simply run `make testacc`. Pre-recorded diff --git a/jupiterone/internal/client/dashboard.graphql b/jupiterone/internal/client/dashboard.graphql index c9c96969..feb3bbac 100644 --- a/jupiterone/internal/client/dashboard.graphql +++ b/jupiterone/internal/client/dashboard.graphql @@ -2,21 +2,21 @@ query GetDashboard($dashboardId: String!) { getDashboard(dashboardId: $dashboardId) { id name + resourceGroupId } } # @genqlient(for: "CreateInsightsDashboardInput.layouts", omitempty: true, pointer:true) # @genqlient(for: "CreateInsightsDashboardInput.category", omitempty: true) # @genqlient(for: "CreateInsightsDashboardInput.dashboardId", omitempty: true) +# @genqlient(for: "CreateInsightsDashboardInput.resourceGroupId", omitempty: true) mutation CreateDashboard( - $input: CreateInsightsDashboardInput! -) { - createDashboard( - input: $input - ) { - name - id - } + $input: CreateInsightsDashboardInput! + ) { + createDashboard(input: $input) { + name + id + } } mutation DeleteDashboard($dashboardId: String!) { @@ -27,11 +27,12 @@ mutation DeleteDashboard($dashboardId: String!) { # @genqlient(for: "PatchInsightsDashboardInput.layouts", omitempty: true, pointer:true) # @genqlient(for: "PatchInsightsDashboardInput.category", omitempty: true) +# @genqlient(for: "PatchInsightsDashboardInput.resourceGroupId", omitempty: true) mutation UpdateDashboard( - $input: PatchInsightsDashboardInput! -) { + $input: PatchInsightsDashboardInput! + ) { patchDashboard(input: $input) { id name } -} \ No newline at end of file +} diff --git a/jupiterone/internal/client/generated.go b/jupiterone/internal/client/generated.go index 7723703f..3d3e1f7a 100644 --- a/jupiterone/internal/client/generated.go +++ b/jupiterone/internal/client/generated.go @@ -589,6 +589,7 @@ type CreateInsightsDashboardInput struct { PublishedToUserIds []string `json:"publishedToUserIds"` PublishedToGroupIds []string `json:"publishedToGroupIds"` Ttd int64 `json:"ttd"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` } // GetDashboardId returns CreateInsightsDashboardInput.DashboardId, and is useful for accessing the field via an interface. @@ -631,6 +632,9 @@ func (v *CreateInsightsDashboardInput) GetPublishedToGroupIds() []string { // GetTtd returns CreateInsightsDashboardInput.Ttd, and is useful for accessing the field via an interface. func (v *CreateInsightsDashboardInput) GetTtd() int64 { return v.Ttd } +// GetResourceGroupId returns CreateInsightsDashboardInput.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *CreateInsightsDashboardInput) GetResourceGroupId() string { return v.ResourceGroupId } + type CreateInsightsDashboardLayoutConfig struct { Xs []CreateInsightsDashboardLayoutItem `json:"xs"` Sm []CreateInsightsDashboardLayoutItem `json:"sm"` @@ -867,6 +871,7 @@ type CreateIntegrationInstanceInput struct { OffsiteComplete bool `json:"offsiteComplete,omitempty"` IngestionSourcesOverrides []IngestionSourcesOverridesInput `json:"ingestionSourcesOverrides,omitempty"` CollectorPoolId string `json:"collectorPoolId,omitempty"` + ResourceGroupId string `json:"resourceGroupId"` } // GetName returns CreateIntegrationInstanceInput.Name, and is useful for accessing the field via an interface. @@ -909,6 +914,9 @@ func (v *CreateIntegrationInstanceInput) GetIngestionSourcesOverrides() []Ingest // GetCollectorPoolId returns CreateIntegrationInstanceInput.CollectorPoolId, and is useful for accessing the field via an interface. func (v *CreateIntegrationInstanceInput) GetCollectorPoolId() string { return v.CollectorPoolId } +// GetResourceGroupId returns CreateIntegrationInstanceInput.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *CreateIntegrationInstanceInput) GetResourceGroupId() string { return v.ResourceGroupId } + // CreateIntegrationInstanceResponse is returned by CreateIntegrationInstance on success. type CreateIntegrationInstanceResponse struct { CreateIntegrationInstance CreateIntegrationInstanceCreateIntegrationInstance `json:"createIntegrationInstance"` @@ -1747,8 +1755,9 @@ func (v *GetComplianceLibraryItemByIdResponse) GetComplianceLibraryItem() GetCom // GetDashboardGetDashboardInsightsDashboard includes the requested fields of the GraphQL type InsightsDashboard. type GetDashboardGetDashboardInsightsDashboard struct { - Id string `json:"id"` - Name string `json:"name"` + Id string `json:"id"` + Name string `json:"name"` + ResourceGroupId string `json:"resourceGroupId"` } // GetId returns GetDashboardGetDashboardInsightsDashboard.Id, and is useful for accessing the field via an interface. @@ -1757,6 +1766,11 @@ func (v *GetDashboardGetDashboardInsightsDashboard) GetId() string { return v.Id // GetName returns GetDashboardGetDashboardInsightsDashboard.Name, and is useful for accessing the field via an interface. func (v *GetDashboardGetDashboardInsightsDashboard) GetName() string { return v.Name } +// GetResourceGroupId returns GetDashboardGetDashboardInsightsDashboard.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *GetDashboardGetDashboardInsightsDashboard) GetResourceGroupId() string { + return v.ResourceGroupId +} + // GetDashboardResponse is returned by GetDashboard on success. type GetDashboardResponse struct { GetDashboard GetDashboardGetDashboardInsightsDashboard `json:"getDashboard"` @@ -1876,6 +1890,7 @@ type GetIntegrationInstanceIntegrationInstance struct { IngestionSourcesOverrides []GetIntegrationInstanceIntegrationInstanceIngestionSourcesOverrides `json:"ingestionSourcesOverrides"` SourceIntegrationInstanceId string `json:"sourceIntegrationInstanceId"` CollectorPoolId string `json:"collectorPoolId"` + ResourceGroupId string `json:"resourceGroupId"` PollingIntervalCronExpression GetIntegrationInstanceIntegrationInstancePollingIntervalCronExpressionIntegrationPollingIntervalCronExpression `json:"pollingIntervalCronExpression"` OffsiteComplete bool `json:"offsiteComplete"` } @@ -1919,6 +1934,11 @@ func (v *GetIntegrationInstanceIntegrationInstance) GetCollectorPoolId() string return v.CollectorPoolId } +// GetResourceGroupId returns GetIntegrationInstanceIntegrationInstance.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *GetIntegrationInstanceIntegrationInstance) GetResourceGroupId() string { + return v.ResourceGroupId +} + // GetPollingIntervalCronExpression returns GetIntegrationInstanceIntegrationInstance.PollingIntervalCronExpression, and is useful for accessing the field via an interface. func (v *GetIntegrationInstanceIntegrationInstance) GetPollingIntervalCronExpression() GetIntegrationInstanceIntegrationInstancePollingIntervalCronExpressionIntegrationPollingIntervalCronExpression { return v.PollingIntervalCronExpression @@ -2832,6 +2852,7 @@ type PatchInsightsDashboardInput struct { Published bool `json:"published"` PublishedToUserIds []string `json:"publishedToUserIds"` PublishedToGroupIds []string `json:"publishedToGroupIds"` + ResourceGroupId string `json:"resourceGroupId,omitempty"` } // GetDashboardId returns PatchInsightsDashboardInput.DashboardId, and is useful for accessing the field via an interface. @@ -2866,6 +2887,9 @@ func (v *PatchInsightsDashboardInput) GetPublishedToUserIds() []string { return // GetPublishedToGroupIds returns PatchInsightsDashboardInput.PublishedToGroupIds, and is useful for accessing the field via an interface. func (v *PatchInsightsDashboardInput) GetPublishedToGroupIds() []string { return v.PublishedToGroupIds } +// GetResourceGroupId returns PatchInsightsDashboardInput.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *PatchInsightsDashboardInput) GetResourceGroupId() string { return v.ResourceGroupId } + type QueryResultsAre string const ( @@ -3621,6 +3645,7 @@ type UpdateIntegrationInstanceInput struct { OffsiteComplete bool `json:"offsiteComplete,omitempty"` CollectorPoolId string `json:"collectorPoolId,omitempty"` IngestionSourcesOverrides []IngestionSourcesOverridesInput `json:"ingestionSourcesOverrides,omitempty"` + ResourceGroupId string `json:"resourceGroupId"` } // GetName returns UpdateIntegrationInstanceInput.Name, and is useful for accessing the field via an interface. @@ -3658,6 +3683,9 @@ func (v *UpdateIntegrationInstanceInput) GetIngestionSourcesOverrides() []Ingest return v.IngestionSourcesOverrides } +// GetResourceGroupId returns UpdateIntegrationInstanceInput.ResourceGroupId, and is useful for accessing the field via an interface. +func (v *UpdateIntegrationInstanceInput) GetResourceGroupId() string { return v.ResourceGroupId } + // UpdateIntegrationInstanceResponse is returned by UpdateIntegrationInstance on success. type UpdateIntegrationInstanceResponse struct { UpdateIntegrationInstance UpdateIntegrationInstanceUpdateIntegrationInstance `json:"updateIntegrationInstance"` @@ -5755,6 +5783,7 @@ query GetDashboard ($dashboardId: String!) { getDashboard(dashboardId: $dashboardId) { id name + resourceGroupId } } `, @@ -5845,6 +5874,7 @@ query GetIntegrationInstance ($id: String!) { } sourceIntegrationInstanceId collectorPoolId + resourceGroupId pollingIntervalCronExpression { hour dayOfWeek diff --git a/jupiterone/internal/client/integration.graphql b/jupiterone/internal/client/integration.graphql index 943585c7..a4027ff6 100644 --- a/jupiterone/internal/client/integration.graphql +++ b/jupiterone/internal/client/integration.graphql @@ -12,6 +12,7 @@ query GetIntegrationInstance($id: String!) { } sourceIntegrationInstanceId collectorPoolId + resourceGroupId pollingIntervalCronExpression { hour dayOfWeek @@ -26,7 +27,8 @@ query GetIntegrationInstance($id: String!) { # @genqlient(for: "CreateIntegrationInstanceInput.offsiteComplete", omitempty: true) # @genqlient(for: "CreateIntegrationInstanceInput.ingestionSourcesOverrides", omitempty: true) mutation CreateIntegrationInstance( - $instance: CreateIntegrationInstanceInput!) { + $instance: CreateIntegrationInstanceInput! + ) { createIntegrationInstance(instance: $instance) { id name @@ -54,8 +56,9 @@ mutation CreateIntegrationInstance( # @genqlient(for: "UpdateIntegrationInstanceInput.offsiteComplete", omitempty: true) # @genqlient(for: "UpdateIntegrationInstanceInput.ingestionSourcesOverrides", omitempty: true) mutation UpdateIntegrationInstance( - $id: String!, - $update: UpdateIntegrationInstanceInput!) { + $id: String! + $update: UpdateIntegrationInstanceInput! +) { updateIntegrationInstance(id: $id, update: $update) { id name @@ -82,5 +85,3 @@ mutation DeleteIntegrationInstance($id: String!) { success } } - - From 1fc244f6c89b8c7e2a08e61d673ad82a2afe151f Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Mon, 25 Nov 2024 14:44:42 -0500 Subject: [PATCH 2/5] APP-15799 - Add integration resourceGroupId --- jupiterone/resource_integration.go | 14 ++++++++++++++ jupiterone/resource_integration_test.go | 3 +++ 2 files changed, 17 insertions(+) diff --git a/jupiterone/resource_integration.go b/jupiterone/resource_integration.go index ba8dbf22..30e6ff2d 100644 --- a/jupiterone/resource_integration.go +++ b/jupiterone/resource_integration.go @@ -38,6 +38,7 @@ type IntegrationModel struct { CollectorPoolId types.String `tfsdk:"collector_pool_id"` PollingIntervalCronExpression types.String `tfsdk:"polling_interval_cron_expression"` IngestionSourcesOverrides types.List `tfsdk:"ingestion_sources_overrides"` + ResourceGroupId types.String `tfsdk:"resource_group_id"` } func NewIntegrationResource() resource.Resource { @@ -113,6 +114,10 @@ func (r *IntegrationResource) Create(ctx context.Context, req resource.CreateReq input.IngestionSourcesOverrides = overrides } + if !data.ResourceGroupId.IsNull() { + input.ResourceGroupId = data.ResourceGroupId.ValueString() + } + created, err := client.CreateIntegrationInstance(ctx, r.qlient, input) if err != nil { resp.Diagnostics.AddError("Failed to create integration instance", err.Error()) @@ -147,6 +152,7 @@ func (r *IntegrationResource) Read(ctx context.Context, req resource.ReadRequest data.PollingInterval = types.StringValue(string(response.IntegrationInstance.PollingInterval)) data.IntegrationDefinitionId = types.StringValue(response.IntegrationInstance.IntegrationDefinitionId) data.Description = types.StringValue(response.IntegrationInstance.Description) + data.ResourceGroupId = types.StringValue(response.IntegrationInstance.ResourceGroupId) configJSON, err := json.Marshal(response.IntegrationInstance.Config) if err != nil { @@ -235,6 +241,10 @@ func (r *IntegrationResource) Update(ctx context.Context, req resource.UpdateReq input.IngestionSourcesOverrides = overrides } + if !data.ResourceGroupId.IsNull() { + input.ResourceGroupId = data.ResourceGroupId.ValueString() + } + _, err := client.UpdateIntegrationInstance(ctx, r.qlient, data.Id.ValueString(), input) if err != nil { resp.Diagnostics.AddError("Failed to update integration instance", err.Error()) @@ -322,6 +332,10 @@ func (r *IntegrationResource) Schema(ctx context.Context, req resource.SchemaReq }, }, }, + "resource_group_id": schema.StringAttribute{ + Optional: true, + Description: "The ID of the resource group to which the integration instance belongs.", + }, }, } } diff --git a/jupiterone/resource_integration_test.go b/jupiterone/resource_integration_test.go index ce33a566..06beac87 100644 --- a/jupiterone/resource_integration_test.go +++ b/jupiterone/resource_integration_test.go @@ -40,6 +40,7 @@ func TestIntegration_Basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "description", "Test integration"), resource.TestCheckResourceAttr(resourceName, "config.%", "1"), resource.TestCheckResourceAttr(resourceName, "config.key", "value"), + resource.TestCheckResourceAttr(resourceName, "resource_group_id", "rg-123456"), ), }, // Add a second step to check if the resource is stable after refresh @@ -109,6 +110,8 @@ resource "jupiterone_integration" "test" { config = { key = "value" } + + resource_group_id = "rg-123456" } `, name, integrationDefinitionId) } From 83e9a334851d1c7f02538afc60c960a59a85e9ef Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Wed, 27 Nov 2024 10:30:04 -0500 Subject: [PATCH 3/5] APP-15799 - Update dashboard resourceGroupId --- jupiterone/internal/client/dashboard.graphql | 1 - jupiterone/internal/client/generated.go | 2 +- jupiterone/resource_dashboard.go | 21 +++++++++++++------- jupiterone/resource_dashboard_test.go | 2 ++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/jupiterone/internal/client/dashboard.graphql b/jupiterone/internal/client/dashboard.graphql index feb3bbac..b2935383 100644 --- a/jupiterone/internal/client/dashboard.graphql +++ b/jupiterone/internal/client/dashboard.graphql @@ -27,7 +27,6 @@ mutation DeleteDashboard($dashboardId: String!) { # @genqlient(for: "PatchInsightsDashboardInput.layouts", omitempty: true, pointer:true) # @genqlient(for: "PatchInsightsDashboardInput.category", omitempty: true) -# @genqlient(for: "PatchInsightsDashboardInput.resourceGroupId", omitempty: true) mutation UpdateDashboard( $input: PatchInsightsDashboardInput! ) { diff --git a/jupiterone/internal/client/generated.go b/jupiterone/internal/client/generated.go index 3d3e1f7a..e0bc13e3 100644 --- a/jupiterone/internal/client/generated.go +++ b/jupiterone/internal/client/generated.go @@ -2852,7 +2852,7 @@ type PatchInsightsDashboardInput struct { Published bool `json:"published"` PublishedToUserIds []string `json:"publishedToUserIds"` PublishedToGroupIds []string `json:"publishedToGroupIds"` - ResourceGroupId string `json:"resourceGroupId,omitempty"` + ResourceGroupId string `json:"resourceGroupId"` } // GetDashboardId returns PatchInsightsDashboardInput.DashboardId, and is useful for accessing the field via an interface. diff --git a/jupiterone/resource_dashboard.go b/jupiterone/resource_dashboard.go index 0bf5e9fb..a3dff35e 100644 --- a/jupiterone/resource_dashboard.go +++ b/jupiterone/resource_dashboard.go @@ -35,9 +35,10 @@ func NewDashboard() resource.Resource { } type DashboardModel struct { - Id types.String `json:"id,omitempty" tfsdk:"id"` - Name types.String `json:"name,omitempty" tfsdk:"name"` - Type types.String `json:"type,omitempty" tfsdk:"type"` + Id types.String `json:"id,omitempty" tfsdk:"id"` + Name types.String `json:"name,omitempty" tfsdk:"name"` + Type types.String `json:"type,omitempty" tfsdk:"type"` + ResourceGroupId types.String `json:"resource_group_id" tfsdk:"resource_group_id"` } func NewDashboardResource() resource.Resource { @@ -176,6 +177,10 @@ func (*DashboardResource) Schema(ctx context.Context, req resource.SchemaRequest stringvalidator.OneOf(DashboardTypes...), }, }, + "resource_group_id": schema.StringAttribute{ + Optional: true, + Description: "The ID of the resource group that the dashboard belongs to.", + }, }, } } @@ -216,8 +221,9 @@ func (r *DashboardResource) Update(ctx context.Context, req resource.UpdateReque func (r *DashboardModel) BuildCreateInsightsDashboardInput() (client.CreateInsightsDashboardInput, error) { dashboard := client.CreateInsightsDashboardInput{ - Name: r.Name.ValueString(), - Type: client.BoardType(r.Type.ValueString()), + Name: r.Name.ValueString(), + Type: client.BoardType(r.Type.ValueString()), + ResourceGroupId: r.ResourceGroupId.ValueString(), } return dashboard, nil @@ -225,8 +231,9 @@ func (r *DashboardModel) BuildCreateInsightsDashboardInput() (client.CreateInsig func (r *DashboardModel) BuildPatchInsightsDashboardInput() (client.PatchInsightsDashboardInput, error) { dashboard := client.PatchInsightsDashboardInput{ - Name: r.Name.ValueString(), - DashboardId: r.Id.ValueString(), + Name: r.Name.ValueString(), + DashboardId: r.Id.ValueString(), + ResourceGroupId: r.ResourceGroupId.ValueString(), } return dashboard, nil diff --git a/jupiterone/resource_dashboard_test.go b/jupiterone/resource_dashboard_test.go index 1693c0bc..ea452d9e 100644 --- a/jupiterone/resource_dashboard_test.go +++ b/jupiterone/resource_dashboard_test.go @@ -66,6 +66,7 @@ func TestDashboard_BasicImport(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "name", dashboardName), resource.TestCheckResourceAttr(resourceName, "type", string(dashboardType)), + resource.TestCheckResourceAttr(resourceName, "resource_group_id", "rg-123456"), ), }, }, @@ -172,6 +173,7 @@ func testDashboardBasicConfig(rName string) string { resource "jupiterone_dashboard" "test" { name = %q type = "Account" + resource_group_id = "rg-123456" } `, rName) } From 290ae438910ed63b1dbdb53127c28c738bc47f66 Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Wed, 27 Nov 2024 10:54:40 -0500 Subject: [PATCH 4/5] APP-15799 - Update dashboard test casette --- jupiterone/cassettes/TestDashboard_Basic.yaml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/jupiterone/cassettes/TestDashboard_Basic.yaml b/jupiterone/cassettes/TestDashboard_Basic.yaml index a1dcd662..bc391d9e 100644 --- a/jupiterone/cassettes/TestDashboard_Basic.yaml +++ b/jupiterone/cassettes/TestDashboard_Basic.yaml @@ -6,13 +6,13 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 380 + content_length: 410 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nmutation CreateDashboard ($input: CreateInsightsDashboardInput!) {\n\tcreateDashboard(input: $input) {\n\t\tname\n\t\tid\n\t}\n}\n","variables":{"input":{"name":"tf-provider-test-dashboard","type":"Account","userIds":null,"groupIds":null,"widgets":null,"published":false,"publishedToUserIds":null,"publishedToGroupIds":null,"ttd":0}},"operationName":"CreateDashboard"}' + body: '{"query":"\nmutation CreateDashboard ($input: CreateInsightsDashboardInput!) {\n\tcreateDashboard(input: $input) {\n\t\tname\n\t\tid\n\t}\n}\n","variables":{"input":{"name":"tf-provider-test-dashboard","type":"Account","userIds":null,"groupIds":null,"widgets":null,"published":false,"publishedToUserIds":null,"publishedToGroupIds":null,"ttd":0,"resourceGroupId":"rg-123456"}},"operationName":"CreateDashboard"}' form: {} headers: Cache-Control: @@ -30,7 +30,7 @@ interactions: content_length: 111 uncompressed: false body: | - {"data":{"createDashboard":{"name":"tf-provider-test-dashboard","id":"86a338a3-7783-4fdb-8c68-347aa4d811fb"}}} + {"data":{"createDashboard":{"name":"tf-provider-test-dashboard","id":"bed628b8-6c68-4f0d-9f6d-b8bbb4580ef3"}}} headers: Access-Control-Allow-Credentials: - "true" @@ -78,19 +78,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 662.687334ms + duration: 714.17575ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 229 + content_length: 250 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nquery GetDashboard ($dashboardId: String!) {\n\tgetDashboard(dashboardId: $dashboardId) {\n\t\tid\n\t\tname\n\t}\n}\n","variables":{"dashboardId":"86a338a3-7783-4fdb-8c68-347aa4d811fb"},"operationName":"GetDashboard"}' + body: '{"query":"\nquery GetDashboard ($dashboardId: String!) {\n\tgetDashboard(dashboardId: $dashboardId) {\n\t\tid\n\t\tname\n\t\tresourceGroupId\n\t}\n}\n","variables":{"dashboardId":"bed628b8-6c68-4f0d-9f6d-b8bbb4580ef3"},"operationName":"GetDashboard"}' form: {} headers: Cache-Control: @@ -105,15 +105,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 108 + content_length: 138 uncompressed: false body: | - {"data":{"getDashboard":{"id":"86a338a3-7783-4fdb-8c68-347aa4d811fb","name":"tf-provider-test-dashboard"}}} + {"data":{"getDashboard":{"id":"bed628b8-6c68-4f0d-9f6d-b8bbb4580ef3","name":"tf-provider-test-dashboard","resourceGroupId":"rg-123456"}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "108" + - "138" Content-Security-Policy: - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;form-action ''self'';frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' Content-Type: @@ -156,7 +156,7 @@ interactions: - "0" status: 200 OK code: 200 - duration: 662.471625ms + duration: 408.778792ms - id: 2 request: proto: HTTP/1.1 @@ -168,7 +168,7 @@ interactions: host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nmutation DeleteDashboard ($dashboardId: String!) {\n\tdeleteDashboard(dashboardId: $dashboardId) {\n\t\tsuccess\n\t}\n}\n","variables":{"dashboardId":"86a338a3-7783-4fdb-8c68-347aa4d811fb"},"operationName":"DeleteDashboard"}' + body: '{"query":"\nmutation DeleteDashboard ($dashboardId: String!) {\n\tdeleteDashboard(dashboardId: $dashboardId) {\n\t\tsuccess\n\t}\n}\n","variables":{"dashboardId":"bed628b8-6c68-4f0d-9f6d-b8bbb4580ef3"},"operationName":"DeleteDashboard"}' form: {} headers: Cache-Control: @@ -234,4 +234,4 @@ interactions: - "0" status: 200 OK code: 200 - duration: 729.556542ms + duration: 455.243375ms From f67ada912cfcff869d20c0cd603c43e006d80031 Mon Sep 17 00:00:00 2001 From: bjoepfeiffer Date: Wed, 27 Nov 2024 11:01:58 -0500 Subject: [PATCH 5/5] Make docs --- docs/resources/dashboard.md | 4 ++++ docs/resources/integration.md | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/resources/dashboard.md b/docs/resources/dashboard.md index a65e2cf0..33130ec0 100644 --- a/docs/resources/dashboard.md +++ b/docs/resources/dashboard.md @@ -95,6 +95,10 @@ resource "jupiterone_widget" "plot-compliance-per-control" { - `name` (String) The name of the dashboard. - `type` (String) The type of the dashboard. +### Optional + +- `resource_group_id` (String) The ID of the resource group that the dashboard belongs to. + ### Read-Only - `id` (String) The ID of this resource. diff --git a/docs/resources/integration.md b/docs/resources/integration.md index 0577419f..9cb79d9d 100644 --- a/docs/resources/integration.md +++ b/docs/resources/integration.md @@ -76,6 +76,7 @@ resource "jupiterone_integration" "example_custom_integration" { - `description` (String) The description of the integration instance. - `ingestion_sources_overrides` (List of Object) Overrides for ingestion sources. (see [below for nested schema](#nestedatt--ingestion_sources_overrides)) - `polling_interval_cron_expression` (String) The cron expression for the polling interval as a JSON string. +- `resource_group_id` (String) The ID of the resource group to which the integration instance belongs. - `source_integration_instance_id` (String) The ID of the source integration instance. ### Read-Only