mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
244 stars 172 forks source link

mongodbatlas_team data provider team_id null after successful API query #277

Closed in4mer closed 4 years ago

in4mer commented 4 years ago

Versions

Terraform v0.12.29
+ provider.mongodbatlas v0.6.3

Example terraform

output "team_id" {
  value = [ data.mongodbatlas_team.devops.name, data.mongodbatlas_team.devops.team_id ]
}

data "mongodbatlas_team" "devops" {
  org_id  = var.atlas_org_id
  name    = "devops_team"
}

What I expect to happen

When a data provider is run, it should contact the API and fill in the missing fields. As is tradition.

What actually happens

When this data provider is run without team_id in its spec, team_id is null forevermore, even though the team exists and is found using the API.

Output

When run:

% terraform apply
data.mongodbatlas_team.devops: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

team_id = [
  "devops_team",
  null,
]
themantissa commented 4 years ago

@in4mer thank you for filing the issue. We'll take a look and get back to you.

themantissa commented 4 years ago

Team confirmed a bug and working on a fix.

themantissa commented 4 years ago

@in4mer we've released a preview version that should allow you to test if this fixes the issue. If you can confirm we'd appreciate it. https://github.com/mongodb/terraform-provider-mongodbatlas/releases/tag/0.6.4