Skip to content

Commit 7e111a1

Browse files
toppercodesampagent
andcommitted
Ignore dashboard metadata fields in resource state
Amp-Thread-ID: https://ampcode.com/threads/T-019c9bc7-a165-774f-b025-2e92d6e0b9d5 Co-authored-by: Amp <amp@ampcode.com>
1 parent 2a05deb commit 7e111a1

2 files changed

Lines changed: 0 additions & 32 deletions

File tree

axiom/resource_dashboard.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/hashicorp/terraform-plugin-framework/resource"
1313
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
1414
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
15-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
1615
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1716
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1817
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -48,10 +47,6 @@ type DashboardResourceModel struct {
4847
Dashboard types.String `tfsdk:"dashboard"`
4948
Version types.Int64 `tfsdk:"version"`
5049
Overwrite types.Bool `tfsdk:"overwrite"`
51-
CreatedAt types.String `tfsdk:"created_at"`
52-
UpdatedAt types.String `tfsdk:"updated_at"`
53-
CreatedBy types.String `tfsdk:"created_by"`
54-
UpdatedBy types.String `tfsdk:"updated_by"`
5550
}
5651

5752
type dashboardUpsertRequest struct {
@@ -106,32 +101,13 @@ func (r *DashboardResource) Schema(_ context.Context, _ resource.SchemaRequest,
106101
"version": schema.Int64Attribute{
107102
Computed: true,
108103
MarkdownDescription: "Monotonic dashboard version used for optimistic updates.",
109-
PlanModifiers: []planmodifier.Int64{
110-
int64planmodifier.UseStateForUnknown(),
111-
},
112104
},
113105
"overwrite": schema.BoolAttribute{
114106
Optional: true,
115107
Computed: true,
116108
Default: booldefault.StaticBool(false),
117109
MarkdownDescription: "When `true`, force update and ignore `version` conflicts.",
118110
},
119-
"created_at": schema.StringAttribute{
120-
Computed: true,
121-
MarkdownDescription: "Creation timestamp returned by the API.",
122-
},
123-
"updated_at": schema.StringAttribute{
124-
Computed: true,
125-
MarkdownDescription: "Last update timestamp returned by the API.",
126-
},
127-
"created_by": schema.StringAttribute{
128-
Computed: true,
129-
MarkdownDescription: "Creator returned by the API.",
130-
},
131-
"updated_by": schema.StringAttribute{
132-
Computed: true,
133-
MarkdownDescription: "Last updater returned by the API.",
134-
},
135111
},
136112
}
137113
}
@@ -398,10 +374,6 @@ func flattenDashboardResource(in dashboardResourcePayload, overwrite types.Bool,
398374
Dashboard: types.StringValue(normalizedDashboard),
399375
Version: types.Int64Value(in.Version),
400376
Overwrite: overwrite,
401-
CreatedAt: types.StringValue(in.CreatedAt),
402-
UpdatedAt: types.StringValue(in.UpdatedAt),
403-
CreatedBy: types.StringValue(in.CreatedBy),
404-
UpdatedBy: types.StringValue(in.UpdatedBy),
405377
}, nil
406378
}
407379

docs/resources/dashboard.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ description: |-
2020

2121
### Read-Only
2222

23-
- `created_at` (String) Creation timestamp returned by the API.
24-
- `created_by` (String) Creator returned by the API.
2523
- `id` (String) Dashboard identifier (same value as `uid`).
26-
- `updated_at` (String) Last update timestamp returned by the API.
27-
- `updated_by` (String) Last updater returned by the API.
2824
- `version` (Number) Monotonic dashboard version used for optimistic updates.
2925

3026
## Import

0 commit comments

Comments
 (0)