@@ -83,17 +83,17 @@ resource "aws_vpc_peering_connection_accepter" "peer" {
83
83
# Container example provided but not always required,
84
84
# see network_container documentation for details.
85
85
resource "mongodbatlas_network_container" "test" {
86
- project_id = "${ local.project_id}"
86
+ project_id = local.project_id
87
87
atlas_cidr_block = "10.8.0.0/21"
88
88
provider_name = "GCP"
89
89
}
90
90
91
91
# Create the peering connection request
92
92
resource "mongodbatlas_network_peering" "test" {
93
- project_id = "${ local.project_id}"
94
- container_id = "${ mongodbatlas_network_container.test.container_id}"
93
+ project_id = local.project_id
94
+ container_id = mongodbatlas_network_container.test.container_id
95
95
provider_name = "GCP"
96
- gcp_project_id = "${ local.GCP_PROJECT_ID}"
96
+ gcp_project_id = local.GCP_PROJECT_ID
97
97
network_name = "default"
98
98
}
99
99
@@ -105,13 +105,13 @@ data "google_compute_network" "default" {
105
105
# Create the GCP peer
106
106
resource "google_compute_network_peering" "peering" {
107
107
name = "peering-gcp-terraform-test"
108
- network = "${ data.google_compute_network.default.self_link}"
108
+ network = data.google_compute_network.default.self_link
109
109
peer_network = "https://www.googleapis.com/compute/v1/projects/${mongodbatlas_network_peering.test.atlas_gcp_project_id}/global/networks/${mongodbatlas_network_peering.test.atlas_vpc_name}"
110
110
}
111
111
112
112
# Create the cluster once the peering connection is completed
113
113
resource "mongodbatlas_cluster" "test" {
114
- project_id = "${ local.project_id}"
114
+ project_id = local.project_id
115
115
name = "terraform-manually-test"
116
116
num_shards = 1
117
117
disk_size_gb = 5
@@ -148,26 +148,27 @@ resource "mongodbatlas_cluster" "test" {
148
148
# Container example provided but not always required,
149
149
# see network_container documentation for details.
150
150
resource "mongodbatlas_network_container" "test" {
151
- project_id = "${ local.project_id}"
152
- atlas_cidr_block = "10.8.0.0/21"
151
+ project_id = local.project_id
152
+ atlas_cidr_block = local.ATLAS_CIDR_BLOCK
153
153
provider_name = "AZURE"
154
154
region = "US_EAST_2"
155
155
}
156
156
157
157
# Create the peering connection request
158
158
resource "mongodbatlas_network_peering" "test" {
159
- project_id = "${ local.project_id}"
160
- container_id = "${ mongodbatlas_network_container.test.container_id}"
159
+ project_id = local.project_id
160
+ container_id = mongodbatlas_network_container.test.container_id
161
161
provider_name = "AZURE"
162
- azure_directory_id = "${local.AZURE_DIRECTORY_ID}"
163
- azure_subscription_id = "${local.AZURE_SUBSCRIPTION_ID}"
164
- resource_group_name = "${local.AZURE_RESOURCES_GROUP_NAME}"
165
- vnet_name = "${local.AZURE_VNET_NAME}"
162
+ azure_directory_id = local.AZURE_DIRECTORY_ID
163
+ azure_subscription_id = local.AZURE_SUBSCRIPTION_ID
164
+ resource_group_name = local.AZURE_RESOURCES_GROUP_NAME
165
+ vnet_name = local.AZURE_VNET_NAME
166
+ atlas_cidr_block = mongodbatlas_network_container.test.atlas_cidr_block
166
167
}
167
168
168
169
# Create the cluster once the peering connection is completed
169
170
resource "mongodbatlas_cluster" "test" {
170
- project_id = "${ local.project_id}"
171
+ project_id = local.project_id
171
172
name = "terraform-manually-test"
172
173
num_shards = 1
173
174
@@ -259,7 +260,7 @@ resource "mongodbatlas_cluster" "test" {
259
260
260
261
# Create the peering connection request
261
262
resource "mongodbatlas_network_peering" "test" {
262
- project_id = "${ local.project_id}"
263
+ project_id = local.project_id
263
264
atlas_cidr_block = "192.168.0.0/18"
264
265
265
266
container_id = mongodbatlas_cluster.test.container_id
@@ -313,6 +314,7 @@ resource "mongodbatlas_network_peering" "test" {
313
314
azure_subscription_id = local.AZURE_SUBSCRIPTION_ID
314
315
resource_group_name = local.AZURE_RESOURCE_GROUP_NAME
315
316
vnet_name = local.AZURE_VNET_NAME
317
+ atlas_cidr_block = local.ATLAS_CIDR_BLOCK
316
318
}
317
319
```
318
320
0 commit comments