diff --git a/docs/resources/cockpit.md b/docs/resources/cockpit.md index 2073c5fe15..4114d02a37 100644 --- a/docs/resources/cockpit.md +++ b/docs/resources/cockpit.md @@ -9,6 +9,11 @@ page_title: "Scaleway: scaleway_cockpit" As of September 2024, Cockpit has introduced [regionalization](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#region) to offer more flexibility and resilience. If you have created customized dashboards with data for your Scaleway resources before April 2024, you will need to update your queries in Grafana, with the new regionalized [data sources](../resources/cockpit_source.md). +-> **Note:** +Cockpit plans scheduled for deprecation on January 1st 2025. +The retention period previously set for your logs and metrics will remain the same after that date. +You will be able to edit the retention period for your metrics, logs, and traces for free during Beta. + Please note that even if you provide the grafana_url, it will only be active if a [Grafana user](../resources/cockpit_grafana_user.md) is created first. Make sure to create a Grafana user in your Cockpit instance to enable full access to Grafana. The `scaleway_cockpit` resource allows you to create and manage Scaleway Cockpit instances. diff --git a/internal/services/cockpit/cockpit.go b/internal/services/cockpit/cockpit.go index f7c114e0e8..f575f3e386 100644 --- a/internal/services/cockpit/cockpit.go +++ b/internal/services/cockpit/cockpit.go @@ -103,7 +103,7 @@ func ResourceCockpitCreate(ctx context.Context, d *schema.ResourceData, m interf if targetPlanI, ok := d.GetOk("plan"); ok { targetPlan := targetPlanI.(string) - plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) + plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) //nolint:staticcheck if err != nil { return diag.FromErr(err) } @@ -120,7 +120,7 @@ func ResourceCockpitCreate(ctx context.Context, d *schema.ResourceData, m interf return diag.Errorf("plan %s not found", targetPlan) } - _, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{ + _, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{ //nolint:staticcheck ProjectID: projectID, PlanName: cockpit.PlanName(planName), }, scw.WithContext(ctx)) @@ -150,8 +150,7 @@ func ResourceCockpitRead(ctx context.Context, d *schema.ResourceData, m interfac return diag.FromErr(err) } } - - res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{ + res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{ //nolint:staticcheck ProjectID: projectID, }, scw.WithContext(ctx)) if err != nil { @@ -214,7 +213,7 @@ func ResourceCockpitUpdate(ctx context.Context, d *schema.ResourceData, m interf targetPlan = targetPlanI.(string) } - plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) + plans, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) //nolint:staticcheck if err != nil { return diag.FromErr(err) } @@ -231,7 +230,7 @@ func ResourceCockpitUpdate(ctx context.Context, d *schema.ResourceData, m interf return diag.Errorf("plan %s not found", targetPlan) } - _, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{ + _, err = api.SelectPlan(&cockpit.GlobalAPISelectPlanRequest{ //nolint:staticcheck ProjectID: projectID, PlanName: cockpit.PlanName(planName), }, scw.WithContext(ctx)) diff --git a/internal/services/cockpit/cockpit_data_source.go b/internal/services/cockpit/cockpit_data_source.go index 5dbfa08028..fed9bec77f 100644 --- a/internal/services/cockpit/cockpit_data_source.go +++ b/internal/services/cockpit/cockpit_data_source.go @@ -53,7 +53,7 @@ func dataSourceCockpitRead(ctx context.Context, d *schema.ResourceData, m interf } } - res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{ + res, err := api.GetCurrentPlan(&cockpit.GlobalAPIGetCurrentPlanRequest{ //nolint:staticcheck ProjectID: projectID, }, scw.WithContext(ctx)) if err != nil { diff --git a/internal/services/cockpit/plan_data_source.go b/internal/services/cockpit/plan_data_source.go index 9d4b35b57d..1e9c1d245f 100644 --- a/internal/services/cockpit/plan_data_source.go +++ b/internal/services/cockpit/plan_data_source.go @@ -31,7 +31,7 @@ func DataSourceCockpitPlanRead(ctx context.Context, d *schema.ResourceData, m in name := d.Get("name").(string) - res, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) + res, err := api.ListPlans(&cockpit.GlobalAPIListPlansRequest{}, scw.WithContext(ctx), scw.WithAllPages()) //nolint:staticcheck if err != nil { return diag.FromErr(err) }