Skip to content

Commit dedfd24

Browse files
deprecate: root project_id attribute is deprecated in resource
1 parent 8dd67d8 commit dedfd24

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mongodbatlas/resource_project_api_key.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
12+
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant"
1213
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
1314
"github.com/mongodb/terraform-provider-mongodbatlas/internal/config"
1415
"go.mongodb.org/atlas-sdk/v20231115001/admin"
@@ -30,8 +31,9 @@ func ResourceProjectAPIKey() *schema.Resource {
3031
},
3132
Schema: map[string]*schema.Schema{
3233
"project_id": {
33-
Type: schema.TypeString,
34-
Optional: true,
34+
Type: schema.TypeString,
35+
Optional: true,
36+
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.16.0"),
3537
},
3638
"api_key_id": {
3739
Type: schema.TypeString,

website/docs/r/project_api_key.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ resource "mongodbatlas_project_api_key" "test" {
4646
## Argument Reference
4747

4848
* `description` - (Required) Description of this Project API key.
49-
* `project_id` - Unique 24-hexadecimal digit string that identifies your project.
49+
* `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.
5050

5151
~> **NOTE:** Project created by API Keys must belong to an existing organization.
5252

0 commit comments

Comments
 (0)