-
Notifications
You must be signed in to change notification settings - Fork 209
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Provider Version
v2.1.0
Terraform Version
v1.13.4
Terraform Edition
Terraform Cloud
Current Behavior
When updating a mongodbatlas_organization resource (add security contact), the existing mongodbatlas_cloud_user_team_assignment resources error because the user_id is undefined
Error: Missing Configuration for Required Attribute
│
│ with mongodbatlas_cloud_user_team_assignment.platform_admin_foo,
│ on user-team-assignments.tf line 22, in resource "mongodbatlas_cloud_user_team_assignment" "platform_admin_foo":
│ 22: user_id = data.mongodbatlas_cloud_user_org_assignment.foo.user_id
│
│ Must set a configuration value for the user_id attribute as the provider
│ has marked it as required.
Terraform configuration to reproduce the issue
resource "mongodbatlas_organization" "org" {
name = "Org Name"
}
data "mongodbatlas_cloud_user_org_assignment" "foo" {
org_id = mongodbatlas_organization.org.org_id
username = "[email protected]"
}
resource "mongodbatlas_team" "platform_admin" {
org_id = mongodbatlas_organization.org.org_id
name = "platform-admin"
}
resource "mongodbatlas_cloud_user_team_assignment" "platform_admin_foo" {
org_id = mongodbatlas_organization.org.org_id
team_id = mongodbatlas_team.platform_admin.team_id
user_id = data.mongodbatlas_cloud_user_org_assignment.foo.user_id
}Steps To Reproduce
Once you have applied the change above, add the security contact to the org resource and run a plan. This will result in the following error Error: Missing Configuration for Required Attribute
Logs
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels