feat: Add mcp config org secret resources - #4652
Conversation
ec9c82e to
f03c33b
Compare
…ss review comments
f03c33b to
ecc365c
Compare
…LOUDP-435895-mcp-config-org-secret # Conflicts: # internal/provider/provider.go # tools/codegen/config.yml
|
APIx bot: a message has been sent to Docs Slack channel |
🤖 Augment PR SummarySummary: Adds Terraform support for organization-level Remote MCP configuration ingress secrets. Changes:
Technical Notes: The resource marks the create response's 🤖 Was this summary useful? React with 👍 or 👎 |
| Computed: true, | ||
| MarkdownDescription: "The masked Service Account secret.", | ||
| }, | ||
| "secret": dsschema.StringAttribute{ |
There was a problem hiding this comment.
results.secret is exposed as a non-sensitive computed attribute, even though this list endpoint is documented to return metadata only. The generator's ignore only matches root-level secret, so if this field is ever present in a list response its plaintext value will be written to Terraform state and displayed as non-sensitive. Other locations where this applies: tools/codegen/models/mcp_config_secret.yaml:281, docs/data-sources/mcp_config_secrets.md:43.
Severity: high
Other Locations
tools/codegen/models/mcp_config_secret.yaml:281docs/data-sources/mcp_config_secrets.md:43
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| Import the MCP Config Secret resource by using the Organization ID, MCP Config ID, and Secret ID in the format `ORG_ID/MCP_CONFIG_ID/SECRET_ID`, e.g. | ||
| ``` | ||
| $ terraform import mongodbatlas_mcp_config_secret.test 6117ac2fe2a3d04ed27a987v/8423867e-394c-4f1e-9d81-32d323a1dd81/6a79adb34c91a97469c7fd1d | ||
| ``` |
There was a problem hiding this comment.
The sample organization ID ends in v, which is not hexadecimal although org_id is required to be a 24-hexadecimal-digit ID. Copying this import command will therefore use an invalid organization identifier. Other locations where this applies: docs/resources/mcp_config_secret.md:60.
Severity: low
Other Locations
docs/resources/mcp_config_secret.md:60
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| @@ -0,0 +1,25 @@ | |||
| # MongoDB Atlas Provider -- MCP Config Secret | |||
There was a problem hiding this comment.
q: Did we make a decision about grouping these mcp examples? Seems like they are all very connected
There was a problem hiding this comment.
Context on previous discussions: We do want an example per reesource. It ensures that customers can always find an example for the specific resource they are concerned about. (same for AI agents)
| @@ -0,0 +1,9 @@ | |||
| data "mongodbatlas_mcp_config_secrets" "this" { | |||
There was a problem hiding this comment.
is this a convention we are using? putting plural and singlular data sources in separate files?
There was a problem hiding this comment.
Yes, this follows the log_integration examples structure (discussed in org config resources PR comments)
| "github.com/hashicorp/terraform-plugin-framework/types" | ||
| ) | ||
|
|
||
| func DataSourceSchema(ctx context.Context) dsschema.Schema { |
There was a problem hiding this comment.
when would this be useful to the user? Is there any value in any of the computed attributes?
There was a problem hiding this comment.
the singular data source lets a user look up a secret's metadata without having the resource itself in their Terraform config/state. expires_at is useful for tracking when it needs rotating.
manupedrozo
left a comment
There was a problem hiding this comment.
Didn't go through the full PR yet, left some comments
|
|
||
| # {{.Type}}: {{.Name}} | ||
|
|
||
| `{{.Name}}` describes an ingress secret for an Organization Remote MCP Configuration. Secret values are never returned; only masked metadata is available. |
There was a problem hiding this comment.
Lets revisit these descriptions, see the SA secret docs as examples: https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/data-sources/service_account_secret
| `{{.Name}}` provides an Organization MCP Config Secret resource. The resource lets you create and delete ingress secrets for an [`mongodbatlas_mcp_config`](mcp_config.md) configuration. The egress Service Account secret is system-managed, automatically rotated, and is not exposed through this or any other public resource. | ||
|
|
||
| -> **NOTE:** This resource does not support updates. To rotate secrets, create a new secret resource and delete the old one once no longer needed -- up to two secrets can be active at once. | ||
|
|
||
| -> **NOTE:** Unlike [`mongodbatlas_service_account_secret`](service_account_secret.md), no auto-generated secret is created that needs to be imported. The auto-generated ingress secret from `mongodbatlas_mcp_config` creation is deleted server-side, so you always create your first secret explicitly with this resource. | ||
|
|
There was a problem hiding this comment.
Same here, I sense some AI usage for these, lets revisit. Can use https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/project_service_account_secret as an example.
no auto-generated secret is created that needs to be imported. The auto-generated ingress secret from `mongodbatlas_mcp_config` creation is deleted server-side - we discussed in a previous PR to not mention this point as it would likely just confuse customers who are not aware of how the backend works.
There was a problem hiding this comment.
Meant to change these following the last PR's discussion, sorry! fixing now.
| @@ -0,0 +1,25 @@ | |||
| # MongoDB Atlas Provider -- MCP Config Secret | |||
There was a problem hiding this comment.
Context on previous discussions: We do want an example per reesource. It ensures that customers can always find an example for the specific resource they are concerned about. (same for AI agents)
|
|
||
| ## Important Notes | ||
|
|
||
| Unlike `mongodbatlas_service_account_secret`, no auto-generated secret needs to be imported: the MCP config's create flow deletes its auto-generated ingress secret server-side, so you always create your first usable secret explicitly with this resource. |
There was a problem hiding this comment.
Would not mention mongodbatlas_service_account_secret here, also knowing that one is changing in the short term so I would avoid introducing work to update this example.
Description
Adds the mongodbatlas_mcp_config_secret resource and its singular/plural data sources (mongodbatlas_mcp_config_secret, mongodbatlas_mcp_config_secrets).
Generated via the existing autogen tooling, with schema overrides on top of the standard CRD (no update) mapping:
Includes acceptance tests, a working example, and generated docs.
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments