-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
500 response on /groups/GROUP-ID/peers #320
Comments
@nikhil-mongo thanks for sharing the sample repo. The code in the repo matches the attributes that I've set on my end as well. If you are unable to reproduce the issue, then feel free to close this issue. I was never actually able to successfully run this end-to-end. I had to manually create resources and import them into my terraform state |
@igaskin When I compared your shared code with the sample-repo, I found the below difference. And, I was able to repro the error you mentioned which I why I shared the sample repo. Your code:
Sample Repo:
This causes the 500 error. Please fix this and you should be able to do it via terraform. |
Ah, thanks for pointing that out! Is there value of exposing
This makes me believe that the Any thoughts on using the |
@igaskin Yes, you are right.
And I could see that both these values @themantissa Is there any possibility of doing this or any implications if we do this? |
The are two different values - the id will return the actual Terraform id from state, which can be useful when situations arise where you need to interact with state: https://www.terraform.io/docs/commands/state/index.html for example list takes the state id. The container id returns the value Atlas gives the container - https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/ (it may look the same in the state file but when returned it's the actual Atlas container id). |
Understood. This is the first example I've seen of a provider exposing the state id directly in a resource's attributes, which is what caused my confusion. Arguably a more idiomatic way of interacting with the state in HCL is via the terraform_remote_state data object.
Given that this is an intentional design choice of the mongodbatlas provider, we should close this issue. |
@coderGo93 and @leofigy I'll lean on you both to provide context around why we exposed this directly. After giving our development team time to respond I'll close this issue, thank you @igaskin |
Hi @igaskin You're right is a design decision, there is a composed id per resource that is used to get an easy path for import terraform resources. Now for this use case, I agree it's a bit confusing to have two ids attributes, one as the |
Terraform CLI and Terraform MongoDB Atlas Provider Version
The text was updated successfully, but these errors were encountered: