You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this isn't production-ready, but I wanted to try out Terraform + MongoDB for an university project and tried to allow all IP addresses to access the project I've created in MongoDB Atlas.
It is applied correctly, however, terraform throws a "Provider produced inconsistent result after apply" error saying that the allowed IP address is an empty string.
Also tried replacing the IP value with an empty string, but it throws an "Invalid Attribute Value" error with this message: "Attribute ip_address string value must be defined as a valid IP Address., got: "
Terraform configuration to reproduce the issue
variable"mongodbatlas_public_key" {
type=stringnullable=falsesensitive=true
}
variable"mongodbatlas_private_key" {
type=stringnullable=falsesensitive=true
}
variable"mongodbatlas_project_name" {
type=stringdescription="The MongoDB Atlas Project Name"default="project"
}
variable"mongodb_allowed_ip_address" {
type=stringdescription="The IP Address to add to the IP Access List"default="0.0.0.0"
}
terraform {
required_providers {
mongodbatlas={
source ="mongodb/mongodbatlas"
version ="~> 1.0"
}
}
required_version=">= 1.0"
}
provider"mongodbatlas" {
public_key=var.mongodbatlas_public_keyprivate_key=var.mongodbatlas_private_key
}
data"mongodbatlas_roles_org_id""project" {
}
resource"mongodbatlas_project""project" {
name=var.mongodbatlas_project_nameorg_id=data.mongodbatlas_roles_org_id.project.org_id
}
resource"mongodbatlas_project_ip_access_list""ip" {
project_id=mongodbatlas_project.project.idip_address=var.mongodb_allowed_ip_addresscomment="IP Address for accessing the cluster"
}
Steps To Reproduce
Run terraform apply
Provide API public key and private key (could be provided using a terraform.tvars file too)
Enter yes
Logs
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to mongodbatlas_project_ip_access_list.ip, provider "provider[\"registry.terraform.io/mongodb/mongodbatlas\"]" produced an unexpected new value: .ip_address:
│ was cty.StringVal("0.0.0.0"), but now cty.StringVal("").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:
Terraform configuration file used to reproduce the issue
Terraform log files from the run where the issue occurred
Terraform Atlas provider version used to reproduce the issue
Terraform version used to reproduce the issue
Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment
The ticket CLOUDP-251134 was created for internal tracking.
resource"mongodbatlas_project_ip_access_list""ip" {
project_id=mongodbatlas_project.project.idip_address="0.0.0.0"comment="IP Address for accessing the cluster"
}
With:
resource"mongodbatlas_project_ip_access_list""ip" {
project_id=mongodbatlas_project.project.idcidr_block="0.0.0.0/0"comment="CIDR Block for accessing the cluster"
}
Is there an existing issue for this?
Provider Version
~> 1.0
Terraform Version
v1.8.4
Terraform Edition
Terraform Open Source (OSS)
Current Behavior
I know this isn't production-ready, but I wanted to try out Terraform + MongoDB for an university project and tried to allow all IP addresses to access the project I've created in MongoDB Atlas.
It is applied correctly, however, terraform throws a "Provider produced inconsistent result after apply" error saying that the allowed IP address is an empty string.
Also tried replacing the IP value with an empty string, but it throws an "Invalid Attribute Value" error with this message: "Attribute ip_address string value must be defined as a valid IP Address., got: "
Terraform configuration to reproduce the issue
Steps To Reproduce
terraform apply
terraform.tvars
file too)yes
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: