Closed mbrancato closed 3 years ago
@mbrancato thank you for the issue - just to note that project_id is the id and not id (which is an internal id, we plan to improve this later but that, at first glance, may be the issue). @nikhil-mongo could you take a look when you have time? Thanks!
@mbrancato Please use the below example:
data "mongodbatlas_project" "default" {
project_id = mongodbatlas_project.integration.id
}
data "mongodbatlas_network_peering" "default" {
peering_id = mongodbatlas_network_peering.integration.connection_id
project_id = data.mongodbatlas_project.integration.id
}
So basically, I made two changes here. In order to reference the peering_id, connection_id
is used and I made change to the project in the second data section as you used default, which I believe is not the case as I see in the first data block, it is integration. Please revert if I am wrong.
And let us know if this does not works.
Thanks.
@mbrancato we'll assume this is okay since we haven't heard back. If not let us know.
Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Steps to Reproduce
Expected Behavior
read the existing peering connection
Actual Behavior
(base64 encoded project info replaced with ...)
Additional Context
I'm using this in a module. The project ID and peering ID are passed via variables to the module. I've simplified the above code to avoid the module / variable step but
mongodbatlas_network_peering.integration.id
is passed directly into the module variable and used in the data source, etc.References