diff --git a/docs/data-sources/cockpit_plan.md b/docs/data-sources/cockpit_plan.md deleted file mode 100644 index bc7cb63b87..0000000000 --- a/docs/data-sources/cockpit_plan.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -subcategory: "Cockpit" -page_title: "Scaleway: scaleway_cockpit_plan" ---- -# scaleway_cockpit_plan - -**Note:** As of January 1st, 2025, Cockpit pricing plans have been deprecated. While this data source remains available temporarily for backward compatibility, Scaleway no longer supports configuring Cockpit resources using fixed pricing plans. Instead, you should now independently configure retention periods for your data sources (metrics, logs, and traces). Refer to [Scaleway Cockpit Documentation](https://www.scaleway.com/en/docs/cockpit/concepts/#retention) for updated guidelines and [pricing information](https://www.scaleway.com/en/docs/cockpit/faq/#how-am-i-billed-for-increasing-data-retention-period). - -The `scaleway_cockpit_plan` data source retrieves details about a specific Scaleway Cockpit pricing plan. You can use this data source to manage existing Terraform configurations that reference Cockpit plans. - -Find out more about [pricing plans](https://console.scaleway.com/cockpit/plans) in the Scaleway console. - -Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. - -## Fetch and associate a pricing plan to a Cockpit - -The following command shows how to fetch information about the `premium` pricing plan and how to associate it with the Cockpit of your Scaleway default Project. - -```hcl -data "scaleway_cockpit_plan" "premium" { - name = "premium" -} - -resource "scaleway_cockpit" "main" { - plan = data.scaleway_cockpit_plan.premium.id -} -``` - -## Argument reference - -This section lists the arguments that you can provide to the `scaleway_cockpit_plan` data source to filter and retrieve the desired plan. - -- `name` - (Required) Name of the pricing plan you want to retrieve information about. diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 15407c0ffe..a45dcda829 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -259,7 +259,6 @@ func Provider(config *Config) plugin.ProviderFunc { "scaleway_block_snapshot": block.DataSourceSnapshot(), "scaleway_block_volume": block.DataSourceVolume(), "scaleway_cockpit": cockpit.DataSourceCockpit(), - "scaleway_cockpit_plan": cockpit.DataSourcePlan(), "scaleway_cockpit_source": cockpit.DataSourceCockpitSource(), "scaleway_config": scwconfig.DataSourceConfig(), "scaleway_container": container.DataSourceContainer(), diff --git a/internal/services/cockpit/plan_data_source.go b/internal/services/cockpit/plan_data_source.go deleted file mode 100644 index 395b2e88a2..0000000000 --- a/internal/services/cockpit/plan_data_source.go +++ /dev/null @@ -1,36 +0,0 @@ -package cockpit - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func DataSourcePlan() *schema.Resource { - return &schema.Resource{ - ReadContext: DataSourceCockpitPlanRead, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "[DEPRECATED] The plan field is deprecated.", - Deprecated: "The 'plan' attribute is deprecated and no longer has any effect. Future updates will remove this attribute entirely.", - }, - }, - DeprecationMessage: "This data source is deprecated and will be removed in the next major version. Use `my_new_data_source` instead.", - } -} - -func DataSourceCockpitPlanRead(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics { - d.SetId("free") - _ = d.Set("name", "free") - - return diag.Diagnostics{ - diag.Diagnostic{ - Severity: diag.Warning, - Summary: "Data source 'cockpit_plan' has been removed", - Detail: "The 'cockpit_plan' data source has been deprecated and is no longer available.", - }, - } -} diff --git a/internal/services/cockpit/plan_data_source_test.go b/internal/services/cockpit/plan_data_source_test.go deleted file mode 100644 index 218c1064e8..0000000000 --- a/internal/services/cockpit/plan_data_source_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package cockpit_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" -) - -func TestAccDataSourceCockpitPlan_Basic(t *testing.T) { - tt := acctest.NewTestTools(t) - defer tt.Cleanup() - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, - ProviderFactories: tt.ProviderFactories, - Steps: []resource.TestStep{ - { - Config: ` - data "scaleway_cockpit_plan" "free" { - name = "free" - } - - data "scaleway_cockpit_plan" "premium" { - name = "premium" - } - - data "scaleway_cockpit_plan" "custom" { - name = "custom" - } - `, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet("data.scaleway_cockpit_plan.free", "id"), - resource.TestCheckResourceAttrSet("data.scaleway_cockpit_plan.premium", "id"), - resource.TestCheckResourceAttrSet("data.scaleway_cockpit_plan.custom", "id"), - ), - }, - }, - }) -} diff --git a/internal/services/cockpit/testdata/data-source-cockpit-plan-basic.cassette.yaml b/internal/services/cockpit/testdata/data-source-cockpit-plan-basic.cassette.yaml deleted file mode 100644 index 2797c38e00..0000000000 --- a/internal/services/cockpit/testdata/data-source-cockpit-plan-basic.cassette.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -version: 2 -interactions: []