Skip to content

Commit

Permalink
Remove dashboard_item.id from exposed fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tlindsay committed Dec 3, 2024
1 parent 3a95d34 commit 2f72446
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 0 additions & 4 deletions docs/resources/custom_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,6 @@ Optional:

- `span` (Number) The number of columns for the dashboard item to span. Dashboards are rendered on a 12-column grid on "desktop" screen sizes.

Read-Only:

- `id` (String) Dashboard item identifier (UUID).

<a id="nestedblock--dashboard_item--data_source"></a>
### Nested Schema for `dashboard_item.data_source`

Expand Down
14 changes: 2 additions & 12 deletions fastly/resource_fastly_custom_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ func resourceFastlyCustomDashboard() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"data_source": &schemaDataSource,
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Dashboard item identifier (UUID).",
},
"span": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -300,7 +295,6 @@ func flattenDashboardItems(remoteState []gofastly.DashboardItem) []map[string]in
}

result = append(result, map[string]interface{}{
"id": di.ID,
"title": di.Title,
"subtitle": di.Subtitle,
"span": di.Span,
Expand Down Expand Up @@ -334,8 +328,8 @@ func resourceItems(d *schema.ResourceData) ([]gofastly.DashboardItem, error) {
func mapToDashboardItem(m map[string]any) (*gofastly.DashboardItem, error) {
var errs []error
var (
id, title, subtitle string
span int
title, subtitle string
span int

dataSourceList, sourceConfigList []any
dataSource, sourceConfig map[string]any
Expand All @@ -351,9 +345,6 @@ func mapToDashboardItem(m map[string]any) (*gofastly.DashboardItem, error) {
var ok bool

// Top-level fields
if id, ok = m["id"].(string); !ok {
errs = append(errs, fmt.Errorf("invalid id: %#v", m["id"]))
}
if title, ok = m["title"].(string); !ok {
errs = append(errs, fmt.Errorf("invalid title: %#v", m["title"]))
}
Expand Down Expand Up @@ -436,7 +427,6 @@ func mapToDashboardItem(m map[string]any) (*gofastly.DashboardItem, error) {
}

return &gofastly.DashboardItem{
ID: id,
DataSource: gofastly.DashboardDataSource{
Config: gofastly.DashboardSourceConfig{
Metrics: metrics,
Expand Down

0 comments on commit 2f72446

Please sign in to comment.