Comments (6)
@PacoDw , thanks for the fix. The issue is resolved.
from terraform-provider-mongodbatlas.
Hello @bobhlo thanks for your review, could you share us your terraform configuration to recreate the issue? just avoiding sensitive information.
from terraform-provider-mongodbatlas.
Hi @PacoDw,
Please see following configuration in the module. One thing noted is terraform tried to update resource "mongodbatlas_network_peering.rest" with atlas_cidr_block which was not changed.
module.dev_jcdigital_test345_atlas.mongodbatlas_network_peering.rest will be updated in-place
~ resource "mongodbatlas_network_peering" "rest" {
+ atlas_cidr_block = "192.168.32.0/24"
atlas_id = ""
azure_directory_id = ""
azure_subscription_id = ""
container_id = ""
id = ""
peer_id = ""
project_id = ""
provider_name = "AZURE"
resource_group_name = "dev-jcdigital-test345-rg"
status = "AVAILABLE"
vnet_name = "dev-jcdigital-test345-vnet"
}
Code starts below:
# Create file for peering role
data "template_file" "peering_role" {
template = "${file("${path.module}/templates/peering-role.tpl")}"
vars = {
subscription_id = "${var.subscription_id}"
rg = "${var.rg}"
vnet = "${var.vnet}"
}
}
# Peering role files
resource "local_file" "peering_role" {
content = "${data.template_file.peering_role.rendered}"
filename = "${path.module}/files/{var.environment}-${var.customer}-${var.site}-peering-role.json"
}
# Configure the MongoDB Atlas Provider
provider "mongodbatlas" {
public_key = "${var.atlas_public_key}"
private_key = "${var.atlas_private_key}"
}
# Create a Group
resource "mongodbatlas_project" "rest" {
org_id = "${var.atlas_org_id}"
name = "${var.environment}-${var.customer}-${var.site}"
}
# Create a Container
resource "mongodbatlas_network_container" "rest" {
project_id = "${mongodbatlas_project.rest.id}"
atlas_cidr_block = "${var.atlas_cidr_block}"
provider_name = "${var.atlas_provider_name}"
region = "${var.atlas_region}"
}
#Create a Network Peering Connection
resource "mongodbatlas_network_peering" "rest" {
project_id = "${mongodbatlas_project.rest.id}"
atlas_cidr_block = "${var.atlas_cidr_block}"
container_id = "${mongodbatlas_network_container.rest.container_id}"
provider_name = "${var.atlas_provider_name}"
azure_directory_id = "${var.tenant_id}"
azure_subscription_id = "${var.subscription_id}"
resource_group_name = "${var.rg}"
vnet_name = "${var.vnet}"
}
# Whitelist REST and JConnect vnets
resource "mongodbatlas_project_ip_whitelist" "rest" {
project_id = "${mongodbatlas_project.rest.id}"
whitelist {
cidr_block = "${var.vnet_cidr}"
comment = "cidr block for ${var.vnet}"
}
whitelist {
cidr_block = "${var.prod_jcdigital_jconnect_cidr}"
comment = "cidr block for ${var.prod_jcdigital_jconnect_vnet}"
}
}
# Create Atlas cluster for sense-rest
resource "mongodbatlas_cluster" "rest" {
project_id = "${mongodbatlas_project.rest.id}"
name = "${var.environment}-${var.customer}-${var.site}"
disk_size_gb = 64
num_shards = 1
mongo_db_major_version = "${var.atlas_mongodb_version}"
replication_factor = 3
backup_enabled = true
auto_scaling_disk_gb_enabled = true
//Provider Settings "block"
provider_name = "${var.atlas_provider_name}"
provider_encrypt_ebs_volume = false
provider_instance_size_name = "${var.atlas_cluster_tier}"
provider_region_name = "${var.atlas_region}"
provider_disk_type_name = "P6"
}
# DB admin user to manage the database
resource "mongodbatlas_database_user" "rest" {
username = "${var.dbuser}"
password = "${var.atlas_dbuser_password}"
project_id = "${mongodbatlas_project.rest.id}"
database_name = "admin" # DB where db user created
roles {
role_name = "readWrite"
database_name = "${var.rest_db_name}"
}
}
from terraform-provider-mongodbatlas.
Thanks, we will check it to find the solution as soon as possible 👍
from terraform-provider-mongodbatlas.
@bobhlo, Modified your code to make it more readable.
from terraform-provider-mongodbatlas.
Hello @@bobhlo, the issue was resolved you can test it on pr #22
If you have another issue or comments just let us know, thank you.
from terraform-provider-mongodbatlas.
Related Issues (20)
- [Bug] mongodbatlas_custom_db_role created with the wrong permissions HOT 5
- [Feature]: mongodbatlas_event_trigger does not support Database operations HOT 4
- [Bug]: mongodbatlas_access_list_api_key CIDRs/subnets (not single IPs) fresh create after upgrade from 1.14 to 1.15 HOT 5
- Terraform lifecycle ignore_changes tags HOT 3
- [Bug]: CDKTF is trying to recreate PrivatelinkEndpointServiceServerless when it's already created HOT 14
- [Bug]: Federated Data Instances does not handle `dataProcessRegion` HOT 5
- [Bug]: Removing `mongodbatlas_cloud_backup_schedule` resource is resulting in error `Continuous Cloud Backup cannot be on without an hourly policy item` HOT 2
- Assigning existing Organization API key to new/updated projects HOT 4
- 401 Unauthorised when creating privatelink endpoint HOT 6
- [Bug][Question][Help needed]: Not able to fetch federated online archived connection string HOT 4
- [Bug]: Documentation fix request HOT 4
- [Bug]: nil pointer dereference when setting "minimum_enabled_tls_protocol" to "TLS1_3" HOT 4
- [Bug]: Resource mongodbatlas_cloud_backup_schedule doesn't provide policy_item_yearly HOT 2
- [Bug]: No way to fetch online archive's connection string HOT 2
- [Bug]: Documentation HOT 5
- [Bug]: Documentation issue HOT 5
- [Bug]: plugin crashed during creation of mongodbatlas_search_index HOT 5
- [Bug]: Error: Provider produced inconsistent result after apply - .region_usage_restrictions: was null, but now cty.StringVal("COMMERCIAL_FEDRAMP_REGIONS_ONLY") HOT 4
- [Bug]: Removing mongodbatlas_alert_configuration resource block after Alert was deleted manually in UI results in 401 Unauthorized Error in Subsequent Plan HOT 4
- [Bug]: error updating MongoDB Network Peering Connection - 400 (request "INVALID_ATTRIBUTE") Invalid attribute azureDirectoryId specified HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-mongodbatlas.