Skip to content

Commit 5936c9d

Browse files
Remove spaces from workgroup name
1 parent b94cbe3 commit 5936c9d

File tree

5 files changed

+35
-31
lines changed

5 files changed

+35
-31
lines changed

terraform/README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ MS Fabric provides a 60 days trial for the service. After this period, a [Fabric
2626

2727
The required variables required for the solution deployment are the following:
2828
```
29-
mongodbatlas_public_key = "<Valid_Public_API_Key>"
30-
mongodbatlas_private_key = "<Valid_Private_API_Key>"
31-
mongodbatlas_group_id = "<MongoDB_Atlas_Project_ID>"
32-
mongodbatlas_clustername = "<MongoDB_Atlas_ClusterName>"
33-
mongodbatlas_dbName = "<MongoDB+Atlas_Database_name>"
34-
mongodbatlas_userpass = "<DBUser>:<Password>"
35-
owner_tag = "<MongoDB_Username.Lastname>"
36-
subscription_id = "<MongoDB_Azure_Subscrition_ID>"
37-
azure_region = "australiacentral"
29+
mongodbatlas_public_key = "<mongodb_atlas_public_key>"
30+
mongodbatlas_private_key = "<mongodb_atlas_private_key>"
31+
mongodbatlas_group_id = "<mongodb_atlas_project_id>"
32+
mongodbatlas_clustername = "<mongodb_atlas_cluster_name>"
33+
mongodbatlas_dbName = "<mongodb_atlas_collection_name>"
34+
mongodbatlas_collectionName = "all"
35+
mongodbatlas_userpass = "<mongodb_atlas_database_username>:<mongodb_atlas_database_password>"
36+
owner_tag = "<user_identification>"
37+
subscription_id = "<azure_subscription_id>"
38+
azure_region = "<azure_region_name>"
3839
azure_vault_name = ""
3940
fabric_capacity_sku = "<MS-Fabric-Capacity-SKU>"
41+
initSyncBatchSize = "100000"
42+
incrementalSyncBatchSize = "1000"
43+
incrementalSyncMaxTimeInterval = "180"
4044
```
4145

4246
- MongoDB Atlas authentication keys as requested in the pre-requisites section
@@ -49,8 +53,9 @@ fabric_capacity_sku = "<MS-Fabric-Capacity-SKU>"
4953
- Subscription ID can be obtained by running the `az login` command
5054
- `azure_vault_name`is optional and uses a random value by default
5155
- The Fabric Capacity SKU String can be found in Fabric's [Admin portal](https://app.fabric.microsoft.com/admin-portal/capacities/capacitiesList/trial?experience=fabric-developer) page.
56+
- The values for `initSyncBatchSize`, `incrementalSyncBatchSize` and `incrementalSyncMaxTimeInterval` can be teaked through these parameters.
5257

53-
Variables can be stored on the `terraform.tfvars` file, or provided when `terraform plan` is executed.
58+
Variables can be stored on the `terraform.tfvars` file, or provided when `terraform plan` is executed. You can copy the file `terraform_tfvars.example` as `terraform.tfvars` and update the values.
5459

5560
### Deploying without Secure network communication ###
5661

@@ -108,7 +113,7 @@ Run `terraform plan --out plan_name.tfplan`, then `terraform apply "plan_name.tf
108113
|Microsoft Azure|vault-\[randomid\]|Key vault|
109114
|Microsoft Azure|mongodb-atlas-fabric-service-plan|App Service plan|
110115
|Microsoft Azure|mongodbatlasfabricmirrordbsynch|App Service|
111-
|Microsoft Fabric|MongoDB Atlas Azure Fabric Mirrored Database Integration|Workspace|
116+
|Microsoft Fabric|MongoDB_Atlas_Azure_Fabric_Mirrored_Database_Integration|Workspace|
112117
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|Mirrored Database|
113118
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|Semantic model (default)|
114119
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|SQL analytics endpoint|
@@ -122,11 +127,13 @@ Run `terraform plan --out plan_name.tfplan`, then `terraform apply "plan_name.tf
122127
|Microsoft Azure|mongodb-atlas-fabric-resourceGroup|Resource Group|
123128
|Microsoft Azure|mongodb-atlas-fabric-service-plan|App Service plan|
124129
|Microsoft Azure|mongodbatlasfabricmirrordbsynch|App Service|
125-
|Microsoft Fabric|MongoDB Atlas Azure Fabric Mirrored Database Integration|Workspace|
130+
|Microsoft Fabric|MongoDB_Atlas_Azure_Fabric_Mirrored_Database_Integration|Workspace|
126131
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|Mirrored Database|
127132
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|Semantic model (default)|
128133
|Microsoft Fabric|MongoDB Atlas - Fabric Mirrored Database|SQL analytics endpoint|
129134
135+
Most of the resources will have the `-[random-value]` suffix to avoid conflict in case the solution is deployed in more than one region on Azure.
136+
130137
# Deleting the deployed resources #
131138
132139
The deployed solution can be deleted using the Terraform CLI ```terraform destroy``` command, which will remove all resources from Fabric, Azure and MongoDB Atlas. The database will not be affected by this action.

terraform/azureResources.tf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "random_string" "random_suffix" {
66
upper = false
77
}
88
resource "azurerm_resource_group" "mongodb-atlas-fabric-resourceGroup" {
9-
name = "mongodb-atlas-fabric-resourceGroup"
9+
name = "mongodb-atlas-fabric-resourceGroup-${random_string.random_suffix.result}"
1010
location = var.azure_region
1111
tags = {
1212
owner = var.owner_tag
@@ -17,7 +17,7 @@ resource "azurerm_resource_group" "mongodb-atlas-fabric-resourceGroup" {
1717
}
1818

1919
resource "azurerm_virtual_network" "mongodb-atlas-fabric-vNet" {
20-
name = "mongodb-atlas-fabric-vNet"
20+
name = "mongodb-atlas-fabric-vNet-${random_string.random_suffix.result}"
2121
location = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.location
2222
resource_group_name = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.name
2323
address_space = ["10.0.0.0/16"]
@@ -122,7 +122,6 @@ resource "azurerm_service_plan" "mongodb-atlas-fabric-service-simple-plan" {
122122
}
123123

124124
resource "azurerm_key_vault" "mongodb-atlas-fabric-mirrordb-vault" {
125-
# name = "mongodbatlasfabricvault3"
126125
name = coalesce(var.azure_vault_name, "vault-${random_string.random_suffix.result}")
127126
resource_group_name = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.name
128127
sku_name = var.azure_vault_sku_name
@@ -162,21 +161,21 @@ resource "azurerm_key_vault" "mongodb-atlas-fabric-mirrordb-vault" {
162161
}
163162

164163
resource "azuread_application_registration" "mongodb-atlas-fabric-mirrordb-integration" {
165-
display_name = "mongodb-atlas-fabric-mirrordb-integration"
164+
display_name = "mongodb-atlas-fabric-mirrordb-integration-${random_string.random_suffix.result}"
166165
}
167166

168167
resource "azuread_application_password" "mongodb-atlas-fabric-mirrordb-integration-secret" {
169168
application_id = azuread_application_registration.mongodb-atlas-fabric-mirrordb-integration.id
170169
}
171170

172171
resource "azurerm_key_vault_secret" "mongodb-atlas-fabric-mirrordb-integration-secretValue" {
173-
name = "mongodb-atlas-fabric-app-secret-v2"
172+
name = "mongodb-atlas-fabric-app-secret-v2-${random_string.random_suffix.result}"
174173
value = azuread_application_password.mongodb-atlas-fabric-mirrordb-integration-secret.value
175174
key_vault_id = azurerm_key_vault.mongodb-atlas-fabric-mirrordb-vault.id
176175
}
177176

178177
resource "azurerm_private_endpoint" "mongodb-atlas-fabric-mirrordb-integration-privateEndpoint" {
179-
name = "${var.project_name}-private-endpoint"
178+
name = "${var.project_name}-private-endpoint-${random_string.random_suffix.result}"
180179
location = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.location
181180
resource_group_name = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.name
182181
subnet_id = azurerm_subnet.mongodb-atlas-fabric-PrivateLinkSubnet[0].id
@@ -199,7 +198,7 @@ resource "azurerm_private_endpoint" "mongodb-atlas-fabric-mirrordb-integration-p
199198

200199
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app
201200
resource "azurerm_linux_web_app" "mongodb-atlas-fabric-mirrordb-integration-webapp" {
202-
name = "mongodbatlasfabricmirrordbsynch"
201+
name = "mongodbatlasfabricmirrordbsynch-${random_string.random_suffix.result}"
203202
resource_group_name = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.name
204203
location = azurerm_service_plan.mongodb-atlas-fabric-service-plan[0].location
205204
service_plan_id = azurerm_service_plan.mongodb-atlas-fabric-service-plan[0].id
@@ -237,7 +236,7 @@ resource "azurerm_linux_web_app" "mongodb-atlas-fabric-mirrordb-integration-weba
237236

238237
resource "azurerm_linux_web_app" "mongodb-atlas-fabric-mirrordb-integration-simple-webapp" {
239238
count = try(var.deployPrivateEnvironment ? 0 : 1, 0)
240-
name = "mongodbatlasfabricmirrordbsynch"
239+
name = "mongodbatlasfabricmirrordbsynch-${random_string.random_suffix.result}"
241240
resource_group_name = azurerm_resource_group.mongodb-atlas-fabric-resourceGroup.name
242241
location = azurerm_service_plan.mongodb-atlas-fabric-service-simple-plan[0].location
243242
service_plan_id = azurerm_service_plan.mongodb-atlas-fabric-service-simple-plan[0].id
@@ -289,4 +288,4 @@ resource "azurerm_app_service_source_control" "mongodb-atlas-fabric-mirrordb-int
289288
depends_on = [ azurerm_linux_web_app.mongodb-atlas-fabric-mirrordb-integration-simple-webapp[0] ]
290289
//
291290
count = try(var.deployPrivateEnvironment ? 0 : 1, 0)
292-
}
291+
}

terraform/fabricResources.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "fabric_workspace" "mongodb-atlas-mirrored-db-workspace" {
2-
display_name = "MongoDB Atlas Azure Fabric Mirrored Database Integration - ${random_string.random_suffix.result}"
2+
display_name = "MongoDB_Atlas_Azure_Fabric_Mirrored_Database_Integration-${random_string.random_suffix.result}"
33
identity = {
44
type = "SystemAssigned"
55
}

terraform/terraform_tfvars.example

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
mongodbatlas_public_key = "<mongodb_atlas_public>key>"
1+
mongodbatlas_public_key = "<mongodb_atlas_public_key>"
22
mongodbatlas_private_key = "<mongodb_atlas_private_key>"
33
mongodbatlas_group_id = "<mongodb_atlas_project_id>"
44
mongodbatlas_clustername = "<mongodb_atlas_cluster_name>"
55
mongodbatlas_dbName = "<mongodb_atlas_collection_name>"
6+
mongodbatlas_collectionName = "all"
67
mongodbatlas_userpass = "<mongodb_atlas_database_username>:<mongodb_atlas_database_password>"
78
owner_tag = "<user_identification>"
89
subscription_id = "<azure_subscription_id>"
910
azure_region = "<azure_region_name>"
1011
azure_vault_name = ""
11-
fabric_capacity_sku = "<fabric_sku_id>"
12+
fabric_capacity_sku = "<MS-Fabric-Capacity-SKU>"
13+
initSyncBatchSize = "100000"
14+
incrementalSyncBatchSize = "1000"
15+
incrementalSyncMaxTimeInterval = "180"
1216
# deployPrivateEnvironment = false
1317
# azure_sku_name = "F1"

terraform/variables.tf

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ variable "mongodbatlas_dbName" {
1717

1818
}
1919
variable "mongodbatlas_collectionName" {
20-
default = "all"
20+
2121
}
2222
variable "mongodbatlas_userpass"{
2323
//MongoDB database username:password
2424
type = string
2525
}
2626
variable "owner_tag" {
2727

28-
}
29-
variable "keep_until" {
30-
3128
}
3229
variable "subscription_id" {
3330

@@ -60,17 +57,14 @@ variable "applicationLogLevel" {
6057
variable "initSyncBatchSize" {
6158
//Batch size (rows) used for initial sync
6259
type = string
63-
default ="100000"
6460
}
6561
variable "incrementalSyncBatchSize" {
6662
//Batch size (rows) used for incremental sync
6763
type = string
68-
default = "1000"
6964
}
7065
variable "incrementalSyncMaxTimeInterval" {
7166
//Time interval (in secs), incremental sync waits before replicating accumulated changes when next event occurs
7267
type = string
73-
default = "180"
7468
}
7569

7670
variable "deployPrivateEnvironment" {

0 commit comments

Comments
 (0)