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
242 stars 168 forks source link

data "mongodbatlas_project" doesn't return name #788

Closed JosephKelly closed 2 years ago

JosephKelly commented 2 years ago

When using mongodbatlas_project data, searching by project_id, the project name is not included in the terraform data object. The documentation lists it as an attribute.

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v1.2.5
issue with both:
- mongodb/mongodbatlas v1.4.2
- mongodb/mongodbatlas v1.4.1

Terraform Configuration File

terraform {
  required_providers {
    mongodbatlas = {
      source  = "mongodb/mongodbatlas"
      version = "~> 1"
    }
  }
}
variable "project_id" {
  type        = string
  description = "MongoDB Atlas Project ID"
}
data "mongodbatlas_project" "project" {
  project_id = var.project_id
}

output "project_name" {
  value = data.mongodbatlas_project.project.name
  description = "(Expected) Name of the MongoDB Atlas Cluster"
}

Steps to Reproduce

  1. terraform init
  2. terraform apply -var project_id=$ANY_PROJECT_ID

    Expected Behavior

    Expected output available, e.g.

    project_name = _[name of the project as reported from API call]_

Actual Behavior

NO OUTPUT as data.mongodbatlas_project.project.name is null

themantissa commented 2 years ago

Thank you @JosephKelly - we'll take a look. Internal ticket INTMDB-351

martinstibbe commented 2 years ago

@JosephKelly This is corrected in next release 1.4.4.

themantissa commented 2 years ago

@JosephKelly release 1.4.4. it out. Thank you!