From 24351c90c56b1cf4893b90decf8ad1a2099d0074 Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Thu, 23 Nov 2023 16:58:39 +0100 Subject: [PATCH] deprecate: root project_id attribute is deprecated in resource --- mongodbatlas/resource_project_api_key.go | 6 ++++-- website/docs/r/project_api_key.html.markdown | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mongodbatlas/resource_project_api_key.go b/mongodbatlas/resource_project_api_key.go index d4cf549920..7d7a53b0cd 100644 --- a/mongodbatlas/resource_project_api_key.go +++ b/mongodbatlas/resource_project_api_key.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "go.mongodb.org/atlas-sdk/v20231115001/admin" @@ -30,8 +31,9 @@ func ResourceProjectAPIKey() *schema.Resource { }, Schema: map[string]*schema.Schema{ "project_id": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.16.0"), }, "api_key_id": { Type: schema.TypeString, diff --git a/website/docs/r/project_api_key.html.markdown b/website/docs/r/project_api_key.html.markdown index 63b7797cde..c9b4069193 100644 --- a/website/docs/r/project_api_key.html.markdown +++ b/website/docs/r/project_api_key.html.markdown @@ -46,7 +46,7 @@ resource "mongodbatlas_project_api_key" "test" { ## Argument Reference * `description` - (Required) Description of this Project API key. -* `project_id` - Unique 24-hexadecimal digit string that identifies your project. +* `project_id` - Unique 24-hexadecimal digit string that identifies your project. **WARNING:** this parameter is deprecated as it no longer needs to be defined. It will be removed in version 1.16.0. ~> **NOTE:** Project created by API Keys must belong to an existing organization.