terraform-provider-mongodbatlas icon indicating copy to clipboard operation
terraform-provider-mongodbatlas copied to clipboard

data "mongodbatlas_project" doesn't return name

Open JosephKelly opened this issue 1 year ago • 2 comments

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

JosephKelly avatar Jul 14 '22 12:07 JosephKelly

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

themantissa avatar Jul 19 '22 22:07 themantissa

@JosephKelly This is corrected in next release 1.4.4.

martinstibbe avatar Aug 02 '22 04:08 martinstibbe

@JosephKelly release 1.4.4. it out. Thank you!

themantissa avatar Aug 19 '22 20:08 themantissa