Closed peterhubbard-mongodb closed 2 weeks ago
Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:
The ticket CLOUDP-251354 was created for internal tracking.
This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!
Hi @peterhubbard-mongodb.
From the terraform configuration provided it would appear that you are using an incorrect value for the api_key_id
attribute.
resource "mongodbatlas_access_list_api_key" "test" {
org_id = "5a05659xxxxxxxxx"
ip_address = "104.30.134.186"
api_key_id = "uxxxxx"
}
Instead of providing the public key value, you must provide the key id (24 character long string). One simple way of obtaining this value is by using the api_keys data source.
Let me know if this solves your issue.
Regarding the mention of mongodbatlas_project_ip_access_list_key
in the documentation: This is outdated and is being fixed in https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2337, thanks for bringing it up.
This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!
Is there an existing issue for this?
Provider Version
v1.15.3
Terraform Version
v1.7.5
Terraform Edition
Terraform Open Source (OSS)
Current Behavior
Trying to restrict access for an API key returns a 400 error:
mongodbatlas_access_list_api_key.test: Creating... ╷ │ Error: error create API key: https://cloud.mongodb.com/api/atlas/v2/orgs/5a05659cd383ad74f1cc1047/apiKeys/ugurosox/accessList POST: HTTP 400 Bad Request (Error code: "PATH_PARAM_PARSE_ERROR") Detail: One or more path parameter in the request URI /api/atlas/v2/orgs/5a05659xxxxx7/apiKeys/uxxxxx/accessList is malformed. Reason: Bad Request. Params: [/api/atlas/v2/orgs/5a05659xxxx/apiKeys/uxxxxx/accessList] │ │ with mongodbatlas_access_list_api_key.test, │ on api_key.tf line 1, in resource "mongodbatlas_access_list_api_key" "test": │ 1: resource "mongodbatlas_access_list_api_key" "test" { │
Documentation claims that "The mongodbatlas_project_ip_access_list_key resource can be used to manage all Programmatic API Keys, regardless of whether they were created at the Organization level or Project level." but this resource does not exist:
╷ │ Error: Invalid resource type │ │ on api_key.tf line 1, in resource "mongodbatlas_project_ip_access_list_key" "test": │ 1: resource "mongodbatlas_project_ip_access_list_key" "test" { │ │ The provider mongodb/mongodbatlas does not support resource type "mongodbatlas_project_ip_access_list_key".
Terraform configuration to reproduce the issue
Steps To Reproduce
Logs
No response
Code of Conduct